@slickgrid-universal/text-export 1.2.3 → 1.2.6
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/LICENSE +20 -20
- package/README.md +75 -75
- package/package.json +6 -6
package/LICENSE
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
Copyright (c) 2020-2022, Ghislain B. - Slickgrid-Universal
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
-
a copy of this software and associated documentation files (the
|
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
-
the following conditions:
|
|
10
|
-
|
|
11
|
-
The above copyright notice and this permission notice shall be
|
|
12
|
-
included in all copies or substantial portions of the Software.
|
|
13
|
-
|
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
Copyright (c) 2020-2022, Ghislain B. - Slickgrid-Universal
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
[](https://opensource.org/licenses/MIT)
|
|
2
|
-
[](http://www.typescriptlang.org/)
|
|
3
|
-
[](https://github.com/ghiscoding/lerna-lite)
|
|
4
|
-
[](https://www.npmjs.com/package/@slickgrid-universal/text-export)
|
|
5
|
-
[](https://www.npmjs.com/package/@slickgrid-universal/text-export)
|
|
6
|
-
|
|
7
|
-
[](https://github.com/ghiscoding/slickgrid-universal/actions)
|
|
8
|
-
[](https://www.cypress.io/)
|
|
9
|
-
[](https://github.com/facebook/jest)
|
|
10
|
-
[](https://codecov.io/gh/ghiscoding/slickgrid-universal)
|
|
11
|
-
|
|
12
|
-
## Text Export Service (text file)
|
|
13
|
-
#### @slickgrid-universal/text-export
|
|
14
|
-
|
|
15
|
-
Simple Export to File Service that allows to export as CSV or Text (`.csv` or `.txt`), user can also choose which data separator to use for the export (comma, colon, semicolon, ...).
|
|
16
|
-
|
|
17
|
-
There are a couple of reasons to use this package (it could be used instead of the `excel-export`)
|
|
18
|
-
- if you want to export to a text file with any type of separator (tab, colon, semicolon, comma)
|
|
19
|
-
- if you have a very large dataset, this export consumes a lot less memory in comparison to the `excel-export`
|
|
20
|
-
|
|
21
|
-
### Internal Dependencies
|
|
22
|
-
- [@slickgrid-universal/common](https://github.com/ghiscoding/slickgrid-universal/tree/master/packages/common)
|
|
23
|
-
|
|
24
|
-
### External Dependencies
|
|
25
|
-
This package requires [text-encoding-utf-8](https://www.npmjs.com/package/text-encoding-utf-8) which is use to ensure proper UTF-8 encoding, even emoji will be exported without issues.
|
|
26
|
-
|
|
27
|
-
### Installation
|
|
28
|
-
Follow the instruction provided in the main [README](https://github.com/ghiscoding/slickgrid-universal#installation), you can see a demo by looking at the [GitHub Demo](https://ghiscoding.github.io/slickgrid-universal) page and click on "Export to CSV" from the Grid Menu (aka hamburger menu).
|
|
29
|
-
|
|
30
|
-
### Usage
|
|
31
|
-
In order to use the Service, you will need to register it in your grid options via the `registerExternalResources` as shown below.
|
|
32
|
-
|
|
33
|
-
##### ViewModel
|
|
34
|
-
```ts
|
|
35
|
-
import { TextExportService } from '@slickgrid-universal/text-export';
|
|
36
|
-
|
|
37
|
-
export class MyExample {
|
|
38
|
-
initializeGrid {
|
|
39
|
-
this.gridOptions = {
|
|
40
|
-
enableTextExport: true,
|
|
41
|
-
exportOptions: {
|
|
42
|
-
sanitizeDataExport: true
|
|
43
|
-
},
|
|
44
|
-
registerExternalResources: [new TextExportService()],
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
If you wish to reference the service to use it with external export button, then simply create a reference while instantiating it.
|
|
51
|
-
```ts
|
|
52
|
-
import { TextExportService } from '@slickgrid-universal/text-export';
|
|
53
|
-
|
|
54
|
-
export class MyExample {
|
|
55
|
-
exportService: TextExportService;
|
|
56
|
-
|
|
57
|
-
constructor() {
|
|
58
|
-
this.exportService = new TextExportService();
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
initializeGrid {
|
|
62
|
-
this.gridOptions = {
|
|
63
|
-
enableTextExport: true,
|
|
64
|
-
exportOptions: {
|
|
65
|
-
sanitizeDataExport: true
|
|
66
|
-
},
|
|
67
|
-
registerExternalResources: [this.exportService],
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
exportToFile() {
|
|
72
|
-
this.exportService.exportToFile({ filename: 'export', format: FileType.csv });
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
```
|
|
1
|
+
[](https://opensource.org/licenses/MIT)
|
|
2
|
+
[](http://www.typescriptlang.org/)
|
|
3
|
+
[](https://github.com/ghiscoding/lerna-lite)
|
|
4
|
+
[](https://www.npmjs.com/package/@slickgrid-universal/text-export)
|
|
5
|
+
[](https://www.npmjs.com/package/@slickgrid-universal/text-export)
|
|
6
|
+
|
|
7
|
+
[](https://github.com/ghiscoding/slickgrid-universal/actions)
|
|
8
|
+
[](https://www.cypress.io/)
|
|
9
|
+
[](https://github.com/facebook/jest)
|
|
10
|
+
[](https://codecov.io/gh/ghiscoding/slickgrid-universal)
|
|
11
|
+
|
|
12
|
+
## Text Export Service (text file)
|
|
13
|
+
#### @slickgrid-universal/text-export
|
|
14
|
+
|
|
15
|
+
Simple Export to File Service that allows to export as CSV or Text (`.csv` or `.txt`), user can also choose which data separator to use for the export (comma, colon, semicolon, ...).
|
|
16
|
+
|
|
17
|
+
There are a couple of reasons to use this package (it could be used instead of the `excel-export`)
|
|
18
|
+
- if you want to export to a text file with any type of separator (tab, colon, semicolon, comma)
|
|
19
|
+
- if you have a very large dataset, this export consumes a lot less memory in comparison to the `excel-export`
|
|
20
|
+
|
|
21
|
+
### Internal Dependencies
|
|
22
|
+
- [@slickgrid-universal/common](https://github.com/ghiscoding/slickgrid-universal/tree/master/packages/common)
|
|
23
|
+
|
|
24
|
+
### External Dependencies
|
|
25
|
+
This package requires [text-encoding-utf-8](https://www.npmjs.com/package/text-encoding-utf-8) which is use to ensure proper UTF-8 encoding, even emoji will be exported without issues.
|
|
26
|
+
|
|
27
|
+
### Installation
|
|
28
|
+
Follow the instruction provided in the main [README](https://github.com/ghiscoding/slickgrid-universal#installation), you can see a demo by looking at the [GitHub Demo](https://ghiscoding.github.io/slickgrid-universal) page and click on "Export to CSV" from the Grid Menu (aka hamburger menu).
|
|
29
|
+
|
|
30
|
+
### Usage
|
|
31
|
+
In order to use the Service, you will need to register it in your grid options via the `registerExternalResources` as shown below.
|
|
32
|
+
|
|
33
|
+
##### ViewModel
|
|
34
|
+
```ts
|
|
35
|
+
import { TextExportService } from '@slickgrid-universal/text-export';
|
|
36
|
+
|
|
37
|
+
export class MyExample {
|
|
38
|
+
initializeGrid {
|
|
39
|
+
this.gridOptions = {
|
|
40
|
+
enableTextExport: true,
|
|
41
|
+
exportOptions: {
|
|
42
|
+
sanitizeDataExport: true
|
|
43
|
+
},
|
|
44
|
+
registerExternalResources: [new TextExportService()],
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
If you wish to reference the service to use it with external export button, then simply create a reference while instantiating it.
|
|
51
|
+
```ts
|
|
52
|
+
import { TextExportService } from '@slickgrid-universal/text-export';
|
|
53
|
+
|
|
54
|
+
export class MyExample {
|
|
55
|
+
exportService: TextExportService;
|
|
56
|
+
|
|
57
|
+
constructor() {
|
|
58
|
+
this.exportService = new TextExportService();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
initializeGrid {
|
|
62
|
+
this.gridOptions = {
|
|
63
|
+
enableTextExport: true,
|
|
64
|
+
exportOptions: {
|
|
65
|
+
sanitizeDataExport: true
|
|
66
|
+
},
|
|
67
|
+
registerExternalResources: [this.exportService],
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
exportToFile() {
|
|
72
|
+
this.exportService.exportToFile({ filename: 'export', format: FileType.csv });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slickgrid-universal/text-export",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"description": "Export to Text File (csv/txt) Service.",
|
|
5
5
|
"main": "dist/commonjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"url": "https://github.com/ghiscoding/slickgrid-universal/issues"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
|
-
"node": ">=
|
|
42
|
-
"npm": ">=
|
|
41
|
+
"node": ">=14.17.0",
|
|
42
|
+
"npm": ">=6.14.8"
|
|
43
43
|
},
|
|
44
44
|
"browserslist": [
|
|
45
45
|
"last 2 version",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"not dead"
|
|
48
48
|
],
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@slickgrid-universal/common": "^1.2.
|
|
50
|
+
"@slickgrid-universal/common": "^1.2.6",
|
|
51
51
|
"text-encoding-utf-8": "^1.0.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"funding": {
|
|
60
60
|
"type": "ko_fi",
|
|
61
|
-
"url": "https://ko-fi.com/
|
|
61
|
+
"url": "https://ko-fi.com/ghiscoding"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "3a2e6ff120b3cd310e8c046d84d229fba4e9e4b6"
|
|
64
64
|
}
|