ui-kit-ck-consultant 0.6.42 → 0.6.44
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 +31 -48
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +31 -48
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
@@ -42,14 +42,6 @@ function _setPrototypeOf(o, p) {
|
|
42
42
|
return _setPrototypeOf(o, p);
|
43
43
|
}
|
44
44
|
|
45
|
-
function _assertThisInitialized(self) {
|
46
|
-
if (self === void 0) {
|
47
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
48
|
-
}
|
49
|
-
|
50
|
-
return self;
|
51
|
-
}
|
52
|
-
|
53
45
|
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"};
|
54
46
|
|
55
47
|
var Modal = /*#__PURE__*/function (_React$Component) {
|
@@ -899,56 +891,47 @@ var Table = /*#__PURE__*/function (_React$Component) {
|
|
899
891
|
var dataCSV = '';
|
900
892
|
|
901
893
|
if (_this.props && _this.props.children) {
|
902
|
-
var
|
894
|
+
var tableChildren = _this.getArray(_this.props.children);
|
903
895
|
|
904
|
-
|
905
|
-
var
|
906
|
-
return child.type.name === 'Thead';
|
907
|
-
});
|
896
|
+
var allRows = tableChildren.flatMap(function (section) {
|
897
|
+
var _section$props;
|
908
898
|
|
909
|
-
|
910
|
-
|
911
|
-
});
|
899
|
+
return _this.getArray(((_section$props = section.props) === null || _section$props === void 0 ? void 0 : _section$props.children) || []).filter(function (child) {
|
900
|
+
var _child$type;
|
912
901
|
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
902
|
+
return (child === null || child === void 0 ? void 0 : (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.name) === 'Tr';
|
903
|
+
});
|
904
|
+
});
|
905
|
+
console.log('Lignes (Tr) détectées:', JSON.stringify(allRows));
|
917
906
|
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
return th.props && th.props.children ? _this.extractText(th.props.children) : '';
|
923
|
-
}).join(';');
|
907
|
+
if (allRows.length > 0) {
|
908
|
+
allRows.forEach(function (row, rowIndex) {
|
909
|
+
var cells = _this.getArray(row.props.children).filter(function (cell) {
|
910
|
+
var _cell$type, _cell$type2;
|
924
911
|
|
925
|
-
|
926
|
-
}
|
927
|
-
}
|
928
|
-
|
929
|
-
if (tbody) {
|
930
|
-
var bodyRow = _this.getArray(tbody.props.children).filter(function (row) {
|
931
|
-
return row.type.name === 'Tr';
|
912
|
+
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';
|
932
913
|
});
|
933
914
|
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
dataCSV += body + '\n';
|
941
|
-
});
|
942
|
-
}
|
943
|
-
}
|
915
|
+
console.log("Ligne " + (rowIndex + 1) + " - Cellules d\xE9tect\xE9es:", JSON.stringify(cells));
|
916
|
+
var rowData = cells.map(function (cell) {
|
917
|
+
return cell.props && cell.props.children ? _this.extractText(cell.props.children) : '';
|
918
|
+
}).join(';');
|
919
|
+
dataCSV += rowData + '\n';
|
920
|
+
});
|
944
921
|
}
|
945
922
|
}
|
946
923
|
|
947
|
-
console.log(dataCSV);
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
924
|
+
console.log('CSV généré:', dataCSV);
|
925
|
+
|
926
|
+
if (dataCSV) {
|
927
|
+
var link = document.createElement('a');
|
928
|
+
link.href = "data:text/csv;charset=utf-8,\uFEFF" + encodeURIComponent(dataCSV);
|
929
|
+
link.download = _this.props.nameCSV || 'file.csv';
|
930
|
+
link.click();
|
931
|
+
} else {
|
932
|
+
console.warn('Le CSV est vide, vérifiez la structure du tableau.');
|
933
|
+
}
|
934
|
+
|
952
935
|
callback();
|
953
936
|
};
|
954
937
|
|