ui-kit-ck-consultant 0.6.59 → 0.6.61

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 CHANGED
@@ -892,39 +892,57 @@ var Table = /*#__PURE__*/function (_React$Component) {
892
892
 
893
893
  _this.getCSV = function (callback) {
894
894
  var dataCSV = '';
895
- console.log('this.props', _this.props);
896
895
 
897
- if (_this.props && _this.props.children) {
898
- console.log('this.props.children', _this.props.children);
896
+ if (_this.props.data) {
897
+ Object.keys(_this.props.data).forEach(function (key) {
898
+ var rowData = _this.props.data[key].map(function (cell) {
899
+ return cell ? _this.extractText(cell) : '';
900
+ }).join(';');
899
901
 
900
- var tableChildren = _this.getArray(_this.props.children);
902
+ dataCSV += rowData + '\n';
903
+ });
901
904
 
902
- var allRows = tableChildren.flatMap(function (section) {
903
- var _section$props;
905
+ _this.props.data.map(function (row) {
906
+ var rowData = row.map(function (cell) {
907
+ return cell ? _this.extractText(cell) : '';
908
+ }).join(';');
909
+ dataCSV += rowData + '\n';
910
+ });
911
+ } else {
912
+ console.log('this.props', _this.props);
904
913
 
905
- return _this.getArray((_section$props = section.props) === null || _section$props === void 0 ? void 0 : _section$props.children).filter(function (child) {
906
- var _child$type, _child$type2, _child$type3;
914
+ if (_this.props && _this.props.children) {
915
+ console.log('this.props.children', _this.props.children);
907
916
 
908
- return (child === null || child === void 0 ? void 0 : (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.name) === 'Tr' || (child === null || child === void 0 ? void 0 : (_child$type2 = child.type) === null || _child$type2 === void 0 ? void 0 : _child$type2.displayName) === 'Tr' || (child === null || child === void 0 ? void 0 : (_child$type3 = child.type) === null || _child$type3 === void 0 ? void 0 : _child$type3.displayName) === 'tr';
909
- });
910
- });
911
- console.log('Toutes les lignes (Tr) trouvées:', allRows);
917
+ var tableChildren = _this.getArray(_this.props.children);
912
918
 
913
- if (allRows.length > 0) {
914
- allRows.forEach(function (row, rowIndex) {
915
- console.log(row.props.children.length, row.props.children.length !== 2, row.props.children.type, row.props.children.type === React__default.Fragment, row);
919
+ var allRows = tableChildren.flatMap(function (section) {
920
+ var _section$props;
916
921
 
917
- var cells = _this.getArray(row.props.children.length !== 2 ? row.props.children.type === React__default.Fragment ? row.props.children.props.children[0] : row.props.children : row.props.children[0]).filter(function (cell) {
918
- var _cell$type, _cell$type2, _cell$type3, _cell$type4, _cell$type5, _cell$type6;
922
+ return _this.getArray((_section$props = section.props) === null || _section$props === void 0 ? void 0 : _section$props.children).filter(function (child) {
923
+ var _child$type, _child$type2, _child$type3;
919
924
 
920
- 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' || (cell === null || cell === void 0 ? void 0 : (_cell$type3 = cell.type) === null || _cell$type3 === void 0 ? void 0 : _cell$type3.displayName) === 'Th' || (cell === null || cell === void 0 ? void 0 : (_cell$type4 = cell.type) === null || _cell$type4 === void 0 ? void 0 : _cell$type4.displayName) === 'Td' || (cell === null || cell === void 0 ? void 0 : (_cell$type5 = cell.type) === null || _cell$type5 === void 0 ? void 0 : _cell$type5.displayName) === 'th' || (cell === null || cell === void 0 ? void 0 : (_cell$type6 = cell.type) === null || _cell$type6 === void 0 ? void 0 : _cell$type6.displayName) === 'td';
925
+ return (child === null || child === void 0 ? void 0 : (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.name) === 'Tr' || (child === null || child === void 0 ? void 0 : (_child$type2 = child.type) === null || _child$type2 === void 0 ? void 0 : _child$type2.displayName) === 'Tr' || (child === null || child === void 0 ? void 0 : (_child$type3 = child.type) === null || _child$type3 === void 0 ? void 0 : _child$type3.displayName) === 'tr';
921
926
  });
922
-
923
- var rowData = cells.map(function (cell) {
924
- return cell.props && cell.props.children ? _this.extractText(cell.props.children) : '';
925
- }).join(';');
926
- dataCSV += rowData + '\n';
927
927
  });
928
+ console.log('Toutes les lignes (Tr) trouvées:', allRows);
929
+
930
+ if (allRows.length > 0) {
931
+ allRows.forEach(function (row, rowIndex) {
932
+ console.log(row.props.children.length, row.props.children.length !== 2, row.props.children.type, row.props.children.type === React__default.Fragment, row);
933
+
934
+ var cells = _this.getArray(row.props.children.length !== 2 ? row.props.children.type === React__default.Fragment ? row.props.children.props.children[0] : row.props.children : row.props.children[0]).filter(function (cell) {
935
+ var _cell$type, _cell$type2, _cell$type3, _cell$type4, _cell$type5, _cell$type6;
936
+
937
+ 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' || (cell === null || cell === void 0 ? void 0 : (_cell$type3 = cell.type) === null || _cell$type3 === void 0 ? void 0 : _cell$type3.displayName) === 'Th' || (cell === null || cell === void 0 ? void 0 : (_cell$type4 = cell.type) === null || _cell$type4 === void 0 ? void 0 : _cell$type4.displayName) === 'Td' || (cell === null || cell === void 0 ? void 0 : (_cell$type5 = cell.type) === null || _cell$type5 === void 0 ? void 0 : _cell$type5.displayName) === 'th' || (cell === null || cell === void 0 ? void 0 : (_cell$type6 = cell.type) === null || _cell$type6 === void 0 ? void 0 : _cell$type6.displayName) === 'td';
938
+ });
939
+
940
+ var rowData = cells.map(function (cell) {
941
+ return cell.props && cell.props.children ? _this.extractText(cell.props.children) : '';
942
+ }).join(';');
943
+ dataCSV += rowData + '\n';
944
+ });
945
+ }
928
946
  }
929
947
  }
930
948
 
@@ -1092,7 +1110,7 @@ var Th = /*#__PURE__*/function (_React$Component) {
1092
1110
  return Th;
1093
1111
  }(React__default.Component);
1094
1112
 
1095
- Tr.displayName = 'Th';
1113
+ Th.displayName = 'Th';
1096
1114
 
1097
1115
  var Td = /*#__PURE__*/function (_React$Component) {
1098
1116
  _inheritsLoose(Td, _React$Component);
@@ -1120,9 +1138,9 @@ var Td = /*#__PURE__*/function (_React$Component) {
1120
1138
  return Td;
1121
1139
  }(React__default.Component);
1122
1140
 
1123
- Tr.displayName = 'Td';
1141
+ Td.displayName = 'Td';
1124
1142
 
1125
- var Tr$1 = /*#__PURE__*/function (_React$Component) {
1143
+ var Tr = /*#__PURE__*/function (_React$Component) {
1126
1144
  _inheritsLoose(Tr, _React$Component);
1127
1145
 
1128
1146
  function Tr() {
@@ -1142,7 +1160,7 @@ var Tr$1 = /*#__PURE__*/function (_React$Component) {
1142
1160
  return Tr;
1143
1161
  }(React__default.Component);
1144
1162
 
1145
- Tr$1.displayName = 'Tr';
1163
+ Tr.displayName = 'Tr';
1146
1164
 
1147
1165
  var style$a = {"nav":"_JJyUj","nav_left":"_3kuw-","nav_right":"_3vpQT","nav_back":"_HJHB0","nav_text":"_1pO70"};
1148
1166
 
@@ -10681,5 +10699,5 @@ exports.Tbody = Tbody;
10681
10699
  exports.Td = Td;
10682
10700
  exports.Th = Th;
10683
10701
  exports.Thead = Thead;
10684
- exports.Tr = Tr$1;
10702
+ exports.Tr = Tr;
10685
10703
  //# sourceMappingURL=index.js.map