ui-kit-ck-consultant 0.6.44 → 0.6.46
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 +18 -6
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +18 -6
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -905,17 +905,29 @@ var Table = /*#__PURE__*/function (_React$Component) {
|
|
905
905
|
return (child === null || child === void 0 ? void 0 : (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.name) === 'Tr';
|
906
906
|
});
|
907
907
|
});
|
908
|
-
console.log('Lignes (Tr) détectées:',
|
908
|
+
console.log('Lignes (Tr) détectées:', allRows);
|
909
909
|
|
910
910
|
if (allRows.length > 0) {
|
911
911
|
allRows.forEach(function (row, rowIndex) {
|
912
|
-
var cells = _this.getArray(row.props.children).
|
913
|
-
var _cell$type, _cell$type2;
|
912
|
+
var cells = _this.getArray(row.props.children).flatMap(function (cell) {
|
913
|
+
var _cell$type, _cell$type2, _cell$props;
|
914
914
|
|
915
|
-
|
915
|
+
if ((cell === null || cell === void 0 ? void 0 : (_cell$type = cell.type) === null || _cell$type === void 0 ? void 0 : _cell$type.name) === 'Th' || (cell === null || cell === void 0 ? void 0 : (_cell$type2 = cell.type) === null || _cell$type2 === void 0 ? void 0 : _cell$type2.name) === 'Td') {
|
916
|
+
return [cell];
|
917
|
+
}
|
918
|
+
|
919
|
+
if (cell !== null && cell !== void 0 && (_cell$props = cell.props) !== null && _cell$props !== void 0 && _cell$props.children) {
|
920
|
+
return _this.getArray(cell.props.children).filter(function (child) {
|
921
|
+
var _child$type2, _child$type3;
|
922
|
+
|
923
|
+
return (child === null || child === void 0 ? void 0 : (_child$type2 = child.type) === null || _child$type2 === void 0 ? void 0 : _child$type2.name) === 'Th' || (child === null || child === void 0 ? void 0 : (_child$type3 = child.type) === null || _child$type3 === void 0 ? void 0 : _child$type3.name) === 'Td';
|
924
|
+
});
|
925
|
+
}
|
926
|
+
|
927
|
+
return [];
|
916
928
|
});
|
917
929
|
|
918
|
-
console.log("Ligne " + (rowIndex + 1) + " - Cellules d\xE9tect\xE9es:",
|
930
|
+
console.log("Ligne " + (rowIndex + 1) + " - Cellules d\xE9tect\xE9es:", cells);
|
919
931
|
var rowData = cells.map(function (cell) {
|
920
932
|
return cell.props && cell.props.children ? _this.extractText(cell.props.children) : '';
|
921
933
|
}).join(';');
|
@@ -926,7 +938,7 @@ var Table = /*#__PURE__*/function (_React$Component) {
|
|
926
938
|
|
927
939
|
console.log('CSV généré:', dataCSV);
|
928
940
|
|
929
|
-
if (dataCSV) {
|
941
|
+
if (dataCSV.trim()) {
|
930
942
|
var link = document.createElement('a');
|
931
943
|
link.href = "data:text/csv;charset=utf-8,\uFEFF" + encodeURIComponent(dataCSV);
|
932
944
|
link.download = _this.props.nameCSV || 'file.csv';
|