ui-kit-ck-consultant 0.6.41 → 0.6.43
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 +30 -46
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +30 -46
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -45,14 +45,6 @@ function _setPrototypeOf(o, p) {
|
|
45
45
|
return _setPrototypeOf(o, p);
|
46
46
|
}
|
47
47
|
|
48
|
-
function _assertThisInitialized(self) {
|
49
|
-
if (self === void 0) {
|
50
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
51
|
-
}
|
52
|
-
|
53
|
-
return self;
|
54
|
-
}
|
55
|
-
|
56
48
|
var style = {"modal":"_Tr9L0","modal_container":"_2YluD","no_background":"_2vjgy","large":"_22C7A","extraLarge":"_VOwgj","modal_right":"_eWY0H","modal_move":"_20eCx","modal_valid":"_RsujT","modal_close":"_1AbTJ","modal_custom":"_33Wb2","modal_header":"_2EzqX","modal_body":"_1-Y1J","full_modal_container":"_1w6wH","full_modal_header":"_2wSoq","full_modal_body":"_3bfp5","full_modal_body_no_padding":"_Pf5Uh","full_modal_body_no_overflow":"_3sTgK"};
|
57
49
|
|
58
50
|
var Modal = /*#__PURE__*/function (_React$Component) {
|
@@ -902,54 +894,46 @@ var Table = /*#__PURE__*/function (_React$Component) {
|
|
902
894
|
var dataCSV = '';
|
903
895
|
|
904
896
|
if (_this.props && _this.props.children) {
|
905
|
-
var
|
897
|
+
var tableChildren = _this.getArray(_this.props.children);
|
906
898
|
|
907
|
-
|
908
|
-
var
|
909
|
-
return child.type.name === 'Thead';
|
910
|
-
});
|
899
|
+
var allRows = tableChildren.flatMap(function (section) {
|
900
|
+
var _section$props;
|
911
901
|
|
912
|
-
|
913
|
-
|
914
|
-
});
|
902
|
+
return _this.getArray((_section$props = section.props) === null || _section$props === void 0 ? void 0 : _section$props.children).filter(function (child) {
|
903
|
+
var _child$type;
|
915
904
|
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
905
|
+
return (child === null || child === void 0 ? void 0 : (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.name) === 'Tr';
|
906
|
+
});
|
907
|
+
});
|
908
|
+
console.log('Toutes les lignes (Tr) trouvées:', allRows);
|
920
909
|
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
}).join(';');
|
926
|
-
dataCSV += header + '\n';
|
927
|
-
});
|
928
|
-
}
|
929
|
-
}
|
910
|
+
if (allRows.length > 0) {
|
911
|
+
allRows.forEach(function (row, rowIndex) {
|
912
|
+
var cells = _this.getArray(row.props.children).filter(function (cell) {
|
913
|
+
var _cell$type, _cell$type2;
|
930
914
|
|
931
|
-
|
932
|
-
var bodyRow = _this.getArray(tbody.props.children).filter(function (row) {
|
933
|
-
return row.type.name === 'Tr';
|
915
|
+
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';
|
934
916
|
});
|
935
917
|
|
936
|
-
|
937
|
-
_this.
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
dataCSV += body + '\n';
|
942
|
-
});
|
943
|
-
}
|
944
|
-
}
|
918
|
+
var rowData = cells.map(function (cell) {
|
919
|
+
return cell.props && cell.props.children ? _this.extractText(cell.props.children) : '';
|
920
|
+
}).join(';');
|
921
|
+
dataCSV += rowData + '\n';
|
922
|
+
});
|
945
923
|
}
|
946
924
|
}
|
947
925
|
|
948
|
-
console.log(dataCSV);
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
926
|
+
console.log('CSV output:', dataCSV);
|
927
|
+
|
928
|
+
if (dataCSV) {
|
929
|
+
var link = document.createElement('a');
|
930
|
+
link.href = "data:text/csv;charset=utf-8,\uFEFF" + encodeURIComponent(dataCSV);
|
931
|
+
link.download = _this.props.nameCSV || 'file.csv';
|
932
|
+
link.click();
|
933
|
+
} else {
|
934
|
+
console.warn('Le CSV est vide, vérifiez la structure du tableau.');
|
935
|
+
}
|
936
|
+
|
953
937
|
callback();
|
954
938
|
};
|
955
939
|
|