awing-library 2.1.2-dev.532 → 2.1.2-dev.533
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.
|
@@ -41,7 +41,7 @@ const exportToPNG = (element, nameFile)=>{
|
|
|
41
41
|
}).then((canvas)=>{
|
|
42
42
|
const imgData = canvas.toDataURL('image/png');
|
|
43
43
|
const link = document.createElement('a');
|
|
44
|
-
link.download = `${nameFile}.
|
|
44
|
+
link.download = `${nameFile}_${moment().format('YYYYMMDDHHmmss')}`;
|
|
45
45
|
link.href = imgData;
|
|
46
46
|
link.click();
|
|
47
47
|
});
|
|
@@ -52,7 +52,7 @@ const exportToJPG = (chartRef, nameFile)=>{
|
|
|
52
52
|
html2canvas(chartElement).then((canvas)=>{
|
|
53
53
|
const imgData = canvas.toDataURL('image/jpeg', 1.0);
|
|
54
54
|
const link = document.createElement('a');
|
|
55
|
-
link.download = `${nameFile}.
|
|
55
|
+
link.download = `${nameFile}_${moment().format('YYYYMMDDHHmmss')}`;
|
|
56
56
|
link.href = imgData;
|
|
57
57
|
link.click();
|
|
58
58
|
});
|
|
@@ -85,7 +85,7 @@ const exportToPDF = (element, nameFile)=>{
|
|
|
85
85
|
const x = (pageWidth - width) / 2;
|
|
86
86
|
const y = (pageHeight - height) / 2;
|
|
87
87
|
pdf.addImage(imgData, 'PNG', x, y, width, height);
|
|
88
|
-
pdf.save(`${nameFile}.
|
|
88
|
+
pdf.save(`${nameFile}_${moment().format('YYYYMMDDHHmmss')}`);
|
|
89
89
|
});
|
|
90
90
|
};
|
|
91
91
|
const exportToWord = async (chartRef)=>{
|
|
@@ -140,7 +140,7 @@ const exportToWord = async (chartRef)=>{
|
|
|
140
140
|
};
|
|
141
141
|
const exportToExcel = (dataExport, nameFile)=>{
|
|
142
142
|
if (dataExport && dataExport?.length > 0) {
|
|
143
|
-
let excelName = `${nameFile}_${moment().format('YYYYMMDDHHmmss')}
|
|
143
|
+
let excelName = `${nameFile}_${moment().format('YYYYMMDDHHmmss')}`;
|
|
144
144
|
downloadWithDataSet(excelName, dataExport);
|
|
145
145
|
}
|
|
146
146
|
};
|
|
@@ -9,7 +9,7 @@ var __webpack_modules__ = {
|
|
|
9
9
|
"AWING/DataInput": function(module) {
|
|
10
10
|
module.exports = __WEBPACK_EXTERNAL_MODULE__DataInput_index_js_c7933a4f__;
|
|
11
11
|
},
|
|
12
|
-
"
|
|
12
|
+
"AWING/helper": function(module) {
|
|
13
13
|
module.exports = __WEBPACK_EXTERNAL_MODULE__helper_js_663c9e82__;
|
|
14
14
|
}
|
|
15
15
|
};
|
|
@@ -92,9 +92,9 @@ jest.mock('@mui/material', ()=>({
|
|
|
92
92
|
})
|
|
93
93
|
}));
|
|
94
94
|
const mockInputFactory = __webpack_require__("AWING/DataInput")["default"];
|
|
95
|
-
const mockCalculateValue = __webpack_require__("
|
|
96
|
-
const mockConvertFormulaToBinaryTree = __webpack_require__("
|
|
97
|
-
const mockReplaceFieldsValue = __webpack_require__("
|
|
95
|
+
const mockCalculateValue = __webpack_require__("AWING/helper").calculateValue;
|
|
96
|
+
const mockConvertFormulaToBinaryTree = __webpack_require__("AWING/helper").convertFormulaToBinaryTree;
|
|
97
|
+
const mockReplaceFieldsValue = __webpack_require__("AWING/helper").replaceFieldsValue;
|
|
98
98
|
describe('DataForm Component', ()=>{
|
|
99
99
|
const mockFields = [
|
|
100
100
|
{
|