ods-component-lib 1.16.0 → 1.16.3
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 +50 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +51 -2
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1395,6 +1395,17 @@ function grid(props) {
|
|
|
1395
1395
|
name: "exportButton"
|
|
1396
1396
|
}), React__default.createElement(dataGrid.Item, {
|
|
1397
1397
|
menuItemRender: renderMenuItem
|
|
1398
|
+
})), React__default.createElement(dataGrid.Summary, null, React__default.createElement(dataGrid.TotalItem, {
|
|
1399
|
+
column: "Id",
|
|
1400
|
+
summaryType: "count",
|
|
1401
|
+
displayFormat: "{0} Total Data"
|
|
1402
|
+
}), props.sumaryRowItems && props.sumaryRowItems.map(function (item) {
|
|
1403
|
+
return React__default.createElement(dataGrid.TotalItem, {
|
|
1404
|
+
column: item.columnName,
|
|
1405
|
+
summaryType: item.aggregateFn,
|
|
1406
|
+
valueFormat: item.valueFormat ? item.valueFormat : "",
|
|
1407
|
+
displayFormat: "Total: {0}"
|
|
1408
|
+
});
|
|
1398
1409
|
})))));
|
|
1399
1410
|
}
|
|
1400
1411
|
|
|
@@ -1411,6 +1422,32 @@ function grid$1(props) {
|
|
|
1411
1422
|
className: "dx-datagrid-headers"
|
|
1412
1423
|
}, colProperties.column.caption);
|
|
1413
1424
|
};
|
|
1425
|
+
var fileName = props.exportFileName ? props.exportFileName + moment().format("YYYYMMDD") : "DatagridExportFile" + moment().format("YYYYMMDD");
|
|
1426
|
+
var onExporting = function onExporting(e) {
|
|
1427
|
+
if (e.format === 'excel') {
|
|
1428
|
+
var workbook = new exceljs.Workbook();
|
|
1429
|
+
excel_exporter.exportDataGrid({
|
|
1430
|
+
component: e.component,
|
|
1431
|
+
worksheet: workbook.addWorksheet('Main sheet'),
|
|
1432
|
+
autoFilterEnabled: true
|
|
1433
|
+
}).then(function () {
|
|
1434
|
+
workbook.xlsx.writeBuffer().then(function (buffer) {
|
|
1435
|
+
fileSaverEs.saveAs(new Blob([buffer], {
|
|
1436
|
+
type: 'application/octet-stream'
|
|
1437
|
+
}), fileName + '.xlsx');
|
|
1438
|
+
});
|
|
1439
|
+
});
|
|
1440
|
+
} else {
|
|
1441
|
+
var doc = new jsPDF();
|
|
1442
|
+
pdf_exporter.exportDataGrid({
|
|
1443
|
+
jsPDFDocument: doc,
|
|
1444
|
+
component: e.component,
|
|
1445
|
+
indent: 5
|
|
1446
|
+
}).then(function () {
|
|
1447
|
+
doc.save(fileName + '.pdf');
|
|
1448
|
+
});
|
|
1449
|
+
}
|
|
1450
|
+
};
|
|
1414
1451
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement(dataGrid.DataGrid, {
|
|
1415
1452
|
dataSource: props.dataSource,
|
|
1416
1453
|
columnAutoWidth: props.columnAutoWidth,
|
|
@@ -1420,6 +1457,7 @@ function grid$1(props) {
|
|
|
1420
1457
|
allowColumnReordering: true,
|
|
1421
1458
|
showRowLines: true,
|
|
1422
1459
|
showBorders: true,
|
|
1460
|
+
onExporting: onExporting,
|
|
1423
1461
|
width: "100%"
|
|
1424
1462
|
}, React__default.createElement(dataGrid.Paging, {
|
|
1425
1463
|
enabled: true,
|
|
@@ -1467,7 +1505,18 @@ function grid$1(props) {
|
|
|
1467
1505
|
}, col, {
|
|
1468
1506
|
headerCellRender: headerCellRender
|
|
1469
1507
|
}), " ");
|
|
1470
|
-
})
|
|
1508
|
+
}), React__default.createElement(dataGrid.Summary, null, React__default.createElement(dataGrid.TotalItem, {
|
|
1509
|
+
column: "Id",
|
|
1510
|
+
summaryType: "count",
|
|
1511
|
+
displayFormat: "{0} Total Data"
|
|
1512
|
+
}), props.sumaryRowItems && props.sumaryRowItems.map(function (item) {
|
|
1513
|
+
return React__default.createElement(dataGrid.TotalItem, {
|
|
1514
|
+
column: item.columnName,
|
|
1515
|
+
summaryType: item.aggregateFn,
|
|
1516
|
+
valueFormat: item.valueFormat ? item.valueFormat : "",
|
|
1517
|
+
displayFormat: "Total: {0}"
|
|
1518
|
+
});
|
|
1519
|
+
}))));
|
|
1471
1520
|
}
|
|
1472
1521
|
|
|
1473
1522
|
var exportFormats$2 = ['xlsx', 'pdf'];
|