ui-kit-ck-consultant 0.6.40 → 0.6.42

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
@@ -914,21 +914,18 @@ var Table = /*#__PURE__*/function (_React$Component) {
914
914
  });
915
915
 
916
916
  if (thead) {
917
- var headerRow = _this.getArray(thead.props.children).filter(function (row) {
917
+ var headerRow = _this.getArray(thead.props.children).find(function (row) {
918
918
  return row.type.name === 'Tr';
919
919
  });
920
920
 
921
- console.log('headerRow 1', headerRow);
922
- console.log('headerRow 2', _this.getArray(headerRow));
923
-
924
921
  if (headerRow) {
925
- _this.getArray(headerRow).forEach(function (row) {
926
- console.log('row', row);
927
- var header = row.props.children[0].map(function (th) {
928
- return th.props && th.props.children ? _this.extractText(th.props.children) : '';
929
- }).join(';');
930
- dataCSV += header + '\n';
931
- });
922
+ var headers = _this.getArray(headerRow.props.children).flatMap(function (row) {
923
+ return _this.getArray(row.props.children);
924
+ }).map(function (th) {
925
+ return th.props && th.props.children ? _this.extractText(th.props.children) : '';
926
+ }).join(';');
927
+
928
+ dataCSV += headers + '\n';
932
929
  }
933
930
  }
934
931
 
@@ -939,9 +936,10 @@ var Table = /*#__PURE__*/function (_React$Component) {
939
936
 
940
937
  if (bodyRow) {
941
938
  _this.getArray(bodyRow).forEach(function (row) {
942
- var body = row.props.children[0].map(function (th) {
943
- return th.props && th.props.children ? _this.extractText(th.props.children) : '';
939
+ var body = _this.getArray(row.props.children).map(function (td) {
940
+ return td.props && td.props.children ? _this.extractText(td.props.children) : '';
944
941
  }).join(';');
942
+
945
943
  dataCSV += body + '\n';
946
944
  });
947
945
  }