cilog-lib 1.13.20 → 1.13.22
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/fesm2022/cilog-lib.mjs +15 -16
- package/fesm2022/cilog-lib.mjs.map +1 -1
- package/package.json +1 -1
package/fesm2022/cilog-lib.mjs
CHANGED
|
@@ -501,19 +501,14 @@ class ExportService {
|
|
|
501
501
|
});
|
|
502
502
|
const activeColumns = columns.filter(col => !col.invisible && (!byFiltre || col.exportable === true));
|
|
503
503
|
// Génération des colonnes Excel
|
|
504
|
-
let cols =
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
const px = parseInt(col.width.toString().replace('px', '').trim(), 10);
|
|
513
|
-
colExcel.width = parseFloat((px / 7).toFixed(2));
|
|
514
|
-
}
|
|
515
|
-
cols.push(colExcel);
|
|
516
|
-
});
|
|
504
|
+
let cols = activeColumns.map(col => ({
|
|
505
|
+
header: col.libelle,
|
|
506
|
+
key: col.id,
|
|
507
|
+
style: this.getStyleByType(col.type),
|
|
508
|
+
width: col.width != null
|
|
509
|
+
? Math.max(parseFloat((parseInt(col.width.toString().replace('px', ''), 10) / 7.5).toFixed(2)), 12)
|
|
510
|
+
: Math.max(col.libelle ? col.libelle.length + 5 : 12, 12)
|
|
511
|
+
}));
|
|
517
512
|
ws.columns = cols;
|
|
518
513
|
const activeRows = byFiltre ? values.filter(row => row.exportable === true) : values;
|
|
519
514
|
// Traitement des lignes
|
|
@@ -643,9 +638,13 @@ class ExportService {
|
|
|
643
638
|
case ColType.Switch:
|
|
644
639
|
return cell.value === true ? 'Oui' : 'Non';
|
|
645
640
|
case ColType.Date:
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
641
|
+
if (!cell.value)
|
|
642
|
+
return null;
|
|
643
|
+
const d = cell.value instanceof Date ? cell.value : new Date(cell.value);
|
|
644
|
+
if (isNaN(d.getTime()))
|
|
645
|
+
return null;
|
|
646
|
+
const safeDate = new Date(d.getTime() + 12 * 60 * 60 * 1000);
|
|
647
|
+
return new Date(safeDate.getFullYear(), safeDate.getMonth(), safeDate.getDate(), 12, 0, 0);
|
|
649
648
|
default:
|
|
650
649
|
return cell.value;
|
|
651
650
|
}
|