@cauca-911/datagrid 22.2.6-beta1 → 22.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 CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2018 CAUCA 9-1-1 inc
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2018 CAUCA 9-1-1 inc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,27 +1,57 @@
1
- # @cauca-911/datagrid
2
-
3
- Run `npm install @cauca-911/datagrid --save` to add this library to your project
4
-
5
- ## To use this library, you need to import the module with specific configuration
6
-
7
- ## Grid export (optional)
8
-
9
- `[allowExport]="true"` adds an Excel / PDF button to a grid's header. The
10
- libraries that write those files are declared as **optional** peer dependencies,
11
- so they are not installed with this package. Install them in the consuming
12
- application before enabling export:
13
-
14
- ```bash
15
- npm install exceljs jspdf jspdf-autotable --save
16
- ```
17
-
18
- Both formats are offered by default. Narrow them with `exportFormats`, and the
19
- button disappears entirely if the list is empty:
20
-
21
- ```html
22
- <cauca-data-grid [allowExport]="true" [exportFormats]="['excel']" />
23
- ```
24
-
25
- They are loaded with a dynamic `import()`, so an application that never enables
26
- export pays nothing for them in its bundle. Skipping the install is only a
27
- problem the moment a user clicks the button.
1
+ # @cauca-911/datagrid
2
+
3
+ Run `npm install @cauca-911/datagrid --save` to add this library to your project
4
+
5
+ ## To use this library, you need to import the module with specific configuration
6
+
7
+ ## Grid export (optional)
8
+
9
+ `[allowExport]="true"` adds an Excel / PDF button to a grid's header. The
10
+ libraries that write those files are declared as **optional** peer dependencies,
11
+ so they are not installed with this package. Install them in the consuming
12
+ application before enabling export:
13
+
14
+ ```bash
15
+ npm install exceljs jspdf jspdf-autotable --save
16
+ ```
17
+
18
+ Both formats are offered by default. Narrow them with `exportFormats`, and the
19
+ button disappears entirely if the list is empty:
20
+
21
+ ```html
22
+ <cauca-data-grid [allowExport]="true" [exportFormats]="['excel']" />
23
+ ```
24
+
25
+ ### Title row
26
+
27
+ `exportTitle` becomes the first row of the spreadsheet (merged across the
28
+ columns) and is drawn above the table in the PDF. Pass it already translated,
29
+ the same way column labels are passed:
30
+
31
+ ```html
32
+ <cauca-data-grid [allowExport]="true"
33
+ [exportTitle]="'userList.exportTitle' | translate" />
34
+ ```
35
+
36
+ Exported column headers need nothing extra: they reuse each column's `label`,
37
+ so binding `[label]="'key' | translate"` is already enough. Dates follow
38
+ `LOCALE_ID`, and boolean cells are written as text from the library's own
39
+ `dataGrid.export.true` / `dataGrid.export.false` keys (`Vrai` / `Faux` in
40
+ French).
41
+
42
+ ### Custom menu items
43
+
44
+ Project your own entries into the export menu with the `exportItem` attribute.
45
+ They render below the built-in ones, and setting `[exportFormats]="[]"` gives a
46
+ menu of only your items:
47
+
48
+ ```html
49
+ <cauca-data-grid [allowExport]="true">
50
+ <cauca-menu-item exportItem icon="send" label="user.sendToPartner"
51
+ [translateLabel]="true" (buttonClick)="send()" />
52
+ </cauca-data-grid>
53
+ ```
54
+
55
+ They are loaded with a dynamic `import()`, so an application that never enables
56
+ export pays nothing for them in its bundle. Skipping the install is only a
57
+ problem the moment a user clicks the button.
@@ -19,7 +19,9 @@
19
19
  "export": {
20
20
  "title": "Export",
21
21
  "excel": "Export to Excel",
22
- "pdf": "Export to PDF"
22
+ "pdf": "Export to PDF",
23
+ "true": "True",
24
+ "false": "False"
23
25
  }
24
26
  }
25
27
  }
@@ -19,7 +19,9 @@
19
19
  "export": {
20
20
  "title": "Exporter",
21
21
  "excel": "Exporter vers Excel",
22
- "pdf": "Exporter vers PDF"
22
+ "pdf": "Exporter vers PDF",
23
+ "true": "Vrai",
24
+ "false": "Faux"
23
25
  }
24
26
  }
25
27
  }