ods-component-lib 1.16.0 → 1.16.1
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/dist/index.js +27 -0
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +27 -0
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1411,6 +1411,32 @@ function grid$1(props) {
|
|
|
1411
1411
|
className: "dx-datagrid-headers"
|
|
1412
1412
|
}, colProperties.column.caption);
|
|
1413
1413
|
};
|
|
1414
|
+
var fileName = props.exportFileName ? props.exportFileName + moment().format("YYYYMMDD") : "DatagridExportFile" + moment().format("YYYYMMDD");
|
|
1415
|
+
var onExporting = function onExporting(e) {
|
|
1416
|
+
if (e.format === 'excel') {
|
|
1417
|
+
var workbook = new exceljs.Workbook();
|
|
1418
|
+
excel_exporter.exportDataGrid({
|
|
1419
|
+
component: e.component,
|
|
1420
|
+
worksheet: workbook.addWorksheet('Main sheet'),
|
|
1421
|
+
autoFilterEnabled: true
|
|
1422
|
+
}).then(function () {
|
|
1423
|
+
workbook.xlsx.writeBuffer().then(function (buffer) {
|
|
1424
|
+
fileSaverEs.saveAs(new Blob([buffer], {
|
|
1425
|
+
type: 'application/octet-stream'
|
|
1426
|
+
}), fileName + '.xlsx');
|
|
1427
|
+
});
|
|
1428
|
+
});
|
|
1429
|
+
} else {
|
|
1430
|
+
var doc = new jsPDF();
|
|
1431
|
+
pdf_exporter.exportDataGrid({
|
|
1432
|
+
jsPDFDocument: doc,
|
|
1433
|
+
component: e.component,
|
|
1434
|
+
indent: 5
|
|
1435
|
+
}).then(function () {
|
|
1436
|
+
doc.save(fileName + '.pdf');
|
|
1437
|
+
});
|
|
1438
|
+
}
|
|
1439
|
+
};
|
|
1414
1440
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement(dataGrid.DataGrid, {
|
|
1415
1441
|
dataSource: props.dataSource,
|
|
1416
1442
|
columnAutoWidth: props.columnAutoWidth,
|
|
@@ -1420,6 +1446,7 @@ function grid$1(props) {
|
|
|
1420
1446
|
allowColumnReordering: true,
|
|
1421
1447
|
showRowLines: true,
|
|
1422
1448
|
showBorders: true,
|
|
1449
|
+
onExporting: onExporting,
|
|
1423
1450
|
width: "100%"
|
|
1424
1451
|
}, React__default.createElement(dataGrid.Paging, {
|
|
1425
1452
|
enabled: true,
|