@memberjunction/ng-entity-relationship-diagram 5.43.0 → 5.44.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/dist/lib/components/entity-details/entity-details.component.js +157 -154
- package/dist/lib/components/entity-details/entity-details.component.js.map +1 -1
- package/dist/lib/components/erd-diagram.component.d.ts +4 -0
- package/dist/lib/components/erd-diagram.component.d.ts.map +1 -1
- package/dist/lib/components/erd-diagram.component.js +19 -25
- package/dist/lib/components/erd-diagram.component.js.map +1 -1
- package/dist/lib/entity-relationship-diagram.module.d.ts +1 -1
- package/dist/lib/entity-relationship-diagram.module.d.ts.map +1 -1
- package/dist/lib/entity-relationship-diagram.module.js +9 -3
- package/dist/lib/entity-relationship-diagram.module.js.map +1 -1
- package/package.json +6 -5
- package/dist/__tests__/compute-erd-layout.test.d.ts +0 -2
- package/dist/__tests__/compute-erd-layout.test.d.ts.map +0 -1
- package/dist/__tests__/compute-erd-layout.test.js +0 -207
- package/dist/__tests__/compute-erd-layout.test.js.map +0 -1
- package/dist/__tests__/entity-to-erd-adapter.test.d.ts +0 -2
- package/dist/__tests__/entity-to-erd-adapter.test.d.ts.map +0 -1
- package/dist/__tests__/entity-to-erd-adapter.test.js +0 -252
- package/dist/__tests__/entity-to-erd-adapter.test.js.map +0 -1
- package/dist/__tests__/erd-types.test.d.ts +0 -2
- package/dist/__tests__/erd-types.test.d.ts.map +0 -1
- package/dist/__tests__/erd-types.test.js +0 -104
- package/dist/__tests__/erd-types.test.js.map +0 -1
- package/dist/__tests__/index.test.d.ts +0 -2
- package/dist/__tests__/index.test.d.ts.map +0 -1
- package/dist/__tests__/index.test.js +0 -7
- package/dist/__tests__/index.test.js.map +0 -1
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
describe('ERD Types', () => {
|
|
3
|
-
describe('ERDField', () => {
|
|
4
|
-
it('should construct basic field', () => {
|
|
5
|
-
const field = {
|
|
6
|
-
id: 'f1',
|
|
7
|
-
name: 'ID',
|
|
8
|
-
type: 'uniqueidentifier',
|
|
9
|
-
isPrimaryKey: true
|
|
10
|
-
};
|
|
11
|
-
expect(field.isPrimaryKey).toBe(true);
|
|
12
|
-
});
|
|
13
|
-
it('should construct FK field', () => {
|
|
14
|
-
const field = {
|
|
15
|
-
id: 'f2',
|
|
16
|
-
name: 'ParentID',
|
|
17
|
-
isPrimaryKey: false,
|
|
18
|
-
relatedNodeId: 'e1',
|
|
19
|
-
relatedNodeName: 'Parent',
|
|
20
|
-
relatedFieldName: 'ID'
|
|
21
|
-
};
|
|
22
|
-
expect(field.relatedNodeId).toBe('e1');
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
describe('ERDNode', () => {
|
|
26
|
-
it('should construct with fields', () => {
|
|
27
|
-
const node = {
|
|
28
|
-
id: 'e1',
|
|
29
|
-
name: 'Users',
|
|
30
|
-
schemaName: 'dbo',
|
|
31
|
-
fields: [
|
|
32
|
-
{ id: 'f1', name: 'ID', isPrimaryKey: true },
|
|
33
|
-
{ id: 'f2', name: 'Name', isPrimaryKey: false }
|
|
34
|
-
]
|
|
35
|
-
};
|
|
36
|
-
expect(node.fields).toHaveLength(2);
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
describe('ERDLink', () => {
|
|
40
|
-
it('should represent a many-to-one relationship', () => {
|
|
41
|
-
const link = {
|
|
42
|
-
sourceNodeId: 'child',
|
|
43
|
-
targetNodeId: 'parent',
|
|
44
|
-
sourceField: { id: 'fk', name: 'ParentID', isPrimaryKey: false },
|
|
45
|
-
isSelfReference: false,
|
|
46
|
-
relationshipType: 'many-to-one'
|
|
47
|
-
};
|
|
48
|
-
expect(link.relationshipType).toBe('many-to-one');
|
|
49
|
-
expect(link.isSelfReference).toBe(false);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
describe('ERDConfig', () => {
|
|
53
|
-
it('should accept partial configuration', () => {
|
|
54
|
-
const config = {
|
|
55
|
-
nodeWidth: 200,
|
|
56
|
-
showFieldDetails: true,
|
|
57
|
-
enableDragging: true,
|
|
58
|
-
layoutAlgorithm: 'dagre'
|
|
59
|
-
};
|
|
60
|
-
expect(config.layoutAlgorithm).toBe('dagre');
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
describe('ERDFilter', () => {
|
|
64
|
-
it('should support schema filter', () => {
|
|
65
|
-
const filter = { schemaName: 'dbo' };
|
|
66
|
-
expect(filter.schemaName).toBe('dbo');
|
|
67
|
-
});
|
|
68
|
-
it('should support custom filter function', () => {
|
|
69
|
-
const filter = {
|
|
70
|
-
customFilter: (node) => node.name.startsWith('User')
|
|
71
|
-
};
|
|
72
|
-
const testNode = { id: '1', name: 'UserRoles', fields: [] };
|
|
73
|
-
expect(filter.customFilter(testNode)).toBe(true);
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
describe('ERDState', () => {
|
|
77
|
-
it('should serialize and deserialize', () => {
|
|
78
|
-
const state = {
|
|
79
|
-
selectedNodeId: 'e1',
|
|
80
|
-
highlightedNodeIds: ['e2', 'e3'],
|
|
81
|
-
zoomLevel: 1.5,
|
|
82
|
-
translateX: 100,
|
|
83
|
-
translateY: 200,
|
|
84
|
-
focusNodeId: null,
|
|
85
|
-
focusDepth: 1,
|
|
86
|
-
nodePositions: {
|
|
87
|
-
'e1': { x: 10, y: 20 },
|
|
88
|
-
'e2': { x: 30, y: 40, fx: 30, fy: 40 }
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
const json = JSON.stringify(state);
|
|
92
|
-
const parsed = JSON.parse(json);
|
|
93
|
-
expect(parsed.selectedNodeId).toBe('e1');
|
|
94
|
-
expect(parsed.nodePositions['e2'].fx).toBe(30);
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
describe('ERDLayoutAlgorithm', () => {
|
|
98
|
-
it('should support all layout types', () => {
|
|
99
|
-
const layouts = ['force', 'dagre', 'horizontal', 'vertical', 'radial'];
|
|
100
|
-
expect(layouts).toHaveLength(5);
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
//# sourceMappingURL=erd-types.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"erd-types.test.js","sourceRoot":"","sources":["../../src/__tests__/erd-types.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAY9C,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;QACxB,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;YACtC,MAAM,KAAK,GAAa;gBACtB,EAAE,EAAE,IAAI;gBACR,IAAI,EAAE,IAAI;gBACV,IAAI,EAAE,kBAAkB;gBACxB,YAAY,EAAE,IAAI;aACnB,CAAC;YACF,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;YACnC,MAAM,KAAK,GAAa;gBACtB,EAAE,EAAE,IAAI;gBACR,IAAI,EAAE,UAAU;gBAChB,YAAY,EAAE,KAAK;gBACnB,aAAa,EAAE,IAAI;gBACnB,eAAe,EAAE,QAAQ;gBACzB,gBAAgB,EAAE,IAAI;aACvB,CAAC;YACF,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;QACvB,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;YACtC,MAAM,IAAI,GAAY;gBACpB,EAAE,EAAE,IAAI;gBACR,IAAI,EAAE,OAAO;gBACb,UAAU,EAAE,KAAK;gBACjB,MAAM,EAAE;o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AC,KAAK,CAAC,CAAC;YACnC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAa,CAAC;YAC5C,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACzC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAClC,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;YACzC,MAAM,OAAO,GAAyB,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;YAC7F,MAAM,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, it, expect } from 'vitest';\nimport type {\n ERDField,\n ERDNode,\n ERDLink,\n ERDConfig,\n ERDFilter,\n ERDState,\n ERDLayoutAlgorithm,\n ERDDagreConfig\n} from '../lib/interfaces/erd-types';\n\ndescribe('ERD Types', () => {\n describe('ERDField', () => {\n it('should construct basic field', () => {\n const field: ERDField = {\n id: 'f1',\n name: 'ID',\n type: 'uniqueidentifier',\n isPrimaryKey: true\n };\n expect(field.isPrimaryKey).toBe(true);\n });\n\n it('should construct FK field', () => {\n const field: ERDField = {\n id: 'f2',\n name: 'ParentID',\n isPrimaryKey: false,\n relatedNodeId: 'e1',\n relatedNodeName: 'Parent',\n relatedFieldName: 'ID'\n };\n expect(field.relatedNodeId).toBe('e1');\n });\n });\n\n describe('ERDNode', () => {\n it('should construct with fields', () => {\n const node: ERDNode = {\n id: 'e1',\n name: 'Users',\n schemaName: 'dbo',\n fields: [\n { id: 'f1', name: 'ID', isPrimaryKey: true },\n { id: 'f2', name: 'Name', isPrimaryKey: false }\n ]\n };\n expect(node.fields).toHaveLength(2);\n });\n });\n\n describe('ERDLink', () => {\n it('should represent a many-to-one relationship', () => {\n const link: ERDLink = {\n sourceNodeId: 'child',\n targetNodeId: 'parent',\n sourceField: { id: 'fk', name: 'ParentID', isPrimaryKey: false },\n isSelfReference: false,\n relationshipType: 'many-to-one'\n };\n expect(link.relationshipType).toBe('many-to-one');\n expect(link.isSelfReference).toBe(false);\n });\n });\n\n describe('ERDConfig', () => {\n it('should accept partial configuration', () => {\n const config: ERDConfig = {\n nodeWidth: 200,\n showFieldDetails: true,\n enableDragging: true,\n layoutAlgorithm: 'dagre'\n };\n expect(config.layoutAlgorithm).toBe('dagre');\n });\n });\n\n describe('ERDFilter', () => {\n it('should support schema filter', () => {\n const filter: ERDFilter = { schemaName: 'dbo' };\n expect(filter.schemaName).toBe('dbo');\n });\n\n it('should support custom filter function', () => {\n const filter: ERDFilter = {\n customFilter: (node) => node.name.startsWith('User')\n };\n const testNode: ERDNode = { id: '1', name: 'UserRoles', fields: [] };\n expect(filter.customFilter!(testNode)).toBe(true);\n });\n });\n\n describe('ERDState', () => {\n it('should serialize and deserialize', () => {\n const state: ERDState = {\n selectedNodeId: 'e1',\n highlightedNodeIds: ['e2', 'e3'],\n zoomLevel: 1.5,\n translateX: 100,\n translateY: 200,\n focusNodeId: null,\n focusDepth: 1,\n nodePositions: {\n 'e1': { x: 10, y: 20 },\n 'e2': { x: 30, y: 40, fx: 30, fy: 40 }\n }\n };\n const json = JSON.stringify(state);\n const parsed = JSON.parse(json) as ERDState;\n expect(parsed.selectedNodeId).toBe('e1');\n expect(parsed.nodePositions['e2'].fx).toBe(30);\n });\n });\n\n describe('ERDLayoutAlgorithm', () => {\n it('should support all layout types', () => {\n const layouts: ERDLayoutAlgorithm[] = ['force', 'dagre', 'horizontal', 'vertical', 'radial'];\n expect(layouts).toHaveLength(5);\n });\n });\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../src/__tests__/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,QAAQ,CAAC,gDAAgD,EAAE,GAAG,EAAE;IAC9D,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;QACpC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, it, expect } from 'vitest';\n\ndescribe('@memberjunction/ng-entity-relationship-diagram', () => {\n it('should have a passing test', () => {\n expect(true).toBe(true);\n });\n});\n"]}
|