@bento-core/table 1.0.0-c3dc.23 → 1.0.0-c3dc.24
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.
|
@@ -96,17 +96,11 @@ function downloadData(tableData, table, downloadFileName) {
|
|
|
96
96
|
let fileType;
|
|
97
97
|
if (format === 'json') {
|
|
98
98
|
filterColumns.forEach(column => {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
dataObject[column.dataField] = dataObject === null || dataObject === void 0 ? void 0 : (_dataObject$column$da2 = dataObject[column.dataField]) === null || _dataObject$column$da2 === void 0 ? void 0 : _dataObject$column$da2.participant_id;
|
|
105
|
-
}
|
|
106
|
-
return dataObject;
|
|
107
|
-
};
|
|
108
|
-
formatDataVal = formatDataVal.map(mapData);
|
|
109
|
-
formatDataVal = JSON.parse(JSON.stringify(formatDataVal).split("\"".concat(column.dataField, "\":")).join("\"".concat(column.header, "\":")));
|
|
99
|
+
let jsonKey = column.dataField;
|
|
100
|
+
if (column.useKey) {
|
|
101
|
+
jsonKey = column.header;
|
|
102
|
+
}
|
|
103
|
+
formatDataVal = JSON.parse(JSON.stringify(formatDataVal).split("\"".concat(jsonKey, "\":")).join("\"".concat(column.header, "\":")));
|
|
110
104
|
});
|
|
111
105
|
fileContent = JSON.stringify(formatDataVal);
|
|
112
106
|
fileType = 'application/json';
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bento-core/table",
|
|
3
|
-
"version": "1.0.0-c3dc.
|
|
3
|
+
"version": "1.0.0-c3dc.24",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"build": "
|
|
6
|
+
"build": "cross-env-shell rm -rf dist && NODE_ENV=production BABEL_ENV=es babel src --out-dir dist --copy-files",
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
8
|
"lint": "eslint src"
|
|
9
9
|
},
|
|
@@ -80,16 +80,13 @@ export function downloadData(tableData, table, downloadFileName, format = 'csv')
|
|
|
80
80
|
|
|
81
81
|
if (format === 'json') {
|
|
82
82
|
filterColumns.forEach((column) => {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return dataObject;
|
|
89
|
-
};
|
|
90
|
-
formatDataVal = formatDataVal.map(mapData);
|
|
83
|
+
let jsonKey = column.dataField;
|
|
84
|
+
|
|
85
|
+
if (column.useKey) {
|
|
86
|
+
jsonKey = column.header;
|
|
87
|
+
}
|
|
91
88
|
formatDataVal = JSON.parse(
|
|
92
|
-
JSON.stringify(formatDataVal).split(`"${
|
|
89
|
+
JSON.stringify(formatDataVal).split(`"${jsonKey}":`).join(`"${column.header}":`),
|
|
93
90
|
);
|
|
94
91
|
});
|
|
95
92
|
fileContent = JSON.stringify(formatDataVal);
|