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.modern.js
CHANGED
|
@@ -1407,6 +1407,32 @@ function grid$1(props) {
|
|
|
1407
1407
|
className: "dx-datagrid-headers"
|
|
1408
1408
|
}, colProperties.column.caption);
|
|
1409
1409
|
};
|
|
1410
|
+
var fileName = props.exportFileName ? props.exportFileName + moment().format("YYYYMMDD") : "DatagridExportFile" + moment().format("YYYYMMDD");
|
|
1411
|
+
var onExporting = function onExporting(e) {
|
|
1412
|
+
if (e.format === 'excel') {
|
|
1413
|
+
var workbook = new Workbook();
|
|
1414
|
+
exportDataGrid({
|
|
1415
|
+
component: e.component,
|
|
1416
|
+
worksheet: workbook.addWorksheet('Main sheet'),
|
|
1417
|
+
autoFilterEnabled: true
|
|
1418
|
+
}).then(function () {
|
|
1419
|
+
workbook.xlsx.writeBuffer().then(function (buffer) {
|
|
1420
|
+
saveAs(new Blob([buffer], {
|
|
1421
|
+
type: 'application/octet-stream'
|
|
1422
|
+
}), fileName + '.xlsx');
|
|
1423
|
+
});
|
|
1424
|
+
});
|
|
1425
|
+
} else {
|
|
1426
|
+
var doc = new jsPDF();
|
|
1427
|
+
exportDataGrid$1({
|
|
1428
|
+
jsPDFDocument: doc,
|
|
1429
|
+
component: e.component,
|
|
1430
|
+
indent: 5
|
|
1431
|
+
}).then(function () {
|
|
1432
|
+
doc.save(fileName + '.pdf');
|
|
1433
|
+
});
|
|
1434
|
+
}
|
|
1435
|
+
};
|
|
1410
1436
|
return React.createElement(React.Fragment, null, React.createElement(DataGrid, {
|
|
1411
1437
|
dataSource: props.dataSource,
|
|
1412
1438
|
columnAutoWidth: props.columnAutoWidth,
|
|
@@ -1416,6 +1442,7 @@ function grid$1(props) {
|
|
|
1416
1442
|
allowColumnReordering: true,
|
|
1417
1443
|
showRowLines: true,
|
|
1418
1444
|
showBorders: true,
|
|
1445
|
+
onExporting: onExporting,
|
|
1419
1446
|
width: "100%"
|
|
1420
1447
|
}, React.createElement(Paging, {
|
|
1421
1448
|
enabled: true,
|