ui-kit-ck-consultant 0.6.46 → 0.6.47

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.
@@ -896,35 +896,22 @@ var Table = /*#__PURE__*/function (_React$Component) {
896
896
  var allRows = tableChildren.flatMap(function (section) {
897
897
  var _section$props;
898
898
 
899
- return _this.getArray(((_section$props = section.props) === null || _section$props === void 0 ? void 0 : _section$props.children) || []).filter(function (child) {
899
+ return _this.getArray((_section$props = section.props) === null || _section$props === void 0 ? void 0 : _section$props.children).filter(function (child) {
900
900
  var _child$type;
901
901
 
902
902
  return (child === null || child === void 0 ? void 0 : (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.name) === 'Tr';
903
903
  });
904
904
  });
905
- console.log('Lignes (Tr) détectées:', allRows);
905
+ console.log('Toutes les lignes (Tr) trouvées:', JSON.stringify(allRows));
906
906
 
907
907
  if (allRows.length > 0) {
908
908
  allRows.forEach(function (row, rowIndex) {
909
- var cells = _this.getArray(row.props.children).flatMap(function (cell) {
910
- var _cell$type, _cell$type2, _cell$props;
909
+ var cells = _this.getArray(row.props.children[1] === undefined ? row.props.children : row.props.children[0]).filter(function (cell) {
910
+ var _cell$type, _cell$type2;
911
911
 
912
- 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') {
913
- return [cell];
914
- }
915
-
916
- if (cell !== null && cell !== void 0 && (_cell$props = cell.props) !== null && _cell$props !== void 0 && _cell$props.children) {
917
- return _this.getArray(cell.props.children).filter(function (child) {
918
- var _child$type2, _child$type3;
919
-
920
- 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';
921
- });
922
- }
923
-
924
- return [];
912
+ return (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';
925
913
  });
926
914
 
927
- console.log("Ligne " + (rowIndex + 1) + " - Cellules d\xE9tect\xE9es:", cells);
928
915
  var rowData = cells.map(function (cell) {
929
916
  return cell.props && cell.props.children ? _this.extractText(cell.props.children) : '';
930
917
  }).join(';');
@@ -933,9 +920,9 @@ var Table = /*#__PURE__*/function (_React$Component) {
933
920
  }
934
921
  }
935
922
 
936
- console.log('CSV généré:', dataCSV);
923
+ console.log('CSV output:', dataCSV);
937
924
 
938
- if (dataCSV.trim()) {
925
+ if (dataCSV) {
939
926
  var link = document.createElement('a');
940
927
  link.href = "data:text/csv;charset=utf-8,\uFEFF" + encodeURIComponent(dataCSV);
941
928
  link.download = _this.props.nameCSV || 'file.csv';