ods-component-lib 1.15.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.css +5 -5
- package/dist/index.js +34 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +34 -1
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1195,7 +1195,13 @@ var customizeBooleanColumnRender = function customizeBooleanColumnRender(e) {
|
|
|
1195
1195
|
}
|
|
1196
1196
|
if (e.column.dataType === 'datetime') {
|
|
1197
1197
|
if (e.value !== null) {
|
|
1198
|
-
var
|
|
1198
|
+
var date = moment(e.value);
|
|
1199
|
+
var offsetMinutes = date.utcOffset();
|
|
1200
|
+
var sign = offsetMinutes >= 0 ? '+' : '-';
|
|
1201
|
+
var hours = Math.floor(Math.abs(offsetMinutes) / 60);
|
|
1202
|
+
var minutes = Math.abs(offsetMinutes) % 60;
|
|
1203
|
+
var formattedOffset = "(UTC" + sign + hours.toString().padStart(2, '0') + ":" + minutes.toString().padStart(2, '0') + ")";
|
|
1204
|
+
var formatedDate = date.format('DD.MM.YYYY HH.mm') + " " + formattedOffset;
|
|
1199
1205
|
return formatedDate;
|
|
1200
1206
|
}
|
|
1201
1207
|
}
|
|
@@ -1401,6 +1407,32 @@ function grid$1(props) {
|
|
|
1401
1407
|
className: "dx-datagrid-headers"
|
|
1402
1408
|
}, colProperties.column.caption);
|
|
1403
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
|
+
};
|
|
1404
1436
|
return React.createElement(React.Fragment, null, React.createElement(DataGrid, {
|
|
1405
1437
|
dataSource: props.dataSource,
|
|
1406
1438
|
columnAutoWidth: props.columnAutoWidth,
|
|
@@ -1410,6 +1442,7 @@ function grid$1(props) {
|
|
|
1410
1442
|
allowColumnReordering: true,
|
|
1411
1443
|
showRowLines: true,
|
|
1412
1444
|
showBorders: true,
|
|
1445
|
+
onExporting: onExporting,
|
|
1413
1446
|
width: "100%"
|
|
1414
1447
|
}, React.createElement(Paging, {
|
|
1415
1448
|
enabled: true,
|