@things-factory/export-ui-excel 4.3.122 → 4.3.131
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/client/bootstrap.js +9 -7
- package/package.json +5 -6
- package/LICENSE.md +0 -21
package/client/bootstrap.js
CHANGED
|
@@ -62,7 +62,8 @@ async function objDataToExcel({ extension, name, data }) {
|
|
|
62
62
|
return {
|
|
63
63
|
header: column.header || '',
|
|
64
64
|
key: column.key || '',
|
|
65
|
-
width: column.width ? column.width : column.header.length < 12 ? 12 : column.header.length
|
|
65
|
+
width: column.width ? column.width : column.header.length < 12 ? 12 : column.header.length,
|
|
66
|
+
rowCount: column.rowCount || false
|
|
66
67
|
}
|
|
67
68
|
})
|
|
68
69
|
]
|
|
@@ -109,7 +110,8 @@ async function objDataToExcel({ extension, name, data }) {
|
|
|
109
110
|
printData,
|
|
110
111
|
records.groups.map(itm => itm.column),
|
|
111
112
|
records.groups,
|
|
112
|
-
records.totals
|
|
113
|
+
records.totals,
|
|
114
|
+
header
|
|
113
115
|
)
|
|
114
116
|
} else {
|
|
115
117
|
printData = printData.map(row => {
|
|
@@ -262,7 +264,7 @@ export default function bootstrap() {
|
|
|
262
264
|
})
|
|
263
265
|
}
|
|
264
266
|
|
|
265
|
-
function multiGroupTree(array, groups, groupsRaw, totals) {
|
|
267
|
+
function multiGroupTree(array, groups, groupsRaw, totals, header) {
|
|
266
268
|
if (!groups) {
|
|
267
269
|
return array
|
|
268
270
|
}
|
|
@@ -301,7 +303,7 @@ function multiGroupTree(array, groups, groupsRaw, totals) {
|
|
|
301
303
|
|
|
302
304
|
totals.forEach(total => {
|
|
303
305
|
sumData.data[total] = grouping[itm].reduce((acc, obj) => {
|
|
304
|
-
acc = acc + (parseFloat(obj
|
|
306
|
+
acc = acc + ((header.find(x => x.key == total)?.rowCount ? 1 : parseFloat(obj?.data[total])) || 0)
|
|
305
307
|
return acc
|
|
306
308
|
}, 0)
|
|
307
309
|
})
|
|
@@ -319,7 +321,7 @@ function multiGroupTree(array, groups, groupsRaw, totals) {
|
|
|
319
321
|
let result = transform(
|
|
320
322
|
grouping,
|
|
321
323
|
(result, value, key) => {
|
|
322
|
-
let rows = multiGroupTree(value, restGroups, groupsRaw, totals)
|
|
324
|
+
let rows = multiGroupTree(value, restGroups, groupsRaw, totals, header)
|
|
323
325
|
|
|
324
326
|
let currentGroupSetting = groupsRaw.filter(x => x.column === currentGroup)[0]
|
|
325
327
|
|
|
@@ -335,7 +337,7 @@ function multiGroupTree(array, groups, groupsRaw, totals) {
|
|
|
335
337
|
|
|
336
338
|
totals.forEach(total => {
|
|
337
339
|
sumData.data[total] = value.reduce((acc, obj) => {
|
|
338
|
-
acc = acc +
|
|
340
|
+
acc = acc + parseFloat(obj[total]) || 0
|
|
339
341
|
return acc
|
|
340
342
|
}, 0)
|
|
341
343
|
})
|
|
@@ -407,7 +409,7 @@ function stripObject(source) {
|
|
|
407
409
|
? null
|
|
408
410
|
: t == 'object'
|
|
409
411
|
? stripObject(source[key])
|
|
410
|
-
: { string: '', number:
|
|
412
|
+
: { string: '', number: '', boolean: '' }[t]
|
|
411
413
|
}
|
|
412
414
|
}
|
|
413
415
|
return o
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/export-ui-excel",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.131",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
7
|
-
"license": "MIT",
|
|
8
7
|
"author": "",
|
|
9
8
|
"description": "User interface module for showing xls, xlsx as export option.",
|
|
10
9
|
"publishConfig": {
|
|
@@ -24,12 +23,12 @@
|
|
|
24
23
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
25
24
|
},
|
|
26
25
|
"dependencies": {
|
|
27
|
-
"@things-factory/export-base": "^4.3.
|
|
28
|
-
"@things-factory/export-ui": "^4.3.
|
|
29
|
-
"@things-factory/layout-base": "^4.3.
|
|
26
|
+
"@things-factory/export-base": "^4.3.131",
|
|
27
|
+
"@things-factory/export-ui": "^4.3.131",
|
|
28
|
+
"@things-factory/layout-base": "^4.3.131",
|
|
30
29
|
"exceljs": "4.2.0",
|
|
31
30
|
"file-saver": "^2.0.2",
|
|
32
31
|
"xlsx": "^0.16.8"
|
|
33
32
|
},
|
|
34
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "3ae054257c32ac18b023913a313f784459581ea3"
|
|
35
34
|
}
|
package/LICENSE.md
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Hatiolab
|
|
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
|
-
SOFTWARE.
|