ui-kit-ck-consultant 0.6.41 → 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,17 +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
921
  if (headerRow) {
922
- _this.getArray(headerRow).forEach(function (row) {
923
- var header = row.props.children.map(function (th) {
924
- return th.props && th.props.children ? _this.extractText(th.props.children) : '';
925
- }).join(';');
926
- dataCSV += header + '\n';
927
- });
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';
928
929
  }
929
930
  }
930
931
 
@@ -935,9 +936,10 @@ var Table = /*#__PURE__*/function (_React$Component) {
935
936
 
936
937
  if (bodyRow) {
937
938
  _this.getArray(bodyRow).forEach(function (row) {
938
- var body = row.props.children[0].map(function (th) {
939
- 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) : '';
940
941
  }).join(';');
942
+
941
943
  dataCSV += body + '\n';
942
944
  });
943
945
  }