@memberjunction/ng-entity-relationship-diagram 0.0.1 → 2.130.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 (38) hide show
  1. package/README.md +754 -27
  2. package/dist/lib/components/entity-details/entity-details.component.d.ts +70 -0
  3. package/dist/lib/components/entity-details/entity-details.component.d.ts.map +1 -0
  4. package/dist/lib/components/entity-details/entity-details.component.js +694 -0
  5. package/dist/lib/components/entity-details/entity-details.component.js.map +1 -0
  6. package/dist/lib/components/entity-filter-panel/entity-filter-panel.component.d.ts +48 -0
  7. package/dist/lib/components/entity-filter-panel/entity-filter-panel.component.d.ts.map +1 -0
  8. package/dist/lib/components/entity-filter-panel/entity-filter-panel.component.js +179 -0
  9. package/dist/lib/components/entity-filter-panel/entity-filter-panel.component.js.map +1 -0
  10. package/dist/lib/components/erd-composite/erd-composite.component.d.ts +170 -0
  11. package/dist/lib/components/erd-composite/erd-composite.component.d.ts.map +1 -0
  12. package/dist/lib/components/erd-composite/erd-composite.component.js +391 -0
  13. package/dist/lib/components/erd-composite/erd-composite.component.js.map +1 -0
  14. package/dist/lib/components/erd-diagram.component.d.ts +486 -0
  15. package/dist/lib/components/erd-diagram.component.d.ts.map +1 -0
  16. package/dist/lib/components/erd-diagram.component.js +1936 -0
  17. package/dist/lib/components/erd-diagram.component.js.map +1 -0
  18. package/dist/lib/components/mj-entity-erd.component.d.ts +261 -0
  19. package/dist/lib/components/mj-entity-erd.component.d.ts.map +1 -0
  20. package/dist/lib/components/mj-entity-erd.component.js +416 -0
  21. package/dist/lib/components/mj-entity-erd.component.js.map +1 -0
  22. package/dist/lib/entity-relationship-diagram.module.d.ts +83 -0
  23. package/dist/lib/entity-relationship-diagram.module.d.ts.map +1 -0
  24. package/dist/lib/entity-relationship-diagram.module.js +121 -0
  25. package/dist/lib/entity-relationship-diagram.module.js.map +1 -0
  26. package/dist/lib/interfaces/erd-types.d.ts +491 -0
  27. package/dist/lib/interfaces/erd-types.d.ts.map +1 -0
  28. package/dist/lib/interfaces/erd-types.js +6 -0
  29. package/dist/lib/interfaces/erd-types.js.map +1 -0
  30. package/dist/lib/utils/entity-to-erd-adapter.d.ts +64 -0
  31. package/dist/lib/utils/entity-to-erd-adapter.d.ts.map +1 -0
  32. package/dist/lib/utils/entity-to-erd-adapter.js +231 -0
  33. package/dist/lib/utils/entity-to-erd-adapter.js.map +1 -0
  34. package/dist/public-api.d.ts +9 -0
  35. package/dist/public-api.d.ts.map +1 -0
  36. package/dist/public-api.js +16 -0
  37. package/dist/public-api.js.map +1 -0
  38. package/package.json +45 -6
@@ -0,0 +1,416 @@
1
+ import { Component, Input, Output, EventEmitter, ViewChild, ChangeDetectionStrategy } from '@angular/core';
2
+ import { Metadata } from '@memberjunction/core';
3
+ import { ERDDiagramComponent } from './erd-diagram.component';
4
+ import { buildERDDataFromEntities, getOriginalEntityFromERDNode } from '../utils/entity-to-erd-adapter';
5
+ import * as i0 from "@angular/core";
6
+ import * as i1 from "./erd-diagram.component";
7
+ /**
8
+ * Higher-level MemberJunction Entity ERD component that provides a simplified API
9
+ * for displaying entity relationship diagrams using EntityInfo objects.
10
+ *
11
+ * This component wraps the generic `ERDDiagramComponent` and handles the transformation
12
+ * of MemberJunction EntityInfo objects to the generic ERD format automatically.
13
+ *
14
+ * ## Key Features
15
+ *
16
+ * - **Simple Input**: Just pass `EntityInfo[]` - no manual transformation needed
17
+ * - **Auto-Discovery**: Automatically discovers and displays relationships
18
+ * - **Configurable Depth**: Control how many relationship hops to include
19
+ * - **State Control**: Parent controls selection/state - component doesn't persist
20
+ *
21
+ * ## Usage Modes
22
+ *
23
+ * ### Single Entity Mode (Entity Form)
24
+ * Show one entity and its immediate relationships:
25
+ *
26
+ * ```html
27
+ * <mj-entity-erd
28
+ * [entities]="[currentEntity]"
29
+ * [selectedEntityId]="currentEntity.ID"
30
+ * [depth]="1"
31
+ * (openRecord)="onOpenRecord($event)">
32
+ * </mj-entity-erd>
33
+ * ```
34
+ *
35
+ * ### Multi-Entity Mode (Schema Explorer)
36
+ * Show multiple entities with persistence handled by parent:
37
+ *
38
+ * ```html
39
+ * <mj-entity-erd
40
+ * [entities]="filteredEntities"
41
+ * [selectedEntityId]="savedSelectedId"
42
+ * [depth]="savedDepth"
43
+ * (entitySelected)="onEntitySelected($event); saveState()"
44
+ * (stateChange)="onStateChange($event); saveState()"
45
+ * (openRecord)="onOpenRecord($event)">
46
+ * </mj-entity-erd>
47
+ * ```
48
+ *
49
+ * ## Important Design Decisions
50
+ *
51
+ * - **No State Persistence**: This component does NOT persist user state (selection, zoom, etc.).
52
+ * The parent is responsible for saving/restoring state via the inputs and events.
53
+ * - **No Filtering**: The caller filters entities before passing them. This keeps the component simple.
54
+ * - **Controlled Selection**: Selection is controlled via `selectedEntityId` input. The component
55
+ * emits `entitySelected` when user clicks, but parent decides what to do.
56
+ *
57
+ * @see ERDDiagramComponent for the underlying generic component
58
+ */
59
+ export class MJEntityERDComponent {
60
+ erdDiagram;
61
+ // ============================================================================
62
+ // INPUTS - Data
63
+ // ============================================================================
64
+ /**
65
+ * The entities to display in the ERD.
66
+ * Pass one or more EntityInfo objects. The component will automatically
67
+ * discover and display related entities based on the `depth` setting.
68
+ *
69
+ * @example
70
+ * ```typescript
71
+ * // Single entity
72
+ * [entities]="[currentEntity]"
73
+ *
74
+ * // Multiple entities (schema view)
75
+ * [entities]="filteredEntities"
76
+ * ```
77
+ */
78
+ entities = [];
79
+ /**
80
+ * All entities in the system for relationship discovery.
81
+ * If not provided, uses Metadata.Entities automatically.
82
+ * This is used to look up related entities when building the ERD.
83
+ */
84
+ allEntities;
85
+ /**
86
+ * ID of the currently selected entity.
87
+ * Controlled by parent - the component emits selection events but doesn't
88
+ * manage selection state internally.
89
+ */
90
+ selectedEntityId = null;
91
+ /**
92
+ * IDs of entities to highlight (in addition to selected).
93
+ */
94
+ highlightedEntityIds = [];
95
+ /**
96
+ * ID of entity to focus on (shows only this entity and related up to depth).
97
+ * If null, shows all provided entities.
98
+ */
99
+ focusEntityId = null;
100
+ /**
101
+ * Focus depth when focusEntityId is set.
102
+ */
103
+ focusDepth = 1;
104
+ // ============================================================================
105
+ // INPUTS - Relationship Options
106
+ // ============================================================================
107
+ /**
108
+ * Number of relationship hops to include when auto-discovering related entities.
109
+ * - `0`: Show only the provided entities (no auto-discovery)
110
+ * - `1`: Show provided entities + directly related entities (default)
111
+ * - `2+`: Show entities within N relationship hops
112
+ *
113
+ * @default 1
114
+ */
115
+ depth = 1;
116
+ /**
117
+ * Include incoming relationships (entities that reference these entities).
118
+ * @default true
119
+ */
120
+ includeIncoming = true;
121
+ /**
122
+ * Include outgoing relationships (entities these reference via FK).
123
+ * @default true
124
+ */
125
+ includeOutgoing = true;
126
+ // ============================================================================
127
+ // INPUTS - Configuration
128
+ // ============================================================================
129
+ /**
130
+ * Configuration options passed to the underlying ERD component.
131
+ */
132
+ config = {};
133
+ /**
134
+ * Whether to show the header bar with controls.
135
+ * @default true
136
+ */
137
+ showHeader = true;
138
+ /**
139
+ * Title for the header bar.
140
+ */
141
+ headerTitle = 'Entity Relationship Diagram';
142
+ /**
143
+ * Whether the diagram is in a loading/refreshing state.
144
+ */
145
+ isRefreshing = false;
146
+ /**
147
+ * Whether the diagram is read-only (no selection/dragging).
148
+ */
149
+ readOnly = false;
150
+ // ============================================================================
151
+ // OUTPUTS
152
+ // ============================================================================
153
+ /**
154
+ * Emitted when an entity is selected by clicking.
155
+ * The parent should update `selectedEntityId` in response.
156
+ */
157
+ entitySelected = new EventEmitter();
158
+ /**
159
+ * Emitted when the selection is cleared.
160
+ */
161
+ entityDeselected = new EventEmitter();
162
+ /**
163
+ * Emitted when an entity is double-clicked.
164
+ * Typically used to open the entity record.
165
+ */
166
+ entityDoubleClick = new EventEmitter();
167
+ /**
168
+ * Emitted when requesting to open an entity record.
169
+ * This is the standard MJ pattern for navigation.
170
+ */
171
+ openRecord = new EventEmitter();
172
+ /**
173
+ * Emitted when zoom/pan changes.
174
+ * Parent can use this for state persistence.
175
+ */
176
+ zoomChange = new EventEmitter();
177
+ /**
178
+ * Emitted when diagram state changes (selection, zoom, etc.).
179
+ * Parent can use this for state persistence.
180
+ */
181
+ stateChange = new EventEmitter();
182
+ /**
183
+ * Emitted when user requests a refresh via the header button.
184
+ */
185
+ refreshRequested = new EventEmitter();
186
+ // ============================================================================
187
+ // INTERNAL STATE
188
+ // ============================================================================
189
+ /** Computed ERD nodes */
190
+ erdNodes = [];
191
+ _metadata = new Metadata();
192
+ // ============================================================================
193
+ // LIFECYCLE
194
+ // ============================================================================
195
+ ngOnChanges(changes) {
196
+ // Rebuild ERD data when entities or relationship options change
197
+ if (changes['entities'] ||
198
+ changes['allEntities'] ||
199
+ changes['depth'] ||
200
+ changes['includeIncoming'] ||
201
+ changes['includeOutgoing']) {
202
+ this.buildERDData();
203
+ }
204
+ }
205
+ // ============================================================================
206
+ // ERD DATA BUILDING
207
+ // ============================================================================
208
+ buildERDData() {
209
+ if (!this.entities || this.entities.length === 0) {
210
+ this.erdNodes = [];
211
+ return;
212
+ }
213
+ // Use provided allEntities or fall back to Metadata
214
+ const allEntities = this.allEntities || this._metadata.Entities;
215
+ const result = buildERDDataFromEntities(this.entities, {
216
+ allEntities,
217
+ includeIncoming: this.includeIncoming,
218
+ includeOutgoing: this.includeOutgoing,
219
+ depth: this.depth
220
+ });
221
+ // DEBUG: Log node count for debugging depth issues
222
+ console.log(`[mj-entity-erd] buildERDData called with depth=${this.depth}, entities=${this.entities.length}, allEntities=${allEntities.length}, resultNodes=${result.nodes.length}, resultLinks=${result.links.length}`);
223
+ // Note: Links are derived automatically by the ERD diagram component
224
+ // from the node field relationships (relatedNodeId)
225
+ this.erdNodes = result.nodes;
226
+ }
227
+ // ============================================================================
228
+ // EVENT HANDLERS
229
+ // ============================================================================
230
+ onNodeClick(_event) {
231
+ // Let the base component handle the click
232
+ // Selection is handled via nodeSelected
233
+ }
234
+ onNodeDoubleClick(event) {
235
+ const entity = getOriginalEntityFromERDNode(event.node);
236
+ if (entity) {
237
+ this.entityDoubleClick.emit({ entity, node: event.node });
238
+ // Also emit openRecord for convenience - container handles navigation
239
+ this.openRecord.emit({
240
+ EntityName: 'Entities',
241
+ RecordID: entity.ID,
242
+ entity
243
+ });
244
+ }
245
+ }
246
+ onNodeSelected(node) {
247
+ const entity = getOriginalEntityFromERDNode(node);
248
+ if (entity) {
249
+ this.entitySelected.emit({ entity, node });
250
+ }
251
+ }
252
+ onNodeDeselected() {
253
+ this.entityDeselected.emit();
254
+ }
255
+ onZoomChange(event) {
256
+ this.zoomChange.emit(event);
257
+ }
258
+ onStateChange(state) {
259
+ this.stateChange.emit(state);
260
+ }
261
+ onRefreshRequested() {
262
+ this.refreshRequested.emit();
263
+ }
264
+ // ============================================================================
265
+ // PUBLIC API (Delegates to underlying component)
266
+ // ============================================================================
267
+ /**
268
+ * Zoom in on the diagram.
269
+ */
270
+ zoomIn() {
271
+ this.erdDiagram?.zoomIn();
272
+ }
273
+ /**
274
+ * Zoom out on the diagram.
275
+ */
276
+ zoomOut() {
277
+ this.erdDiagram?.zoomOut();
278
+ }
279
+ /**
280
+ * Reset zoom to default.
281
+ */
282
+ resetZoom() {
283
+ this.erdDiagram?.resetZoom();
284
+ }
285
+ /**
286
+ * Fit all nodes in view.
287
+ */
288
+ zoomToFit(padding) {
289
+ this.erdDiagram?.zoomToFit(padding);
290
+ }
291
+ /**
292
+ * Zoom to a specific entity.
293
+ */
294
+ zoomToEntity(entityId, scale) {
295
+ this.erdDiagram?.zoomToNode(entityId, scale);
296
+ }
297
+ /**
298
+ * Get current diagram state for persistence.
299
+ */
300
+ getState() {
301
+ return this.erdDiagram?.getState() || null;
302
+ }
303
+ /**
304
+ * Restore diagram state.
305
+ */
306
+ setState(state, restorePositions) {
307
+ this.erdDiagram?.setState(state, restorePositions);
308
+ }
309
+ /**
310
+ * Refresh the diagram.
311
+ */
312
+ refresh() {
313
+ this.buildERDData();
314
+ this.erdDiagram?.refresh();
315
+ }
316
+ /**
317
+ * Export diagram as SVG.
318
+ */
319
+ exportAsSVG() {
320
+ return this.erdDiagram?.exportAsSVG() || '';
321
+ }
322
+ /**
323
+ * Trigger a resize recalculation. Call this when the container size changes.
324
+ */
325
+ triggerResize() {
326
+ this.erdDiagram?.triggerResize();
327
+ }
328
+ static ɵfac = function MJEntityERDComponent_Factory(t) { return new (t || MJEntityERDComponent)(); };
329
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MJEntityERDComponent, selectors: [["mj-entity-erd"]], viewQuery: function MJEntityERDComponent_Query(rf, ctx) { if (rf & 1) {
330
+ i0.ɵɵviewQuery(ERDDiagramComponent, 5);
331
+ } if (rf & 2) {
332
+ let _t;
333
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.erdDiagram = _t.first);
334
+ } }, inputs: { entities: "entities", allEntities: "allEntities", selectedEntityId: "selectedEntityId", highlightedEntityIds: "highlightedEntityIds", focusEntityId: "focusEntityId", focusDepth: "focusDepth", depth: "depth", includeIncoming: "includeIncoming", includeOutgoing: "includeOutgoing", config: "config", showHeader: "showHeader", headerTitle: "headerTitle", isRefreshing: "isRefreshing", readOnly: "readOnly" }, outputs: { entitySelected: "entitySelected", entityDeselected: "entityDeselected", entityDoubleClick: "entityDoubleClick", openRecord: "openRecord", zoomChange: "zoomChange", stateChange: "stateChange", refreshRequested: "refreshRequested" }, features: [i0.ɵɵNgOnChangesFeature], decls: 1, vars: 10, consts: [[3, "nodeClick", "nodeDoubleClick", "nodeSelected", "nodeDeselected", "zoomChange", "stateChange", "refreshRequested", "nodes", "selectedNodeId", "highlightedNodeIds", "focusNodeId", "focusDepth", "config", "showHeader", "headerTitle", "isRefreshing", "readOnly"]], template: function MJEntityERDComponent_Template(rf, ctx) { if (rf & 1) {
335
+ i0.ɵɵelementStart(0, "mj-erd-diagram", 0);
336
+ i0.ɵɵlistener("nodeClick", function MJEntityERDComponent_Template_mj_erd_diagram_nodeClick_0_listener($event) { return ctx.onNodeClick($event); })("nodeDoubleClick", function MJEntityERDComponent_Template_mj_erd_diagram_nodeDoubleClick_0_listener($event) { return ctx.onNodeDoubleClick($event); })("nodeSelected", function MJEntityERDComponent_Template_mj_erd_diagram_nodeSelected_0_listener($event) { return ctx.onNodeSelected($event); })("nodeDeselected", function MJEntityERDComponent_Template_mj_erd_diagram_nodeDeselected_0_listener() { return ctx.onNodeDeselected(); })("zoomChange", function MJEntityERDComponent_Template_mj_erd_diagram_zoomChange_0_listener($event) { return ctx.onZoomChange($event); })("stateChange", function MJEntityERDComponent_Template_mj_erd_diagram_stateChange_0_listener($event) { return ctx.onStateChange($event); })("refreshRequested", function MJEntityERDComponent_Template_mj_erd_diagram_refreshRequested_0_listener() { return ctx.onRefreshRequested(); });
337
+ i0.ɵɵelementEnd();
338
+ } if (rf & 2) {
339
+ i0.ɵɵproperty("nodes", ctx.erdNodes)("selectedNodeId", ctx.selectedEntityId)("highlightedNodeIds", ctx.highlightedEntityIds)("focusNodeId", ctx.focusEntityId)("focusDepth", ctx.focusDepth)("config", ctx.config)("showHeader", ctx.showHeader)("headerTitle", ctx.headerTitle)("isRefreshing", ctx.isRefreshing)("readOnly", ctx.readOnly);
340
+ } }, dependencies: [i1.ERDDiagramComponent], encapsulation: 2, changeDetection: 0 });
341
+ }
342
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MJEntityERDComponent, [{
343
+ type: Component,
344
+ args: [{
345
+ selector: 'mj-entity-erd',
346
+ template: `
347
+ <mj-erd-diagram
348
+ [nodes]="erdNodes"
349
+ [selectedNodeId]="selectedEntityId"
350
+ [highlightedNodeIds]="highlightedEntityIds"
351
+ [focusNodeId]="focusEntityId"
352
+ [focusDepth]="focusDepth"
353
+ [config]="config"
354
+ [showHeader]="showHeader"
355
+ [headerTitle]="headerTitle"
356
+ [isRefreshing]="isRefreshing"
357
+ [readOnly]="readOnly"
358
+ (nodeClick)="onNodeClick($event)"
359
+ (nodeDoubleClick)="onNodeDoubleClick($event)"
360
+ (nodeSelected)="onNodeSelected($event)"
361
+ (nodeDeselected)="onNodeDeselected()"
362
+ (zoomChange)="onZoomChange($event)"
363
+ (stateChange)="onStateChange($event)"
364
+ (refreshRequested)="onRefreshRequested()">
365
+ </mj-erd-diagram>
366
+ `,
367
+ changeDetection: ChangeDetectionStrategy.OnPush
368
+ }]
369
+ }], null, { erdDiagram: [{
370
+ type: ViewChild,
371
+ args: [ERDDiagramComponent]
372
+ }], entities: [{
373
+ type: Input
374
+ }], allEntities: [{
375
+ type: Input
376
+ }], selectedEntityId: [{
377
+ type: Input
378
+ }], highlightedEntityIds: [{
379
+ type: Input
380
+ }], focusEntityId: [{
381
+ type: Input
382
+ }], focusDepth: [{
383
+ type: Input
384
+ }], depth: [{
385
+ type: Input
386
+ }], includeIncoming: [{
387
+ type: Input
388
+ }], includeOutgoing: [{
389
+ type: Input
390
+ }], config: [{
391
+ type: Input
392
+ }], showHeader: [{
393
+ type: Input
394
+ }], headerTitle: [{
395
+ type: Input
396
+ }], isRefreshing: [{
397
+ type: Input
398
+ }], readOnly: [{
399
+ type: Input
400
+ }], entitySelected: [{
401
+ type: Output
402
+ }], entityDeselected: [{
403
+ type: Output
404
+ }], entityDoubleClick: [{
405
+ type: Output
406
+ }], openRecord: [{
407
+ type: Output
408
+ }], zoomChange: [{
409
+ type: Output
410
+ }], stateChange: [{
411
+ type: Output
412
+ }], refreshRequested: [{
413
+ type: Output
414
+ }] }); })();
415
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJEntityERDComponent, { className: "MJEntityERDComponent", filePath: "src/lib/components/mj-entity-erd.component.ts", lineNumber: 138 }); })();
416
+ //# sourceMappingURL=mj-entity-erd.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mj-entity-erd.component.js","sourceRoot":"","sources":["../../../src/lib/components/mj-entity-erd.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,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AAM;YAMG,WAAW;kBAApB,MAAM;YAKG,gBAAgB;kBAAzB,MAAM;;kFAvJI,oBAAoB"}
@@ -0,0 +1,83 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./components/erd-diagram.component";
3
+ import * as i2 from "./components/mj-entity-erd.component";
4
+ import * as i3 from "./components/entity-details/entity-details.component";
5
+ import * as i4 from "./components/entity-filter-panel/entity-filter-panel.component";
6
+ import * as i5 from "./components/erd-composite/erd-composite.component";
7
+ import * as i6 from "@angular/common";
8
+ import * as i7 from "@angular/forms";
9
+ import * as i8 from "@progress/kendo-angular-layout";
10
+ /**
11
+ * Module for the Entity Relationship Diagram (ERD) visualization components.
12
+ *
13
+ * This module provides a complete suite of components for visualizing and
14
+ * exploring entity relationships:
15
+ *
16
+ * ## Components
17
+ *
18
+ * ### 1. ERDDiagramComponent (`<mj-erd-diagram>`)
19
+ * A generic, reusable ERD component that visualizes entity relationships using
20
+ * D3.js force-directed graphs. It works with any data conforming to the `ERDNode`
21
+ * interface and is completely decoupled from MemberJunction-specific types.
22
+ *
23
+ * ### 2. MJEntityERDComponent (`<mj-entity-erd>`)
24
+ * A higher-level wrapper specifically for MemberJunction. It accepts `EntityInfo[]`
25
+ * directly and handles all the transformation to ERD format automatically.
26
+ *
27
+ * ### 3. EntityDetailsComponent (`<mj-entity-details>`)
28
+ * A detail panel that shows entity information, fields, and relationships when
29
+ * an entity is selected. Designed to work alongside the ERD diagram.
30
+ *
31
+ * ### 4. EntityFilterPanelComponent (`<mj-entity-filter-panel>`)
32
+ * A filter panel for filtering entities by schema, name, status, and base table.
33
+ *
34
+ * ### 5. ERDCompositeComponent (`<mj-erd-composite>`)
35
+ * A complete, ready-to-use ERD exploration interface that combines:
36
+ * - Left panel: Entity filter controls
37
+ * - Center: Interactive ERD diagram
38
+ * - Right panel: Entity details (shown when an entity is selected)
39
+ *
40
+ * ### Choosing Which Component to Use
41
+ *
42
+ * | Use Case | Component |
43
+ * |----------|-----------|
44
+ * | Complete ERD exploration UI | `<mj-erd-composite>` |
45
+ * | ERD diagram with MJ EntityInfo | `<mj-entity-erd>` |
46
+ * | Custom data sources (non-MJ) | `<mj-erd-diagram>` |
47
+ * | Entity detail panel standalone | `<mj-entity-details>` |
48
+ * | Entity filter panel standalone | `<mj-entity-filter-panel>` |
49
+ *
50
+ * @example Using the composite (recommended for dashboards)
51
+ * ```html
52
+ * <mj-erd-composite
53
+ * (userStateChange)="saveUserPreferences($event)"
54
+ * (openRecord)="navigateToRecord($event)">
55
+ * </mj-erd-composite>
56
+ * ```
57
+ *
58
+ * @example Using the MJ wrapper
59
+ * ```html
60
+ * <mj-entity-erd
61
+ * [entities]="[currentEntity]"
62
+ * [selectedEntityId]="currentEntity.ID"
63
+ * [depth]="1"
64
+ * (entitySelected)="onEntitySelected($event)"
65
+ * (openRecord)="onOpenRecord($event)">
66
+ * </mj-entity-erd>
67
+ * ```
68
+ *
69
+ * @example Using the generic component
70
+ * ```html
71
+ * <mj-erd-diagram
72
+ * [nodes]="myNodes"
73
+ * [selectedNodeId]="selectedId"
74
+ * (nodeSelected)="onNodeSelected($event)">
75
+ * </mj-erd-diagram>
76
+ * ```
77
+ */
78
+ export declare class EntityRelationshipDiagramModule {
79
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityRelationshipDiagramModule, never>;
80
+ static ɵmod: i0.ɵɵNgModuleDeclaration<EntityRelationshipDiagramModule, [typeof i1.ERDDiagramComponent, typeof i2.MJEntityERDComponent, typeof i3.EntityDetailsComponent, typeof i4.EntityFilterPanelComponent, typeof i5.ERDCompositeComponent], [typeof i6.CommonModule, typeof i7.FormsModule, typeof i8.LayoutModule], [typeof i1.ERDDiagramComponent, typeof i2.MJEntityERDComponent, typeof i3.EntityDetailsComponent, typeof i4.EntityFilterPanelComponent, typeof i5.ERDCompositeComponent]>;
81
+ static ɵinj: i0.ɵɵInjectorDeclaration<EntityRelationshipDiagramModule>;
82
+ }
83
+ //# sourceMappingURL=entity-relationship-diagram.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-relationship-diagram.module.d.ts","sourceRoot":"","sources":["../../src/lib/entity-relationship-diagram.module.ts"],"names":[],"mappings":";;;;;;;;;AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,qBAqBa,+BAA+B;yCAA/B,+BAA+B;0CAA/B,+BAA+B;0CAA/B,+BAA+B;CAAG"}
@@ -0,0 +1,121 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { FormsModule } from '@angular/forms';
4
+ import { LayoutModule } from '@progress/kendo-angular-layout';
5
+ import { ERDDiagramComponent } from './components/erd-diagram.component';
6
+ import { MJEntityERDComponent } from './components/mj-entity-erd.component';
7
+ import { EntityDetailsComponent } from './components/entity-details/entity-details.component';
8
+ import { EntityFilterPanelComponent } from './components/entity-filter-panel/entity-filter-panel.component';
9
+ import { ERDCompositeComponent } from './components/erd-composite/erd-composite.component';
10
+ import * as i0 from "@angular/core";
11
+ /**
12
+ * Module for the Entity Relationship Diagram (ERD) visualization components.
13
+ *
14
+ * This module provides a complete suite of components for visualizing and
15
+ * exploring entity relationships:
16
+ *
17
+ * ## Components
18
+ *
19
+ * ### 1. ERDDiagramComponent (`<mj-erd-diagram>`)
20
+ * A generic, reusable ERD component that visualizes entity relationships using
21
+ * D3.js force-directed graphs. It works with any data conforming to the `ERDNode`
22
+ * interface and is completely decoupled from MemberJunction-specific types.
23
+ *
24
+ * ### 2. MJEntityERDComponent (`<mj-entity-erd>`)
25
+ * A higher-level wrapper specifically for MemberJunction. It accepts `EntityInfo[]`
26
+ * directly and handles all the transformation to ERD format automatically.
27
+ *
28
+ * ### 3. EntityDetailsComponent (`<mj-entity-details>`)
29
+ * A detail panel that shows entity information, fields, and relationships when
30
+ * an entity is selected. Designed to work alongside the ERD diagram.
31
+ *
32
+ * ### 4. EntityFilterPanelComponent (`<mj-entity-filter-panel>`)
33
+ * A filter panel for filtering entities by schema, name, status, and base table.
34
+ *
35
+ * ### 5. ERDCompositeComponent (`<mj-erd-composite>`)
36
+ * A complete, ready-to-use ERD exploration interface that combines:
37
+ * - Left panel: Entity filter controls
38
+ * - Center: Interactive ERD diagram
39
+ * - Right panel: Entity details (shown when an entity is selected)
40
+ *
41
+ * ### Choosing Which Component to Use
42
+ *
43
+ * | Use Case | Component |
44
+ * |----------|-----------|
45
+ * | Complete ERD exploration UI | `<mj-erd-composite>` |
46
+ * | ERD diagram with MJ EntityInfo | `<mj-entity-erd>` |
47
+ * | Custom data sources (non-MJ) | `<mj-erd-diagram>` |
48
+ * | Entity detail panel standalone | `<mj-entity-details>` |
49
+ * | Entity filter panel standalone | `<mj-entity-filter-panel>` |
50
+ *
51
+ * @example Using the composite (recommended for dashboards)
52
+ * ```html
53
+ * <mj-erd-composite
54
+ * (userStateChange)="saveUserPreferences($event)"
55
+ * (openRecord)="navigateToRecord($event)">
56
+ * </mj-erd-composite>
57
+ * ```
58
+ *
59
+ * @example Using the MJ wrapper
60
+ * ```html
61
+ * <mj-entity-erd
62
+ * [entities]="[currentEntity]"
63
+ * [selectedEntityId]="currentEntity.ID"
64
+ * [depth]="1"
65
+ * (entitySelected)="onEntitySelected($event)"
66
+ * (openRecord)="onOpenRecord($event)">
67
+ * </mj-entity-erd>
68
+ * ```
69
+ *
70
+ * @example Using the generic component
71
+ * ```html
72
+ * <mj-erd-diagram
73
+ * [nodes]="myNodes"
74
+ * [selectedNodeId]="selectedId"
75
+ * (nodeSelected)="onNodeSelected($event)">
76
+ * </mj-erd-diagram>
77
+ * ```
78
+ */
79
+ export class EntityRelationshipDiagramModule {
80
+ static ɵfac = function EntityRelationshipDiagramModule_Factory(t) { return new (t || EntityRelationshipDiagramModule)(); };
81
+ static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: EntityRelationshipDiagramModule });
82
+ static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
83
+ FormsModule,
84
+ LayoutModule] });
85
+ }
86
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EntityRelationshipDiagramModule, [{
87
+ type: NgModule,
88
+ args: [{
89
+ declarations: [
90
+ ERDDiagramComponent,
91
+ MJEntityERDComponent,
92
+ EntityDetailsComponent,
93
+ EntityFilterPanelComponent,
94
+ ERDCompositeComponent
95
+ ],
96
+ imports: [
97
+ CommonModule,
98
+ FormsModule,
99
+ LayoutModule
100
+ ],
101
+ exports: [
102
+ ERDDiagramComponent,
103
+ MJEntityERDComponent,
104
+ EntityDetailsComponent,
105
+ EntityFilterPanelComponent,
106
+ ERDCompositeComponent
107
+ ]
108
+ }]
109
+ }], null, null); })();
110
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(EntityRelationshipDiagramModule, { declarations: [ERDDiagramComponent,
111
+ MJEntityERDComponent,
112
+ EntityDetailsComponent,
113
+ EntityFilterPanelComponent,
114
+ ERDCompositeComponent], imports: [CommonModule,
115
+ FormsModule,
116
+ LayoutModule], exports: [ERDDiagramComponent,
117
+ MJEntityERDComponent,
118
+ EntityDetailsComponent,
119
+ EntityFilterPanelComponent,
120
+ ERDCompositeComponent] }); })();
121
+ //# sourceMappingURL=entity-relationship-diagram.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-relationship-diagram.module.js","sourceRoot":"","sources":["../../src/lib/entity-relationship-diagram.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,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