@gridsuite/commons-ui 0.227.0 → 0.229.0

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.
Files changed (195) hide show
  1. package/dist/components/composite/agGridTable/BottomTableButtons.d.ts +13 -0
  2. package/dist/components/composite/agGridTable/BottomTableButtons.js +92 -0
  3. package/dist/components/composite/agGridTable/CustomAgGridTable.d.ts +3 -2
  4. package/dist/components/composite/agGridTable/CustomAgGridTable.js +16 -38
  5. package/dist/components/composite/agGridTable/agGridTable-utils.d.ts +9 -0
  6. package/dist/components/composite/agGridTable/agGridTable-utils.js +1 -0
  7. package/dist/components/composite/agGridTable/cellEditors/index.js +3 -2
  8. package/dist/components/composite/agGridTable/cellEditors/numericEditor.d.ts +21 -19
  9. package/dist/components/composite/agGridTable/cellEditors/numericEditor.js +44 -57
  10. package/dist/components/composite/agGridTable/index.d.ts +2 -2
  11. package/dist/components/composite/agGridTable/index.js +5 -6
  12. package/dist/components/composite/dnd-table/dnd-table-add-rows-dialog.js +1 -0
  13. package/dist/components/composite/dnd-table/dnd-table-row.js +1 -0
  14. package/dist/components/composite/dnd-table/dnd-table.js +1 -0
  15. package/dist/components/composite/filter/HeaderFilterForm.js +1 -0
  16. package/dist/components/composite/filter/expert/ExpertFilterForm.js +1 -0
  17. package/dist/components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js +122 -91
  18. package/dist/components/composite/index.js +4 -5
  19. package/dist/components/index.js +6 -5
  20. package/dist/components/ui/csvDownloader/use-csv-export.js +2 -2
  21. package/dist/components/ui/csvPicker/csv-picker-confirmation-dialog.d.ts +11 -0
  22. package/dist/components/ui/csvPicker/csv-picker-confirmation-dialog.js +65 -0
  23. package/dist/components/ui/csvPicker/csv-picker.d.ts +24 -0
  24. package/dist/components/ui/csvPicker/csv-picker.js +123 -0
  25. package/dist/components/{composite/agGridTable/csvUploader → ui/csvPicker}/index.d.ts +2 -2
  26. package/dist/components/ui/csvPicker/index.js +4 -0
  27. package/dist/components/ui/dialogs/elementSaveDialog/ElementSaveDialog.d.ts +2 -1
  28. package/dist/components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js +6 -14
  29. package/dist/components/ui/index.d.ts +1 -0
  30. package/dist/components/ui/index.js +2 -0
  31. package/dist/components/ui/treeViewFinder/TreeViewFinder.js +14 -2
  32. package/dist/features/index.js +1 -0
  33. package/dist/features/network-modifications/battery/creation/BatteryCreationForm.js +2 -3
  34. package/dist/features/network-modifications/battery/creation/batteryCreation.utils.js +2 -3
  35. package/dist/features/network-modifications/battery/modification/BatteryDialogHeader.js +2 -3
  36. package/dist/features/network-modifications/battery/modification/BatteryDialogTabsContent.js +2 -3
  37. package/dist/features/network-modifications/battery/modification/batteryModification.utils.js +2 -3
  38. package/dist/features/network-modifications/by-filter/assignment/assignment/assignment-constants.d.ts +1 -1
  39. package/dist/features/network-modifications/by-filter/assignment/assignment/assignment-constants.js +17 -2
  40. package/dist/features/network-modifications/by-filter/assignment/assignment/assignment-form.js +1 -0
  41. package/dist/features/network-modifications/by-filter/assignment/modification-by-assignment-form.js +1 -0
  42. package/dist/features/network-modifications/by-filter/deletion/ByFilterDeletionForm.js +1 -0
  43. package/dist/features/network-modifications/common/activePowerControl/ActivePowerControlForm.js +1 -0
  44. package/dist/features/network-modifications/common/connectivity/ConnectivityForm.js +1 -0
  45. package/dist/features/network-modifications/common/connectivity/PositionForm.js +1 -0
  46. package/dist/features/network-modifications/common/connectivity/VoltageLevelConnectivityForm.js +1 -0
  47. package/dist/features/network-modifications/common/measurements/BusbarSectionVoltageMeasurementsForm.js +10 -8
  48. package/dist/features/network-modifications/common/measurements/PowerWithValidityForm.js +1 -0
  49. package/dist/features/network-modifications/common/measurements/measurement.type.d.ts +5 -0
  50. package/dist/features/network-modifications/common/properties/PropertiesForm.js +1 -0
  51. package/dist/features/network-modifications/common/properties/PropertyForm.js +1 -0
  52. package/dist/features/network-modifications/common/reactiveLimits/ReactiveLimitsForm.js +1 -0
  53. package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveRowForm.js +1 -0
  54. package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveTableForm.js +1 -0
  55. package/dist/features/network-modifications/common/regulatingTerminal/RegulatingTerminalForm.js +1 -0
  56. package/dist/features/network-modifications/common/setpoints/SetPointsForm.js +1 -0
  57. package/dist/features/network-modifications/common/shortCircuit/ShortCircuitForm.js +1 -0
  58. package/dist/features/network-modifications/common/voltageRegulation/VoltageRegulationForm.js +1 -0
  59. package/dist/features/network-modifications/equipmentDeletion/EquipmentDeletionForm.js +2 -3
  60. package/dist/features/network-modifications/equipmentDeletion/equipmentDeletion.utils.js +1 -0
  61. package/dist/features/network-modifications/equipmentDeletion/hvdcLccDeletion/ShuntCompensatorSelectionForm.js +1 -0
  62. package/dist/features/network-modifications/generator/creation/GeneratorCreationForm.js +2 -3
  63. package/dist/features/network-modifications/generator/creation/generatorCreation.utils.js +2 -3
  64. package/dist/features/network-modifications/generator/modification/GeneratorDialogHeader.js +2 -3
  65. package/dist/features/network-modifications/generator/modification/GeneratorDialogTabsContent.js +2 -3
  66. package/dist/features/network-modifications/generator/modification/generatorModification.utils.js +2 -3
  67. package/dist/features/network-modifications/index.js +1 -0
  68. package/dist/features/network-modifications/load/common/LoadDialogHeader.js +2 -3
  69. package/dist/features/network-modifications/load/creation/loadCreation.utils.js +1 -0
  70. package/dist/features/network-modifications/load/modification/loadModification.utils.js +2 -3
  71. package/dist/features/network-modifications/shunt-compensator/common/CharacteristicsForm.js +1 -0
  72. package/dist/features/network-modifications/shunt-compensator/creation/ShuntCompensatorCreationForm.js +2 -3
  73. package/dist/features/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.utils.js +2 -3
  74. package/dist/features/network-modifications/shunt-compensator/modification/ShuntCompensatorModificationForm.js +2 -3
  75. package/dist/features/network-modifications/shunt-compensator/modification/shuntCompensatorModification.utils.js +2 -3
  76. package/dist/features/network-modifications/substation/creation/SubstationCreationForm.js +2 -3
  77. package/dist/features/network-modifications/substation/modification/SubstationModificationForm.js +2 -3
  78. package/dist/features/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.js +2 -3
  79. package/dist/features/network-modifications/voltageLevel/creation/index.js +2 -3
  80. package/dist/features/network-modifications/voltageLevel/creation/tabs/characteristicsTab/CharacteristicsTab.js +1 -0
  81. package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/StructureTab.js +1 -0
  82. package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/couplingOmnibus/CouplingOmnibusForm.js +1 -0
  83. package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/SwitchesBetweenSections.js +1 -0
  84. package/dist/features/network-modifications/voltageLevel/creation/tabs/substationTab/SubstationCreationSection.js +2 -3
  85. package/dist/features/network-modifications/voltageLevel/creation/tabs/substationTab/SubstationTab.js +1 -0
  86. package/dist/features/network-modifications/voltageLevel/creation/voltageLevelCreation.utils.js +2 -3
  87. package/dist/features/network-modifications/voltageLevel/index.js +2 -3
  88. package/dist/features/network-modifications/voltageLevel/modification/VoltageLevelModificationForm.js +2 -3
  89. package/dist/features/network-modifications/voltageLevel/modification/voltageLevelModification.utils.d.ts +1 -5
  90. package/dist/features/parameters/common/ProviderParam.js +1 -0
  91. package/dist/features/parameters/common/contingency-table/columns-definitions.js +1 -0
  92. package/dist/features/parameters/common/limitreductions/limit-reduction-table-cell.js +1 -0
  93. package/dist/features/parameters/common/limitreductions/limit-reductions-table-form.js +1 -0
  94. package/dist/features/parameters/common/name-element-editor/name-element-editor-utils.js +1 -0
  95. package/dist/features/parameters/common/parameter-field.js +1 -0
  96. package/dist/features/parameters/common/parameter-table-field/parameter-table-field.js +1 -0
  97. package/dist/features/parameters/common/voltage-level-table/custom-voltage-level-table-cell.js +1 -0
  98. package/dist/features/parameters/common/widget/parameter-float.js +1 -0
  99. package/dist/features/parameters/common/widget/parameter-line-directory-items-input.js +1 -0
  100. package/dist/features/parameters/common/widget/parameter-line-slider.js +1 -0
  101. package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.js +1 -0
  102. package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js +1 -0
  103. package/dist/features/parameters/dynamic-margin-calculation/loads-variations-parameters.js +1 -0
  104. package/dist/features/parameters/dynamic-margin-calculation/use-dynamic-margin-calculation-parameters-form.js +2 -1
  105. package/dist/features/parameters/dynamic-security-analysis/contingency-parameters.js +1 -0
  106. package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js +1 -0
  107. package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.js +1 -0
  108. package/dist/features/parameters/dynamic-security-analysis/use-dynamic-security-analysis-parameters-form.js +1 -0
  109. package/dist/features/parameters/dynamic-simulation/dynamic-simulation-inline.js +1 -0
  110. package/dist/features/parameters/dynamic-simulation/dynamic-simulation-parameters-form.js +1 -0
  111. package/dist/features/parameters/dynamic-simulation/use-dynamic-simulation-parameters-form.js +1 -0
  112. package/dist/features/parameters/loadflow/load-flow-general-parameters.js +1 -0
  113. package/dist/features/parameters/loadflow/load-flow-parameters-content.js +1 -0
  114. package/dist/features/parameters/loadflow/load-flow-parameters-dialog.js +1 -0
  115. package/dist/features/parameters/loadflow/load-flow-parameters-form.js +1 -0
  116. package/dist/features/parameters/loadflow/load-flow-parameters-header.js +1 -0
  117. package/dist/features/parameters/loadflow/load-flow-parameters-inline.js +1 -0
  118. package/dist/features/parameters/loadflow/load-flow-parameters-utils.js +1 -0
  119. package/dist/features/parameters/loadflow/use-load-flow-parameters-form.js +1 -0
  120. package/dist/features/parameters/network-visualizations/map-parameters.js +1 -0
  121. package/dist/features/parameters/network-visualizations/network-area-diagram-parameters.js +1 -0
  122. package/dist/features/parameters/network-visualizations/network-visualizations-form.js +1 -0
  123. package/dist/features/parameters/network-visualizations/network-visualizations-parameters-dialog.js +1 -0
  124. package/dist/features/parameters/network-visualizations/network-visualizations-parameters-inline.js +1 -0
  125. package/dist/features/parameters/network-visualizations/single-line-diagram-parameters.js +1 -0
  126. package/dist/features/parameters/network-visualizations/use-network-visualizations-parameters-form.js +1 -0
  127. package/dist/features/parameters/pcc-min/pcc-min-form-utils.js +1 -0
  128. package/dist/features/parameters/pcc-min/pcc-min-parameters-dialog.js +1 -0
  129. package/dist/features/parameters/pcc-min/pcc-min-parameters-form.js +1 -0
  130. package/dist/features/parameters/pcc-min/pcc-min-parameters-inline.js +1 -0
  131. package/dist/features/parameters/pcc-min/use-pcc-min-parameters-form.js +1 -0
  132. package/dist/features/parameters/security-analysis/columns-definitions.js +1 -0
  133. package/dist/features/parameters/security-analysis/security-analysis-parameters-dialog.js +1 -0
  134. package/dist/features/parameters/security-analysis/security-analysis-parameters-form.js +1 -0
  135. package/dist/features/parameters/security-analysis/security-analysis-parameters-inline.js +1 -0
  136. package/dist/features/parameters/security-analysis/security-analysis-parameters-selector.js +1 -0
  137. package/dist/features/parameters/security-analysis/security-analysis-violations-hiding.js +1 -0
  138. package/dist/features/parameters/security-analysis/use-security-analysis-parameters-form.js +1 -0
  139. package/dist/features/parameters/sensi/columns-definitions.js +1 -0
  140. package/dist/features/parameters/sensi/sensitivity-analysis-parameters-dialog.js +1 -0
  141. package/dist/features/parameters/sensi/sensitivity-analysis-parameters-form.js +1 -0
  142. package/dist/features/parameters/sensi/sensitivity-analysis-parameters-inline.js +1 -0
  143. package/dist/features/parameters/sensi/sensitivity-parameters-fields.js +1 -0
  144. package/dist/features/parameters/sensi/sensitivity-parameters-selector.js +33 -4
  145. package/dist/features/parameters/sensi/use-sensitivity-analysis-parameters.js +1 -0
  146. package/dist/features/parameters/sensi/utils.js +1 -0
  147. package/dist/features/parameters/short-circuit/short-circuit-general-tab-panel.js +1 -0
  148. package/dist/features/parameters/short-circuit/short-circuit-icc-cluster-table-cell.js +1 -0
  149. package/dist/features/parameters/short-circuit/short-circuit-icc-material-table-cell.js +1 -0
  150. package/dist/features/parameters/short-circuit/short-circuit-parameters-content.js +1 -0
  151. package/dist/features/parameters/short-circuit/short-circuit-parameters-dialog.js +1 -0
  152. package/dist/features/parameters/short-circuit/short-circuit-parameters-form.js +1 -0
  153. package/dist/features/parameters/short-circuit/short-circuit-parameters-inline.js +1 -0
  154. package/dist/features/parameters/short-circuit/short-circuit-parameters-utils.js +1 -0
  155. package/dist/features/parameters/short-circuit/short-circuit-power-electronics-tab-panel.js +1 -0
  156. package/dist/features/parameters/short-circuit/short-circuit-study-area-tab-panel.js +1 -0
  157. package/dist/features/parameters/short-circuit/use-short-circuit-parameters-form.js +1 -0
  158. package/dist/features/parameters/voltage-init/equipment-selection-parameters.js +1 -0
  159. package/dist/features/parameters/voltage-init/general-parameters.js +1 -0
  160. package/dist/features/parameters/voltage-init/use-voltage-init-parameters-form.js +1 -0
  161. package/dist/features/parameters/voltage-init/voltage-init-form-utils.js +1 -0
  162. package/dist/features/parameters/voltage-init/voltage-init-parameters-dialog.js +1 -0
  163. package/dist/features/parameters/voltage-init/voltage-init-parameters-form.js +1 -0
  164. package/dist/features/parameters/voltage-init/voltage-init-parameters-inline.js +1 -0
  165. package/dist/features/parameters/voltage-init/voltage-limits-parameters.js +1 -0
  166. package/dist/index.js +12 -8
  167. package/dist/translations/en/commonButtonEn.d.ts +2 -0
  168. package/dist/translations/en/commonButtonEn.js +2 -0
  169. package/dist/translations/en/csvEn.d.ts +2 -1
  170. package/dist/translations/en/csvEn.js +5 -4
  171. package/dist/translations/en/networkModificationsEn.d.ts +2 -0
  172. package/dist/translations/en/networkModificationsEn.js +2 -0
  173. package/dist/translations/fr/commonButtonFr.d.ts +2 -0
  174. package/dist/translations/fr/commonButtonFr.js +2 -0
  175. package/dist/translations/fr/csvFr.d.ts +2 -1
  176. package/dist/translations/fr/csvFr.js +6 -5
  177. package/dist/translations/fr/networkModificationsFr.d.ts +2 -0
  178. package/dist/translations/fr/networkModificationsFr.js +2 -0
  179. package/dist/utils/algos.d.ts +1 -0
  180. package/dist/utils/algos.js +13 -1
  181. package/dist/utils/functions.d.ts +5 -0
  182. package/dist/utils/functions.js +5 -0
  183. package/dist/utils/index.js +6 -3
  184. package/dist/utils/langs.d.ts +1 -0
  185. package/dist/utils/langs.js +5 -1
  186. package/dist/utils/types/elementType.d.ts +1 -0
  187. package/dist/utils/types/elementType.js +1 -0
  188. package/dist/utils/types/fieldType.d.ts +2 -0
  189. package/dist/utils/types/fieldType.js +2 -0
  190. package/package.json +1 -2
  191. package/dist/components/composite/agGridTable/BottomRightButtons.d.ts +0 -14
  192. package/dist/components/composite/agGridTable/BottomRightButtons.js +0 -62
  193. package/dist/components/composite/agGridTable/csvUploader/CsvUploader.d.ts +0 -15
  194. package/dist/components/composite/agGridTable/csvUploader/CsvUploader.js +0 -182
  195. package/dist/components/composite/agGridTable/csvUploader/index.js +0 -4
@@ -1,182 +0,0 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { Dialog, DialogTitle, DialogContent, Grid, Button, Alert, DialogActions, DialogContentText } from "@mui/material";
3
- import { useCSVReader, RECORD_SEP, UNIT_SEP } from "react-papaparse";
4
- import React, { useState, useMemo } from "react";
5
- import { useIntl, FormattedMessage } from "react-intl";
6
- import CsvDownloader from "react-csv-downloader";
7
- import { useWatch } from "react-hook-form";
8
- import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
9
- import "../../../../utils/conversionUtils.js";
10
- import "../../../../utils/types/equipmentType.js";
11
- import { LANG_FRENCH } from "../../../../utils/langs.js";
12
- import "@mui/icons-material";
13
- import { CancelButton } from "../../../ui/reactHookForm/utils/CancelButton.js";
14
- import "yup";
15
- function CsvUploader({
16
- name,
17
- onClose,
18
- open,
19
- title,
20
- fileHeaders,
21
- fileName,
22
- csvData,
23
- validateData = () => true,
24
- getDataFromCsv,
25
- useFieldArrayOutput,
26
- language
27
- }) {
28
- const watchTableValues = useWatch({ name });
29
- const { append, replace } = useFieldArrayOutput;
30
- const [createError, setCreateError] = React.useState("");
31
- const intl = useIntl();
32
- const { CSVReader } = useCSVReader();
33
- const [importedData, setImportedData] = useState([]);
34
- const [isConfirmationPopupOpen, setIsConfirmationPopupOpen] = useState(false);
35
- const data = useMemo(() => {
36
- const newData = [...[fileHeaders]];
37
- if (Array.isArray(csvData)) {
38
- csvData.forEach((row) => newData.push([row]));
39
- }
40
- return newData;
41
- }, [csvData, fileHeaders]);
42
- const handleClose = () => {
43
- onClose();
44
- setCreateError("");
45
- };
46
- const validateCsvFile = (rows) => {
47
- if (rows.length === 0) {
48
- setCreateError(intl.formatMessage({ id: "noDataInCsvFile" }));
49
- return false;
50
- }
51
- for (let i = 0; i < fileHeaders.length; i++) {
52
- if (fileHeaders[i] !== "" && rows[0][i] !== fileHeaders[i]) {
53
- setCreateError(intl.formatMessage({ id: "wrongCsvHeadersError" }));
54
- return false;
55
- }
56
- }
57
- return validateData(rows);
58
- };
59
- const getResultsFromImportedData = () => {
60
- return importedData.filter((row) => {
61
- if (row[0].startsWith("#")) {
62
- return false;
63
- }
64
- return row.some((column) => !!column?.trim());
65
- });
66
- };
67
- const handleFileSubmit = (keepTableValues) => {
68
- if (importedData.length !== 0) {
69
- const result = getResultsFromImportedData();
70
- if (validateCsvFile(result)) {
71
- result.splice(0, 1);
72
- const dataFromCsv = getDataFromCsv(result);
73
- if (keepTableValues) {
74
- append(dataFromCsv);
75
- } else {
76
- replace(dataFromCsv);
77
- }
78
- handleClose();
79
- }
80
- } else {
81
- setCreateError(intl.formatMessage({ id: "noDataInCsvFile" }));
82
- }
83
- };
84
- const handleOpenCSVConfirmationDataDialog = () => {
85
- const isValuesInTable = Array.isArray(watchTableValues) && watchTableValues.some(
86
- (val) => val && Object.keys(val).filter((key) => key !== FieldConstants.AG_GRID_ROW_UUID).some((e) => val[e] !== void 0 && val[e] !== null && String(val[e]).trim().length > 0)
87
- );
88
- if (isValuesInTable && getResultsFromImportedData().length > 0) {
89
- setIsConfirmationPopupOpen(true);
90
- } else {
91
- setIsConfirmationPopupOpen(false);
92
- handleFileSubmit(false);
93
- }
94
- };
95
- const handleAddPopupConfirmation = () => {
96
- handleFileSubmit(true);
97
- setIsConfirmationPopupOpen(false);
98
- };
99
- const handleReplacePopupConfirmation = () => {
100
- handleFileSubmit(false);
101
- setIsConfirmationPopupOpen(false);
102
- };
103
- const handleCancelDialog = () => {
104
- setIsConfirmationPopupOpen(false);
105
- };
106
- const renderConfirmationCsvData = () => {
107
- return /* @__PURE__ */ jsxs(Dialog, { open: isConfirmationPopupOpen, "aria-labelledby": "dialog-confirmation-csv-data", children: [
108
- /* @__PURE__ */ jsx(DialogTitle, { id: "dialog-confirmation-csv-data", children: "Confirmation" }),
109
- /* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(DialogContentText, { children: intl.formatMessage({ id: "keepCSVDataMessage" }) }) }),
110
- /* @__PURE__ */ jsxs(DialogActions, { children: [
111
- /* @__PURE__ */ jsx(CancelButton, { onClick: handleCancelDialog }),
112
- /* @__PURE__ */ jsx(Button, { onClick: () => handleReplacePopupConfirmation(), variant: "outlined", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "replace" }) }),
113
- /* @__PURE__ */ jsx(Button, { onClick: () => handleAddPopupConfirmation(), variant: "outlined", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "add" }) })
114
- ] })
115
- ] });
116
- };
117
- return /* @__PURE__ */ jsxs(Fragment, { children: [
118
- /* @__PURE__ */ jsxs(Dialog, { open, onClose: handleClose, fullWidth: true, children: [
119
- /* @__PURE__ */ jsx(DialogTitle, { children: title }),
120
- /* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsxs("div", { children: [
121
- /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
122
- /* @__PURE__ */ jsx(Grid, { container: true, item: true, children: /* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: /* @__PURE__ */ jsx(
123
- CsvDownloader,
124
- {
125
- datas: data,
126
- filename: fileName,
127
- separator: language === LANG_FRENCH ? ";" : ",",
128
- children: /* @__PURE__ */ jsx(Button, { variant: "contained", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "GenerateCSV" }) })
129
- }
130
- ) }) }),
131
- /* @__PURE__ */ jsx(Grid, { container: true, item: true, spacing: 3, children: /* @__PURE__ */ jsx(
132
- CSVReader,
133
- {
134
- onUploadAccepted: (results) => {
135
- setImportedData([...results.data]);
136
- setCreateError("");
137
- },
138
- config: {
139
- // We use | for multi values in one cell, then we remove it from the default value for this config, to avoid delimiter autodetection
140
- delimitersToGuess: [",", " ", ";", RECORD_SEP, UNIT_SEP],
141
- delimiter: language === LANG_FRENCH ? ";" : ","
142
- },
143
- children: ({ getRootProps, acceptedFile }) => /* @__PURE__ */ jsxs(Grid, { item: true, children: [
144
- /* @__PURE__ */ jsx(Button, { ...getRootProps(), variant: "contained", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "UploadCSV" }) }),
145
- /* @__PURE__ */ jsx(
146
- "span",
147
- {
148
- style: {
149
- marginLeft: "10px",
150
- fontWeight: "bold"
151
- },
152
- children: acceptedFile ? acceptedFile.name : intl.formatMessage({
153
- id: "uploadMessage"
154
- })
155
- }
156
- )
157
- ] })
158
- }
159
- ) })
160
- ] }),
161
- createError !== "" && /* @__PURE__ */ jsx(Alert, { severity: "error", children: createError })
162
- ] }) }),
163
- /* @__PURE__ */ jsxs(DialogActions, { children: [
164
- /* @__PURE__ */ jsx(CancelButton, { onClick: handleClose }),
165
- /* @__PURE__ */ jsx(
166
- Button,
167
- {
168
- variant: "outlined",
169
- onClick: () => handleOpenCSVConfirmationDataDialog(),
170
- disabled: createError !== "",
171
- "data-testid": "ValidateButton",
172
- children: /* @__PURE__ */ jsx(FormattedMessage, { id: "validate" })
173
- }
174
- )
175
- ] })
176
- ] }),
177
- renderConfirmationCsvData()
178
- ] });
179
- }
180
- export {
181
- CsvUploader
182
- };
@@ -1,4 +0,0 @@
1
- import { CsvUploader } from "./CsvUploader.js";
2
- export {
3
- CsvUploader
4
- };