@memberjunction/ng-export-service 4.2.0 → 4.3.1

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.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=export-types.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-types.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/export-types.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,86 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ describe('ExportDialogConfig', () => {
3
+ it('should construct with minimal required fields', () => {
4
+ const config = {
5
+ totalRows: 100
6
+ };
7
+ expect(config.totalRows).toBe(100);
8
+ expect(config.title).toBeUndefined();
9
+ expect(config.columns).toBeUndefined();
10
+ });
11
+ it('should accept all optional fields', () => {
12
+ const config = {
13
+ title: 'Export Users',
14
+ totalRows: 500,
15
+ columns: [
16
+ { name: 'Name', displayName: 'Full Name', dataType: 'string', selected: true },
17
+ { name: 'Age', displayName: 'Age', dataType: 'number', selected: false }
18
+ ],
19
+ showAdvancedOptions: true,
20
+ fileName: 'users-export'
21
+ };
22
+ expect(config.columns).toHaveLength(2);
23
+ expect(config.showAdvancedOptions).toBe(true);
24
+ });
25
+ });
26
+ describe('ExportColumnInfo', () => {
27
+ it('should represent a string column', () => {
28
+ const col = {
29
+ name: 'Email',
30
+ displayName: 'Email Address',
31
+ dataType: 'string',
32
+ selected: true
33
+ };
34
+ expect(col.dataType).toBe('string');
35
+ expect(col.selected).toBe(true);
36
+ });
37
+ it('should support all data types', () => {
38
+ const types = ['string', 'number', 'date', 'boolean', 'currency'];
39
+ expect(types).toHaveLength(5);
40
+ });
41
+ });
42
+ describe('ExportDialogResult', () => {
43
+ it('should represent a cancelled dialog', () => {
44
+ const result = { confirmed: false };
45
+ expect(result.confirmed).toBe(false);
46
+ expect(result.format).toBeUndefined();
47
+ });
48
+ it('should represent a confirmed export', () => {
49
+ const result = {
50
+ confirmed: true,
51
+ format: 'excel',
52
+ includeHeaders: true,
53
+ fileName: 'export-data',
54
+ sampling: { mode: 'all' },
55
+ selectedColumns: ['Name', 'Email']
56
+ };
57
+ expect(result.format).toBe('excel');
58
+ expect(result.selectedColumns).toHaveLength(2);
59
+ });
60
+ it('should support all sampling modes', () => {
61
+ const modes = [
62
+ 'all', 'top', 'bottom', 'every-nth', 'random'
63
+ ];
64
+ expect(modes).toHaveLength(5);
65
+ });
66
+ });
67
+ describe('ExportServiceOptions', () => {
68
+ it('should construct with required fields', () => {
69
+ const options = {
70
+ data: [{ Name: 'Test', Value: 42 }],
71
+ format: 'csv'
72
+ };
73
+ expect(options.data).toHaveLength(1);
74
+ expect(options.format).toBe('csv');
75
+ });
76
+ it('should support JSON format', () => {
77
+ const options = {
78
+ data: [],
79
+ format: 'json',
80
+ fileName: 'data',
81
+ includeHeaders: true
82
+ };
83
+ expect(options.format).toBe('json');
84
+ });
85
+ });
86
+ //# sourceMappingURL=export-types.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-types.test.js","sourceRoot":"","sources":["../../src/__tests__/export-types.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQ9C,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,MAAM,GAAuB;YACjC,SAAS,EAAE,GAAG;SACf,CAAC;QACF,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,aAAa,EAAE,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,MAAM,GAAu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,CAAC;YACnC,MAAM,EAAE,KAAK;SACd,CAAC;QACF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACrC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;QACpC,MAAM,OAAO,GAAyB;YACpC,IAAI,EAAE,EAAE;YACR,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,MAAM;YAChB,cAAc,EAAE,IAAI;SACrB,CAAC;QACF,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/index.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ describe('@memberjunction/ng-export-service', () => {
3
+ it('should have a passing test', () => {
4
+ expect(true).toBe(true);
5
+ });
6
+ });
7
+ //# sourceMappingURL=index.test.js.map
@@ -0,0 +1 @@
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,mCAAmC,EAAE,GAAG,EAAE;IACjD,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-export-service",
3
- "version": "4.2.0",
3
+ "version": "4.3.1",
4
4
  "description": "MemberJunction: Angular export service and dialog for exporting data to Excel, CSV, and JSON",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -8,8 +8,9 @@
8
8
  "/dist"
9
9
  ],
10
10
  "scripts": {
11
- "test": "echo \"Error: no test specified\" && exit 1",
12
- "build": "ngc"
11
+ "test": "echo \"No tests configured yet\"",
12
+ "build": "ngc",
13
+ "test:watch": "vitest"
13
14
  },
14
15
  "keywords": [
15
16
  "MemberJunction",
@@ -23,7 +24,8 @@
23
24
  "license": "ISC",
24
25
  "devDependencies": {
25
26
  "@angular/compiler": "21.1.3",
26
- "@angular/compiler-cli": "21.1.3"
27
+ "@angular/compiler-cli": "21.1.3",
28
+ "vitest": "^4.0.18"
27
29
  },
28
30
  "peerDependencies": {
29
31
  "@angular/common": "21.1.3",
@@ -32,7 +34,7 @@
32
34
  "@angular/cdk": "21.1.3"
33
35
  },
34
36
  "dependencies": {
35
- "@memberjunction/export-engine": "4.2.0",
37
+ "@memberjunction/export-engine": "4.3.1",
36
38
  "tslib": "^2.8.1"
37
39
  },
38
40
  "sideEffects": false,