ui-kit-ck-consultant 0.5.239 → 0.5.240

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
@@ -734,19 +734,25 @@ var Table = /*#__PURE__*/function (_React$Component) {
734
734
  _this.getCSV = function () {
735
735
  var dataCSV = '';
736
736
 
737
- _this.getArray(_this.props.children).forEach(function (children) {
738
- _this.getArray(children.props.children).forEach(function (line) {
739
- _this.getArray(line.props.children).forEach(function (column) {
740
- dataCSV += (column.props.children || '').toString() + ";";
741
- });
737
+ if (_this.props && _this.props.children) {
738
+ _this.getArray(_this.props.children).forEach(function (children) {
739
+ if (children.props && children.props.children) {
740
+ _this.getArray(children.props.children).forEach(function (line) {
741
+ if (line.props && line.props.children) {
742
+ _this.getArray(line.props.children).forEach(function (column) {
743
+ dataCSV += (column.props.children || '').toString() + ";";
744
+ });
742
745
 
743
- dataCSV += '\n';
746
+ dataCSV += '\n';
747
+ }
748
+ });
749
+ }
744
750
  });
745
- });
751
+ }
746
752
 
747
753
  var link = document.createElement('a');
748
754
  link.href = "data:text/csv;charset=utf-8," + encodeURIComponent(dataCSV);
749
- link.download = 'file.csv';
755
+ link.download = _this.props.nameCSV || 'file.csv';
750
756
  link.click();
751
757
  };
752
758