@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.
- package/dist/components/composite/agGridTable/BottomTableButtons.d.ts +13 -0
- package/dist/components/composite/agGridTable/BottomTableButtons.js +92 -0
- package/dist/components/composite/agGridTable/CustomAgGridTable.d.ts +3 -2
- package/dist/components/composite/agGridTable/CustomAgGridTable.js +16 -38
- package/dist/components/composite/agGridTable/agGridTable-utils.d.ts +9 -0
- package/dist/components/composite/agGridTable/agGridTable-utils.js +1 -0
- package/dist/components/composite/agGridTable/cellEditors/index.js +3 -2
- package/dist/components/composite/agGridTable/cellEditors/numericEditor.d.ts +21 -19
- package/dist/components/composite/agGridTable/cellEditors/numericEditor.js +44 -57
- package/dist/components/composite/agGridTable/index.d.ts +2 -2
- package/dist/components/composite/agGridTable/index.js +5 -6
- package/dist/components/composite/dnd-table/dnd-table-add-rows-dialog.js +1 -0
- package/dist/components/composite/dnd-table/dnd-table-row.js +1 -0
- package/dist/components/composite/dnd-table/dnd-table.js +1 -0
- package/dist/components/composite/filter/HeaderFilterForm.js +1 -0
- package/dist/components/composite/filter/expert/ExpertFilterForm.js +1 -0
- package/dist/components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js +122 -91
- package/dist/components/composite/index.js +4 -5
- package/dist/components/index.js +6 -5
- package/dist/components/ui/csvDownloader/use-csv-export.js +2 -2
- package/dist/components/ui/csvPicker/csv-picker-confirmation-dialog.d.ts +11 -0
- package/dist/components/ui/csvPicker/csv-picker-confirmation-dialog.js +65 -0
- package/dist/components/ui/csvPicker/csv-picker.d.ts +24 -0
- package/dist/components/ui/csvPicker/csv-picker.js +123 -0
- package/dist/components/{composite/agGridTable/csvUploader → ui/csvPicker}/index.d.ts +2 -2
- package/dist/components/ui/csvPicker/index.js +4 -0
- package/dist/components/ui/dialogs/elementSaveDialog/ElementSaveDialog.d.ts +2 -1
- package/dist/components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js +6 -14
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.js +2 -0
- package/dist/components/ui/treeViewFinder/TreeViewFinder.js +14 -2
- package/dist/features/index.js +1 -0
- package/dist/features/network-modifications/battery/creation/BatteryCreationForm.js +2 -3
- package/dist/features/network-modifications/battery/creation/batteryCreation.utils.js +2 -3
- package/dist/features/network-modifications/battery/modification/BatteryDialogHeader.js +2 -3
- package/dist/features/network-modifications/battery/modification/BatteryDialogTabsContent.js +2 -3
- package/dist/features/network-modifications/battery/modification/batteryModification.utils.js +2 -3
- package/dist/features/network-modifications/by-filter/assignment/assignment/assignment-constants.d.ts +1 -1
- package/dist/features/network-modifications/by-filter/assignment/assignment/assignment-constants.js +17 -2
- package/dist/features/network-modifications/by-filter/assignment/assignment/assignment-form.js +1 -0
- package/dist/features/network-modifications/by-filter/assignment/modification-by-assignment-form.js +1 -0
- package/dist/features/network-modifications/by-filter/deletion/ByFilterDeletionForm.js +1 -0
- package/dist/features/network-modifications/common/activePowerControl/ActivePowerControlForm.js +1 -0
- package/dist/features/network-modifications/common/connectivity/ConnectivityForm.js +1 -0
- package/dist/features/network-modifications/common/connectivity/PositionForm.js +1 -0
- package/dist/features/network-modifications/common/connectivity/VoltageLevelConnectivityForm.js +1 -0
- package/dist/features/network-modifications/common/measurements/BusbarSectionVoltageMeasurementsForm.js +10 -8
- package/dist/features/network-modifications/common/measurements/PowerWithValidityForm.js +1 -0
- package/dist/features/network-modifications/common/measurements/measurement.type.d.ts +5 -0
- package/dist/features/network-modifications/common/properties/PropertiesForm.js +1 -0
- package/dist/features/network-modifications/common/properties/PropertyForm.js +1 -0
- package/dist/features/network-modifications/common/reactiveLimits/ReactiveLimitsForm.js +1 -0
- package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveRowForm.js +1 -0
- package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveTableForm.js +1 -0
- package/dist/features/network-modifications/common/regulatingTerminal/RegulatingTerminalForm.js +1 -0
- package/dist/features/network-modifications/common/setpoints/SetPointsForm.js +1 -0
- package/dist/features/network-modifications/common/shortCircuit/ShortCircuitForm.js +1 -0
- package/dist/features/network-modifications/common/voltageRegulation/VoltageRegulationForm.js +1 -0
- package/dist/features/network-modifications/equipmentDeletion/EquipmentDeletionForm.js +2 -3
- package/dist/features/network-modifications/equipmentDeletion/equipmentDeletion.utils.js +1 -0
- package/dist/features/network-modifications/equipmentDeletion/hvdcLccDeletion/ShuntCompensatorSelectionForm.js +1 -0
- package/dist/features/network-modifications/generator/creation/GeneratorCreationForm.js +2 -3
- package/dist/features/network-modifications/generator/creation/generatorCreation.utils.js +2 -3
- package/dist/features/network-modifications/generator/modification/GeneratorDialogHeader.js +2 -3
- package/dist/features/network-modifications/generator/modification/GeneratorDialogTabsContent.js +2 -3
- package/dist/features/network-modifications/generator/modification/generatorModification.utils.js +2 -3
- package/dist/features/network-modifications/index.js +1 -0
- package/dist/features/network-modifications/load/common/LoadDialogHeader.js +2 -3
- package/dist/features/network-modifications/load/creation/loadCreation.utils.js +1 -0
- package/dist/features/network-modifications/load/modification/loadModification.utils.js +2 -3
- package/dist/features/network-modifications/shunt-compensator/common/CharacteristicsForm.js +1 -0
- package/dist/features/network-modifications/shunt-compensator/creation/ShuntCompensatorCreationForm.js +2 -3
- package/dist/features/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.utils.js +2 -3
- package/dist/features/network-modifications/shunt-compensator/modification/ShuntCompensatorModificationForm.js +2 -3
- package/dist/features/network-modifications/shunt-compensator/modification/shuntCompensatorModification.utils.js +2 -3
- package/dist/features/network-modifications/substation/creation/SubstationCreationForm.js +2 -3
- package/dist/features/network-modifications/substation/modification/SubstationModificationForm.js +2 -3
- package/dist/features/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.js +2 -3
- package/dist/features/network-modifications/voltageLevel/creation/index.js +2 -3
- package/dist/features/network-modifications/voltageLevel/creation/tabs/characteristicsTab/CharacteristicsTab.js +1 -0
- package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/StructureTab.js +1 -0
- package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/couplingOmnibus/CouplingOmnibusForm.js +1 -0
- package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/SwitchesBetweenSections.js +1 -0
- package/dist/features/network-modifications/voltageLevel/creation/tabs/substationTab/SubstationCreationSection.js +2 -3
- package/dist/features/network-modifications/voltageLevel/creation/tabs/substationTab/SubstationTab.js +1 -0
- package/dist/features/network-modifications/voltageLevel/creation/voltageLevelCreation.utils.js +2 -3
- package/dist/features/network-modifications/voltageLevel/index.js +2 -3
- package/dist/features/network-modifications/voltageLevel/modification/VoltageLevelModificationForm.js +2 -3
- package/dist/features/network-modifications/voltageLevel/modification/voltageLevelModification.utils.d.ts +1 -5
- package/dist/features/parameters/common/ProviderParam.js +1 -0
- package/dist/features/parameters/common/contingency-table/columns-definitions.js +1 -0
- package/dist/features/parameters/common/limitreductions/limit-reduction-table-cell.js +1 -0
- package/dist/features/parameters/common/limitreductions/limit-reductions-table-form.js +1 -0
- package/dist/features/parameters/common/name-element-editor/name-element-editor-utils.js +1 -0
- package/dist/features/parameters/common/parameter-field.js +1 -0
- package/dist/features/parameters/common/parameter-table-field/parameter-table-field.js +1 -0
- package/dist/features/parameters/common/voltage-level-table/custom-voltage-level-table-cell.js +1 -0
- package/dist/features/parameters/common/widget/parameter-float.js +1 -0
- package/dist/features/parameters/common/widget/parameter-line-directory-items-input.js +1 -0
- package/dist/features/parameters/common/widget/parameter-line-slider.js +1 -0
- package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.js +1 -0
- package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js +1 -0
- package/dist/features/parameters/dynamic-margin-calculation/loads-variations-parameters.js +1 -0
- package/dist/features/parameters/dynamic-margin-calculation/use-dynamic-margin-calculation-parameters-form.js +2 -1
- package/dist/features/parameters/dynamic-security-analysis/contingency-parameters.js +1 -0
- package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js +1 -0
- package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.js +1 -0
- package/dist/features/parameters/dynamic-security-analysis/use-dynamic-security-analysis-parameters-form.js +1 -0
- package/dist/features/parameters/dynamic-simulation/dynamic-simulation-inline.js +1 -0
- package/dist/features/parameters/dynamic-simulation/dynamic-simulation-parameters-form.js +1 -0
- package/dist/features/parameters/dynamic-simulation/use-dynamic-simulation-parameters-form.js +1 -0
- package/dist/features/parameters/loadflow/load-flow-general-parameters.js +1 -0
- package/dist/features/parameters/loadflow/load-flow-parameters-content.js +1 -0
- package/dist/features/parameters/loadflow/load-flow-parameters-dialog.js +1 -0
- package/dist/features/parameters/loadflow/load-flow-parameters-form.js +1 -0
- package/dist/features/parameters/loadflow/load-flow-parameters-header.js +1 -0
- package/dist/features/parameters/loadflow/load-flow-parameters-inline.js +1 -0
- package/dist/features/parameters/loadflow/load-flow-parameters-utils.js +1 -0
- package/dist/features/parameters/loadflow/use-load-flow-parameters-form.js +1 -0
- package/dist/features/parameters/network-visualizations/map-parameters.js +1 -0
- package/dist/features/parameters/network-visualizations/network-area-diagram-parameters.js +1 -0
- package/dist/features/parameters/network-visualizations/network-visualizations-form.js +1 -0
- package/dist/features/parameters/network-visualizations/network-visualizations-parameters-dialog.js +1 -0
- package/dist/features/parameters/network-visualizations/network-visualizations-parameters-inline.js +1 -0
- package/dist/features/parameters/network-visualizations/single-line-diagram-parameters.js +1 -0
- package/dist/features/parameters/network-visualizations/use-network-visualizations-parameters-form.js +1 -0
- package/dist/features/parameters/pcc-min/pcc-min-form-utils.js +1 -0
- package/dist/features/parameters/pcc-min/pcc-min-parameters-dialog.js +1 -0
- package/dist/features/parameters/pcc-min/pcc-min-parameters-form.js +1 -0
- package/dist/features/parameters/pcc-min/pcc-min-parameters-inline.js +1 -0
- package/dist/features/parameters/pcc-min/use-pcc-min-parameters-form.js +1 -0
- package/dist/features/parameters/security-analysis/columns-definitions.js +1 -0
- package/dist/features/parameters/security-analysis/security-analysis-parameters-dialog.js +1 -0
- package/dist/features/parameters/security-analysis/security-analysis-parameters-form.js +1 -0
- package/dist/features/parameters/security-analysis/security-analysis-parameters-inline.js +1 -0
- package/dist/features/parameters/security-analysis/security-analysis-parameters-selector.js +1 -0
- package/dist/features/parameters/security-analysis/security-analysis-violations-hiding.js +1 -0
- package/dist/features/parameters/security-analysis/use-security-analysis-parameters-form.js +1 -0
- package/dist/features/parameters/sensi/columns-definitions.js +1 -0
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-dialog.js +1 -0
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-form.js +1 -0
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-inline.js +1 -0
- package/dist/features/parameters/sensi/sensitivity-parameters-fields.js +1 -0
- package/dist/features/parameters/sensi/sensitivity-parameters-selector.js +33 -4
- package/dist/features/parameters/sensi/use-sensitivity-analysis-parameters.js +1 -0
- package/dist/features/parameters/sensi/utils.js +1 -0
- package/dist/features/parameters/short-circuit/short-circuit-general-tab-panel.js +1 -0
- package/dist/features/parameters/short-circuit/short-circuit-icc-cluster-table-cell.js +1 -0
- package/dist/features/parameters/short-circuit/short-circuit-icc-material-table-cell.js +1 -0
- package/dist/features/parameters/short-circuit/short-circuit-parameters-content.js +1 -0
- package/dist/features/parameters/short-circuit/short-circuit-parameters-dialog.js +1 -0
- package/dist/features/parameters/short-circuit/short-circuit-parameters-form.js +1 -0
- package/dist/features/parameters/short-circuit/short-circuit-parameters-inline.js +1 -0
- package/dist/features/parameters/short-circuit/short-circuit-parameters-utils.js +1 -0
- package/dist/features/parameters/short-circuit/short-circuit-power-electronics-tab-panel.js +1 -0
- package/dist/features/parameters/short-circuit/short-circuit-study-area-tab-panel.js +1 -0
- package/dist/features/parameters/short-circuit/use-short-circuit-parameters-form.js +1 -0
- package/dist/features/parameters/voltage-init/equipment-selection-parameters.js +1 -0
- package/dist/features/parameters/voltage-init/general-parameters.js +1 -0
- package/dist/features/parameters/voltage-init/use-voltage-init-parameters-form.js +1 -0
- package/dist/features/parameters/voltage-init/voltage-init-form-utils.js +1 -0
- package/dist/features/parameters/voltage-init/voltage-init-parameters-dialog.js +1 -0
- package/dist/features/parameters/voltage-init/voltage-init-parameters-form.js +1 -0
- package/dist/features/parameters/voltage-init/voltage-init-parameters-inline.js +1 -0
- package/dist/features/parameters/voltage-init/voltage-limits-parameters.js +1 -0
- package/dist/index.js +12 -8
- package/dist/translations/en/commonButtonEn.d.ts +2 -0
- package/dist/translations/en/commonButtonEn.js +2 -0
- package/dist/translations/en/csvEn.d.ts +2 -1
- package/dist/translations/en/csvEn.js +5 -4
- package/dist/translations/en/networkModificationsEn.d.ts +2 -0
- package/dist/translations/en/networkModificationsEn.js +2 -0
- package/dist/translations/fr/commonButtonFr.d.ts +2 -0
- package/dist/translations/fr/commonButtonFr.js +2 -0
- package/dist/translations/fr/csvFr.d.ts +2 -1
- package/dist/translations/fr/csvFr.js +6 -5
- package/dist/translations/fr/networkModificationsFr.d.ts +2 -0
- package/dist/translations/fr/networkModificationsFr.js +2 -0
- package/dist/utils/algos.d.ts +1 -0
- package/dist/utils/algos.js +13 -1
- package/dist/utils/functions.d.ts +5 -0
- package/dist/utils/functions.js +5 -0
- package/dist/utils/index.js +6 -3
- package/dist/utils/langs.d.ts +1 -0
- package/dist/utils/langs.js +5 -1
- package/dist/utils/types/elementType.d.ts +1 -0
- package/dist/utils/types/elementType.js +1 -0
- package/dist/utils/types/fieldType.d.ts +2 -0
- package/dist/utils/types/fieldType.js +2 -0
- package/package.json +1 -2
- package/dist/components/composite/agGridTable/BottomRightButtons.d.ts +0 -14
- package/dist/components/composite/agGridTable/BottomRightButtons.js +0 -62
- package/dist/components/composite/agGridTable/csvUploader/CsvUploader.d.ts +0 -15
- package/dist/components/composite/agGridTable/csvUploader/CsvUploader.js +0 -182
- package/dist/components/composite/agGridTable/csvUploader/index.js +0 -4
|
@@ -30,6 +30,7 @@ import "../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js"
|
|
|
30
30
|
import "../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
31
31
|
import "mui-nested-menu";
|
|
32
32
|
import "react-resizable-panels";
|
|
33
|
+
import "react-papaparse";
|
|
33
34
|
import { useVoltageInitParametersForm } from "./use-voltage-init-parameters-form.js";
|
|
34
35
|
import { VoltageInitParametersForm } from "./voltage-init-parameters-form.js";
|
|
35
36
|
function VoltageInitParametersEditionDialog({
|
|
@@ -28,6 +28,7 @@ import "../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
|
28
28
|
import "../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
29
29
|
import "mui-nested-menu";
|
|
30
30
|
import "react-resizable-panels";
|
|
31
|
+
import "react-papaparse";
|
|
31
32
|
import { TabPanel } from "../common/parameters.js";
|
|
32
33
|
import "../common/widget/parameter-line-slider.js";
|
|
33
34
|
import "../common/limitreductions/columns-definitions.js";
|
|
@@ -33,6 +33,7 @@ import "../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
|
33
33
|
import "../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
34
34
|
import "mui-nested-menu";
|
|
35
35
|
import "react-resizable-panels";
|
|
36
|
+
import "react-papaparse";
|
|
36
37
|
import "../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
37
38
|
import { LabelledButton } from "../common/parameters.js";
|
|
38
39
|
import { CreateParameterDialog } from "../common/parameters-creation-dialog.js";
|
|
@@ -34,6 +34,7 @@ import "../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
|
34
34
|
import "../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
35
35
|
import "mui-nested-menu";
|
|
36
36
|
import "react-resizable-panels";
|
|
37
|
+
import "react-papaparse";
|
|
37
38
|
import { ParameterTableField } from "../common/parameter-table-field/parameter-table-field.js";
|
|
38
39
|
function VoltageLimitsParameters() {
|
|
39
40
|
const intl = useIntl();
|
package/dist/index.js
CHANGED
|
@@ -69,6 +69,7 @@ import { ResizeHandle } from "./components/ui/resizablePanels/ResizeHandle.js";
|
|
|
69
69
|
import { CsvExport } from "./components/ui/csvDownloader/csv-export.js";
|
|
70
70
|
import { ExportCsvButton } from "./components/ui/csvDownloader/export-csv-button.js";
|
|
71
71
|
import { fetchCsvSeparator, useCsvExport } from "./components/ui/csvDownloader/use-csv-export.js";
|
|
72
|
+
import { CsvPicker } from "./components/ui/csvPicker/csv-picker.js";
|
|
72
73
|
import { TreeViewFinder, generateTreeViewFinderClass } from "./components/ui/treeViewFinder/TreeViewFinder.js";
|
|
73
74
|
import { doesNodeHasChildren } from "./components/ui/treeViewFinder/TreeViewUtils.js";
|
|
74
75
|
import { DirectoryItemSelector } from "./components/ui/directoryItemSelector/DirectoryItemSelector.js";
|
|
@@ -117,10 +118,9 @@ import { GroupValueEditor } from "./components/composite/reactQueryBuilder/compo
|
|
|
117
118
|
import { RuleValueEditor } from "./components/composite/reactQueryBuilder/compositeRuleEditor/RuleValueEditor.js";
|
|
118
119
|
import { useConvertValue } from "./components/composite/reactQueryBuilder/hooks/useConvertValue.js";
|
|
119
120
|
import { useValid } from "./components/composite/reactQueryBuilder/hooks/useValid.js";
|
|
120
|
-
import {
|
|
121
|
+
import { BottomTableButtons } from "./components/composite/agGridTable/BottomTableButtons.js";
|
|
121
122
|
import { CustomAgGridTable } from "./components/composite/agGridTable/CustomAgGridTable.js";
|
|
122
|
-
import { NumericEditor } from "./components/composite/agGridTable/cellEditors/numericEditor.js";
|
|
123
|
-
import { CsvUploader } from "./components/composite/agGridTable/csvUploader/CsvUploader.js";
|
|
123
|
+
import { NumericEditor, suppressNonNumericKeyboardEvent } from "./components/composite/agGridTable/cellEditors/numericEditor.js";
|
|
124
124
|
import { CUSTOM_AGGRID_THEME, styles } from "./components/composite/customAGGrid/customAggrid.style.js";
|
|
125
125
|
import { CustomAGGrid } from "./components/composite/customAGGrid/customAggrid.js";
|
|
126
126
|
import { SeparatorCellRenderer } from "./components/composite/customAGGrid/separatorCellRenderer.js";
|
|
@@ -237,7 +237,7 @@ import { substationModificationDtoToForm, substationModificationEmptyFormData, s
|
|
|
237
237
|
import { SwitchesBetweenSections } from "./features/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/SwitchesBetweenSections.js";
|
|
238
238
|
import "react";
|
|
239
239
|
import "react-hook-form";
|
|
240
|
-
import { equalsArray } from "./utils/algos.js";
|
|
240
|
+
import { equalsArray, equalsArrayAnyOrder } from "./utils/algos.js";
|
|
241
241
|
import { ActivePowerAdornment, AmpereAdornment, KiloAmpereAdornment, KilometerAdornment, MVAPowerAdornment, MicroSusceptanceAdornment, OhmAdornment, PercentageAdornment, ReactivePowerAdornment, SusceptanceAdornment, VoltageAdornment } from "./utils/constants/adornments.js";
|
|
242
242
|
import { FetchStatus } from "./utils/constants/fetchStatus.js";
|
|
243
243
|
import { FieldConstants } from "./utils/constants/fieldConstants.js";
|
|
@@ -248,9 +248,9 @@ import { FILTERS, FILTER_ID, FILTER_NAME, ID } from "./utils/constants/filterCon
|
|
|
248
248
|
import { DUPLICATED_PROPS_ERROR, YUP_DEFAULT, YUP_NOT_NULL, YUP_NOT_TYPE_DEFAULT, YUP_NOT_TYPE_NUMBER, YUP_POSITIVE, YUP_REQUIRED } from "./utils/constants/translationKeys.js";
|
|
249
249
|
import { GRIDSUITE_DEFAULT_PRECISION, convertInputValue, convertOutputValue, isBlankOrEmpty, kiloUnitToUnit, microUnitToUnit, roundToDefaultPrecision, roundToPrecision, toModificationOperation, unitToKiloUnit, unitToMicroUnit } from "./utils/conversionUtils.js";
|
|
250
250
|
import { catchErrorHandler, extractErrorMessageDescriptor, snackWithFallback } from "./utils/error.js";
|
|
251
|
-
import { areArrayElementsUnique, arraysContainIdenticalStrings, isEmpty, isObjectEmpty, keyGenerator } from "./utils/functions.js";
|
|
251
|
+
import { areArrayElementsUnique, arraysContainIdenticalStrings, hasNonEmptyRows, isEmpty, isObjectEmpty, keyGenerator } from "./utils/functions.js";
|
|
252
252
|
import { getEquipmentTypeShortLabel } from "./utils/labelUtils.js";
|
|
253
|
-
import { LANG_ENGLISH, LANG_FRENCH, LANG_SYSTEM } from "./utils/langs.js";
|
|
253
|
+
import { LANG_ENGLISH, LANG_FRENCH, LANG_SYSTEM, getCsvDelimiter } from "./utils/langs.js";
|
|
254
254
|
import { getFileIcon } from "./utils/mapper/getFileIcon.js";
|
|
255
255
|
import { equipmentTypesForPredefinedPropertiesMapper } from "./utils/mapper/equipmentTypesForPredefinedPropertiesMapper.js";
|
|
256
256
|
import { copyToClipboard } from "./utils/navigator-clipboard.js";
|
|
@@ -472,7 +472,7 @@ export {
|
|
|
472
472
|
BooleanCellRenderer,
|
|
473
473
|
BooleanInput,
|
|
474
474
|
BooleanNullableCellRenderer,
|
|
475
|
-
|
|
475
|
+
BottomTableButtons,
|
|
476
476
|
BoundaryLine,
|
|
477
477
|
BranchActiveReactivePowerMeasurementsForm,
|
|
478
478
|
BranchConnectivityForm,
|
|
@@ -529,7 +529,7 @@ export {
|
|
|
529
529
|
CountryValueEditor,
|
|
530
530
|
CreateParameterDialog,
|
|
531
531
|
CsvExport,
|
|
532
|
-
|
|
532
|
+
CsvPicker,
|
|
533
533
|
CustomAGGrid,
|
|
534
534
|
CustomAgGridTable,
|
|
535
535
|
CustomError,
|
|
@@ -1067,6 +1067,7 @@ export {
|
|
|
1067
1067
|
enrichSecurityAnalysisParameters,
|
|
1068
1068
|
enrichSensitivityAnalysisParameters,
|
|
1069
1069
|
equalsArray,
|
|
1070
|
+
equalsArrayAnyOrder,
|
|
1070
1071
|
equipmentDeletionDtoToForm,
|
|
1071
1072
|
equipmentDeletionEmptyFormData,
|
|
1072
1073
|
equipmentDeletionFormSchema,
|
|
@@ -1187,6 +1188,7 @@ export {
|
|
|
1187
1188
|
getContingencyListsInfosFormSchema,
|
|
1188
1189
|
getCreateSwitchesEmptyFormData,
|
|
1189
1190
|
getCreateSwitchesValidationSchema,
|
|
1191
|
+
getCsvDelimiter,
|
|
1190
1192
|
getDefaultRowData,
|
|
1191
1193
|
getDynamicMappings,
|
|
1192
1194
|
getEnergySourceLabel,
|
|
@@ -1269,6 +1271,7 @@ export {
|
|
|
1269
1271
|
handleSigninCallback,
|
|
1270
1272
|
handleSilentRenewCallback,
|
|
1271
1273
|
hasElementPermission,
|
|
1274
|
+
hasNonEmptyRows,
|
|
1272
1275
|
identity,
|
|
1273
1276
|
importExpertRules,
|
|
1274
1277
|
importParamsEn,
|
|
@@ -1383,6 +1386,7 @@ export {
|
|
|
1383
1386
|
substationModificationEmptyFormData,
|
|
1384
1387
|
substationModificationFormSchema,
|
|
1385
1388
|
substationModificationFormToDto,
|
|
1389
|
+
suppressNonNumericKeyboardEvent,
|
|
1386
1390
|
default2 as svg,
|
|
1387
1391
|
tableEn,
|
|
1388
1392
|
tableFr,
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
6
|
*/
|
|
7
7
|
export declare const csvEn: {
|
|
8
|
-
ImportCSV: string;
|
|
9
8
|
noDataInCsvFile: string;
|
|
10
9
|
wrongCsvHeadersError: string;
|
|
11
10
|
keepCSVDataMessage: string;
|
|
12
11
|
GenerateCSV: string;
|
|
12
|
+
DownloadCSV: string;
|
|
13
13
|
UploadCSV: string;
|
|
14
14
|
uploadMessage: string;
|
|
15
|
+
tooManyLinesInCsvFile: string;
|
|
15
16
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
const csvEn = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
wrongCsvHeadersError: "This CSV file has the wrong headers. Use Generate CSV template button to get supported CSV format",
|
|
2
|
+
noDataInCsvFile: "No data found in file ''{filename}''",
|
|
3
|
+
wrongCsvHeadersError: "The file ''{filename}'' has the wrong headers. Use Generate CSV template button to get supported CSV format",
|
|
5
4
|
keepCSVDataMessage: "Do you want to replace or add the new data to the current list ?",
|
|
6
5
|
GenerateCSV: "Generate CSV template",
|
|
6
|
+
DownloadCSV: "Download CSV",
|
|
7
7
|
UploadCSV: "Upload CSV",
|
|
8
|
-
uploadMessage: " No file selected"
|
|
8
|
+
uploadMessage: " No file selected",
|
|
9
|
+
tooManyLinesInCsvFile: "The number of lines in file ''{filename}'' must not exceed {value}"
|
|
9
10
|
};
|
|
10
11
|
export {
|
|
11
12
|
csvEn
|
|
@@ -179,6 +179,8 @@ export declare const networkModificationsEn: {
|
|
|
179
179
|
MaximumActivePowerText: string;
|
|
180
180
|
ActivePowerSetPointText: string;
|
|
181
181
|
ReactivePowerSetPointText: string;
|
|
182
|
+
ReactivePowerMeasurementValue: string;
|
|
183
|
+
ReactivePowerMeasurementValidity: string;
|
|
182
184
|
GeneratorTargetV: string;
|
|
183
185
|
PlannedActivePowerSetPointForm: string;
|
|
184
186
|
MarginalCost: string;
|
|
@@ -184,6 +184,8 @@ const networkModificationsEn = {
|
|
|
184
184
|
MaximumActivePowerText: "Maximum active power",
|
|
185
185
|
ActivePowerSetPointText: "Active power setpoint",
|
|
186
186
|
ReactivePowerSetPointText: "Reactive power setpoint",
|
|
187
|
+
ReactivePowerMeasurementValue: "Reactive power measurement value",
|
|
188
|
+
ReactivePowerMeasurementValidity: "Reactive power measurement validity",
|
|
187
189
|
GeneratorTargetV: "Target V",
|
|
188
190
|
PlannedActivePowerSetPointForm: "Planning active power set point",
|
|
189
191
|
MarginalCost: "Generation dispatch cost",
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
6
|
*/
|
|
7
7
|
export declare const csvFr: {
|
|
8
|
-
ImportCSV: string;
|
|
9
8
|
noDataInCsvFile: string;
|
|
10
9
|
wrongCsvHeadersError: string;
|
|
11
10
|
keepCSVDataMessage: string;
|
|
12
11
|
GenerateCSV: string;
|
|
12
|
+
DownloadCSV: string;
|
|
13
13
|
UploadCSV: string;
|
|
14
14
|
uploadMessage: string;
|
|
15
|
+
tooManyLinesInCsvFile: string;
|
|
15
16
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
const csvFr = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
wrongCsvHeadersError: "Les en-têtes du fichier CSV sont incorrects. Utilisez le bouton Générer le modèle CSV pour obtenir le format CSV pris en charge",
|
|
2
|
+
noDataInCsvFile: 'Aucune donnée trouvée dans le fichier "{filename}"',
|
|
3
|
+
wrongCsvHeadersError: 'Les en-têtes du fichier "{filename}" sont incorrects. Utilisez le bouton Générer le modèle CSV pour obtenir le format CSV pris en charge',
|
|
5
4
|
keepCSVDataMessage: "Voulez-vous remplacer la liste existante ou y ajouter les nouvelles données ?",
|
|
6
5
|
GenerateCSV: "Générer le modèle CSV",
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
DownloadCSV: "Télécharger en CSV",
|
|
7
|
+
UploadCSV: "Charger un CSV",
|
|
8
|
+
uploadMessage: " Aucun fichier sélectionné",
|
|
9
|
+
tooManyLinesInCsvFile: 'Le nombre de lignes dans le fichier "{filename}" ne doit pas dépasser {value}'
|
|
9
10
|
};
|
|
10
11
|
export {
|
|
11
12
|
csvFr
|
|
@@ -179,6 +179,8 @@ export declare const networkModificationsFr: {
|
|
|
179
179
|
MaximumActivePowerText: string;
|
|
180
180
|
ActivePowerSetPointText: string;
|
|
181
181
|
ReactivePowerSetPointText: string;
|
|
182
|
+
ReactivePowerMeasurementValue: string;
|
|
183
|
+
ReactivePowerMeasurementValidity: string;
|
|
182
184
|
GeneratorTargetV: string;
|
|
183
185
|
PlannedActivePowerSetPointForm: string;
|
|
184
186
|
MarginalCost: string;
|
|
@@ -184,6 +184,8 @@ const networkModificationsFr = {
|
|
|
184
184
|
MaximumActivePowerText: "Puissance active max",
|
|
185
185
|
ActivePowerSetPointText: "Consigne de puissance active",
|
|
186
186
|
ReactivePowerSetPointText: "Consigne de puissance réactive",
|
|
187
|
+
ReactivePowerMeasurementValue: "Valeur TM puissance réactive",
|
|
188
|
+
ReactivePowerMeasurementValidity: "Validité TM puissance réactive",
|
|
187
189
|
GeneratorTargetV: "Consigne tension",
|
|
188
190
|
PlannedActivePowerSetPointForm: "Puissance imposée",
|
|
189
191
|
MarginalCost: "Coût de démarrage",
|
package/dist/utils/algos.d.ts
CHANGED
package/dist/utils/algos.js
CHANGED
|
@@ -21,6 +21,18 @@ function equalsArray(a, b) {
|
|
|
21
21
|
}
|
|
22
22
|
return true;
|
|
23
23
|
}
|
|
24
|
+
function equalsArrayAnyOrder(a, b) {
|
|
25
|
+
if (a === b) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
if (!a || !b || a.length !== b.length) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
const sortedA = [...a].sort();
|
|
32
|
+
const sortedB = [...b].sort();
|
|
33
|
+
return sortedA.every((value, index) => value === sortedB[index]);
|
|
34
|
+
}
|
|
24
35
|
export {
|
|
25
|
-
equalsArray
|
|
36
|
+
equalsArray,
|
|
37
|
+
equalsArrayAnyOrder
|
|
26
38
|
};
|
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
5
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
6
|
*/
|
|
7
|
+
/**
|
|
8
|
+
* Returns true when the given form rows contain at least one cell with a
|
|
9
|
+
* non-empty value (excluding the AG_GRID_ROW_UUID identifier column).
|
|
10
|
+
*/
|
|
11
|
+
export declare const hasNonEmptyRows: (rows: unknown) => boolean;
|
|
7
12
|
/**
|
|
8
13
|
* function to generate a key
|
|
9
14
|
* @returns {number} key
|
package/dist/utils/functions.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { FieldConstants } from "./constants/fieldConstants.js";
|
|
2
|
+
const hasNonEmptyRows = (rows) => Array.isArray(rows) && rows.some(
|
|
3
|
+
(row) => row && Object.keys(row).filter((key) => key !== FieldConstants.AG_GRID_ROW_UUID).some((key) => row[key] !== void 0 && row[key] !== null && String(row[key]).trim().length > 0)
|
|
4
|
+
);
|
|
1
5
|
function keyGenerator() {
|
|
2
6
|
let key = 1;
|
|
3
7
|
return () => {
|
|
@@ -19,6 +23,7 @@ const isObjectEmpty = (object) => object && Object.keys(object).length === 0;
|
|
|
19
23
|
export {
|
|
20
24
|
areArrayElementsUnique,
|
|
21
25
|
arraysContainIdenticalStrings,
|
|
26
|
+
hasNonEmptyRows,
|
|
22
27
|
isEmpty,
|
|
23
28
|
isObjectEmpty,
|
|
24
29
|
keyGenerator
|
package/dist/utils/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { equalsArray } from "./algos.js";
|
|
1
|
+
import { equalsArray, equalsArrayAnyOrder } from "./algos.js";
|
|
2
2
|
import { ActivePowerAdornment, AmpereAdornment, KiloAmpereAdornment, KilometerAdornment, MVAPowerAdornment, MicroSusceptanceAdornment, OhmAdornment, PercentageAdornment, ReactivePowerAdornment, SusceptanceAdornment, VoltageAdornment } from "./constants/adornments.js";
|
|
3
3
|
import { FetchStatus } from "./constants/fetchStatus.js";
|
|
4
4
|
import { FieldConstants } from "./constants/fieldConstants.js";
|
|
@@ -9,9 +9,9 @@ import { FILTERS, FILTER_ID, FILTER_NAME, ID } from "./constants/filterConstant.
|
|
|
9
9
|
import { DUPLICATED_PROPS_ERROR, YUP_DEFAULT, YUP_NOT_NULL, YUP_NOT_TYPE_DEFAULT, YUP_NOT_TYPE_NUMBER, YUP_POSITIVE, YUP_REQUIRED } from "./constants/translationKeys.js";
|
|
10
10
|
import { GRIDSUITE_DEFAULT_PRECISION, convertInputValue, convertOutputValue, isBlankOrEmpty, kiloUnitToUnit, microUnitToUnit, roundToDefaultPrecision, roundToPrecision, toModificationOperation, unitToKiloUnit, unitToMicroUnit } from "./conversionUtils.js";
|
|
11
11
|
import { catchErrorHandler, extractErrorMessageDescriptor, snackWithFallback } from "./error.js";
|
|
12
|
-
import { areArrayElementsUnique, arraysContainIdenticalStrings, isEmpty, isObjectEmpty, keyGenerator } from "./functions.js";
|
|
12
|
+
import { areArrayElementsUnique, arraysContainIdenticalStrings, hasNonEmptyRows, isEmpty, isObjectEmpty, keyGenerator } from "./functions.js";
|
|
13
13
|
import { getEquipmentTypeShortLabel } from "./labelUtils.js";
|
|
14
|
-
import { LANG_ENGLISH, LANG_FRENCH, LANG_SYSTEM } from "./langs.js";
|
|
14
|
+
import { LANG_ENGLISH, LANG_FRENCH, LANG_SYSTEM, getCsvDelimiter } from "./langs.js";
|
|
15
15
|
import { getFileIcon } from "./mapper/getFileIcon.js";
|
|
16
16
|
import { equipmentTypesForPredefinedPropertiesMapper } from "./mapper/equipmentTypesForPredefinedPropertiesMapper.js";
|
|
17
17
|
import { copyToClipboard } from "./navigator-clipboard.js";
|
|
@@ -150,10 +150,12 @@ export {
|
|
|
150
150
|
convertOutputValue,
|
|
151
151
|
copyToClipboard,
|
|
152
152
|
equalsArray,
|
|
153
|
+
equalsArrayAnyOrder,
|
|
153
154
|
equipmentStyles,
|
|
154
155
|
equipmentTypesForPredefinedPropertiesMapper,
|
|
155
156
|
extractErrorMessageDescriptor,
|
|
156
157
|
getConnectionDirectionLabel,
|
|
158
|
+
getCsvDelimiter,
|
|
157
159
|
getEnergySourceLabel,
|
|
158
160
|
getEquipmentTypeShortLabel,
|
|
159
161
|
getEquipmentsInfosForSearchBar,
|
|
@@ -163,6 +165,7 @@ export {
|
|
|
163
165
|
getLabelOrValue,
|
|
164
166
|
getLoadTypeLabel,
|
|
165
167
|
getObjectId,
|
|
168
|
+
hasNonEmptyRows,
|
|
166
169
|
isBlankOrEmpty,
|
|
167
170
|
isEmpty,
|
|
168
171
|
isInjection,
|
package/dist/utils/langs.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export declare const LANG_ENGLISH = "en";
|
|
|
3
3
|
export declare const LANG_FRENCH = "fr";
|
|
4
4
|
export type GsLangUser = typeof LANG_ENGLISH | typeof LANG_FRENCH;
|
|
5
5
|
export type GsLang = GsLangUser | typeof LANG_SYSTEM;
|
|
6
|
+
export declare function getCsvDelimiter(language: string | undefined): ';' | ',';
|
package/dist/utils/langs.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
const LANG_SYSTEM = "sys";
|
|
2
2
|
const LANG_ENGLISH = "en";
|
|
3
3
|
const LANG_FRENCH = "fr";
|
|
4
|
+
function getCsvDelimiter(language) {
|
|
5
|
+
return language === LANG_FRENCH ? ";" : ",";
|
|
6
|
+
}
|
|
4
7
|
export {
|
|
5
8
|
LANG_ENGLISH,
|
|
6
9
|
LANG_FRENCH,
|
|
7
|
-
LANG_SYSTEM
|
|
10
|
+
LANG_SYSTEM,
|
|
11
|
+
getCsvDelimiter
|
|
8
12
|
};
|
|
@@ -14,6 +14,7 @@ export declare enum ElementType {
|
|
|
14
14
|
FILTER = "FILTER",
|
|
15
15
|
MODIFICATION = "MODIFICATION",
|
|
16
16
|
CONTINGENCY_LIST = "CONTINGENCY_LIST",
|
|
17
|
+
DYNAMIC_SIMULATION_MAPPING = "DYNAMIC_SIMULATION_MAPPING",
|
|
17
18
|
VOLTAGE_INIT_PARAMETERS = "VOLTAGE_INIT_PARAMETERS",
|
|
18
19
|
SECURITY_ANALYSIS_PARAMETERS = "SECURITY_ANALYSIS_PARAMETERS",
|
|
19
20
|
PCC_MIN_PARAMETERS = "PCC_MIN_PARAMETERS",
|
|
@@ -5,6 +5,7 @@ var ElementType = /* @__PURE__ */ ((ElementType2) => {
|
|
|
5
5
|
ElementType2["FILTER"] = "FILTER";
|
|
6
6
|
ElementType2["MODIFICATION"] = "MODIFICATION";
|
|
7
7
|
ElementType2["CONTINGENCY_LIST"] = "CONTINGENCY_LIST";
|
|
8
|
+
ElementType2["DYNAMIC_SIMULATION_MAPPING"] = "DYNAMIC_SIMULATION_MAPPING";
|
|
8
9
|
ElementType2["VOLTAGE_INIT_PARAMETERS"] = "VOLTAGE_INIT_PARAMETERS";
|
|
9
10
|
ElementType2["SECURITY_ANALYSIS_PARAMETERS"] = "SECURITY_ANALYSIS_PARAMETERS";
|
|
10
11
|
ElementType2["PCC_MIN_PARAMETERS"] = "PCC_MIN_PARAMETERS";
|
|
@@ -125,6 +125,8 @@ export declare enum FieldType {
|
|
|
125
125
|
VOLTAGE_SET_POINT = "VOLTAGE_SET_POINT",
|
|
126
126
|
ACTIVE_POWER_SET_POINT = "ACTIVE_POWER_SET_POINT",
|
|
127
127
|
REACTIVE_POWER_SET_POINT = "REACTIVE_POWER_SET_POINT",
|
|
128
|
+
REACTIVE_POWER_MEASUREMENT_VALUE = "REACTIVE_POWER_MEASUREMENT_VALUE",
|
|
129
|
+
REACTIVE_POWER_MEASUREMENT_VALIDITY = "REACTIVE_POWER_MEASUREMENT_VALIDITY",
|
|
128
130
|
REMOTE_REGULATED_TERMINAL = "REMOTE_REGULATED_TERMINAL",
|
|
129
131
|
REGULATING_TERMINAL_VL_ID = "REGULATING_TERMINAL_VL_ID",
|
|
130
132
|
REGULATING_TERMINAL_CONNECTABLE_ID = "REGULATING_TERMINAL_CONNECTABLE_ID",
|
|
@@ -119,6 +119,8 @@ var FieldType = /* @__PURE__ */ ((FieldType2) => {
|
|
|
119
119
|
FieldType2["VOLTAGE_SET_POINT"] = "VOLTAGE_SET_POINT";
|
|
120
120
|
FieldType2["ACTIVE_POWER_SET_POINT"] = "ACTIVE_POWER_SET_POINT";
|
|
121
121
|
FieldType2["REACTIVE_POWER_SET_POINT"] = "REACTIVE_POWER_SET_POINT";
|
|
122
|
+
FieldType2["REACTIVE_POWER_MEASUREMENT_VALUE"] = "REACTIVE_POWER_MEASUREMENT_VALUE";
|
|
123
|
+
FieldType2["REACTIVE_POWER_MEASUREMENT_VALIDITY"] = "REACTIVE_POWER_MEASUREMENT_VALIDITY";
|
|
122
124
|
FieldType2["REMOTE_REGULATED_TERMINAL"] = "REMOTE_REGULATED_TERMINAL";
|
|
123
125
|
FieldType2["REGULATING_TERMINAL_VL_ID"] = "REGULATING_TERMINAL_VL_ID";
|
|
124
126
|
FieldType2["REGULATING_TERMINAL_CONNECTABLE_ID"] = "REGULATING_TERMINAL_CONNECTABLE_ID";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridsuite/commons-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.229.0",
|
|
4
4
|
"description": "common react components for gridsuite applications",
|
|
5
5
|
"author": "gridsuite team",
|
|
6
6
|
"homepage": "https://github.com/gridsuite",
|
|
@@ -58,7 +58,6 @@
|
|
|
58
58
|
"mui-nested-menu": "^4.0.1",
|
|
59
59
|
"oidc-client-ts": "^3.5.0",
|
|
60
60
|
"prop-types": "^15.8.1",
|
|
61
|
-
"react-csv-downloader": "^3.3.0",
|
|
62
61
|
"react-dnd": "^16.0.1",
|
|
63
62
|
"react-dnd-html5-backend": "^16.0.1",
|
|
64
63
|
"react-querybuilder": "^8.11.0",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FieldValues, UseFieldArrayReturn } from 'react-hook-form';
|
|
2
|
-
export interface BottomRightButtonsProps {
|
|
3
|
-
name: string;
|
|
4
|
-
disableUp: boolean;
|
|
5
|
-
disableDown: boolean;
|
|
6
|
-
disableDelete: boolean;
|
|
7
|
-
handleAddRow: () => void;
|
|
8
|
-
handleDeleteRows: () => void;
|
|
9
|
-
handleMoveRowUp: () => void;
|
|
10
|
-
handleMoveRowDown: () => void;
|
|
11
|
-
useFieldArrayOutput: UseFieldArrayReturn<FieldValues, string, 'id'>;
|
|
12
|
-
csvProps: any;
|
|
13
|
-
}
|
|
14
|
-
export declare function BottomRightButtons({ name, disableUp, disableDown, disableDelete, handleAddRow, handleDeleteRows, handleMoveRowUp, handleMoveRowDown, useFieldArrayOutput, csvProps, }: BottomRightButtonsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { styled, IconButton, Grid, Box } from "@mui/material";
|
|
3
|
-
import { Upload, ControlPoint, Delete, ArrowCircleUp, ArrowCircleDown } from "@mui/icons-material";
|
|
4
|
-
import { useState } from "react";
|
|
5
|
-
import { useIntl } from "react-intl";
|
|
6
|
-
import { CustomTooltip } from "../../ui/tooltip/CustomTooltip.js";
|
|
7
|
-
import { ErrorInput } from "../../ui/reactHookForm/errorManagement/ErrorInput.js";
|
|
8
|
-
import { FieldErrorAlert } from "../../ui/reactHookForm/errorManagement/FieldErrorAlert.js";
|
|
9
|
-
import { CsvUploader } from "./csvUploader/CsvUploader.js";
|
|
10
|
-
const InnerColoredButton = styled(IconButton)(({ theme }) => {
|
|
11
|
-
return {
|
|
12
|
-
color: theme.palette.primary.main
|
|
13
|
-
};
|
|
14
|
-
});
|
|
15
|
-
function BottomRightButtons({
|
|
16
|
-
name,
|
|
17
|
-
disableUp,
|
|
18
|
-
disableDown,
|
|
19
|
-
disableDelete,
|
|
20
|
-
handleAddRow,
|
|
21
|
-
handleDeleteRows,
|
|
22
|
-
handleMoveRowUp,
|
|
23
|
-
handleMoveRowDown,
|
|
24
|
-
useFieldArrayOutput,
|
|
25
|
-
csvProps
|
|
26
|
-
}) {
|
|
27
|
-
const [uploaderOpen, setUploaderOpen] = useState(false);
|
|
28
|
-
const intl = useIntl();
|
|
29
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
30
|
-
/* @__PURE__ */ jsxs(Grid, { container: true, paddingTop: 1, paddingLeft: 2, children: [
|
|
31
|
-
/* @__PURE__ */ jsx(Grid, { item: true, xs: 1, children: csvProps && /* @__PURE__ */ jsx(InnerColoredButton, { onClick: () => setUploaderOpen(true), children: /* @__PURE__ */ jsx(
|
|
32
|
-
CustomTooltip,
|
|
33
|
-
{
|
|
34
|
-
title: intl.formatMessage({
|
|
35
|
-
id: "ImportCSV"
|
|
36
|
-
}),
|
|
37
|
-
children: /* @__PURE__ */ jsx(Upload, {})
|
|
38
|
-
}
|
|
39
|
-
) }) }),
|
|
40
|
-
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 11, sx: { display: "flex", justifyContent: "right" }, children: [
|
|
41
|
-
/* @__PURE__ */ jsx(InnerColoredButton, { onClick: handleAddRow, children: /* @__PURE__ */ jsx(ControlPoint, {}) }, "addButton"),
|
|
42
|
-
/* @__PURE__ */ jsx(InnerColoredButton, { onClick: handleDeleteRows, disabled: disableDelete, children: /* @__PURE__ */ jsx(Delete, {}) }, "DeleteButton"),
|
|
43
|
-
/* @__PURE__ */ jsx(InnerColoredButton, { disabled: disableUp, onClick: handleMoveRowUp, children: /* @__PURE__ */ jsx(ArrowCircleUp, {}) }, "upButton"),
|
|
44
|
-
/* @__PURE__ */ jsx(InnerColoredButton, { disabled: disableDown, onClick: handleMoveRowDown, children: /* @__PURE__ */ jsx(ArrowCircleDown, {}) }, "downButton")
|
|
45
|
-
] })
|
|
46
|
-
] }),
|
|
47
|
-
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(ErrorInput, { name, InputField: FieldErrorAlert }) }),
|
|
48
|
-
/* @__PURE__ */ jsx(
|
|
49
|
-
CsvUploader,
|
|
50
|
-
{
|
|
51
|
-
open: uploaderOpen,
|
|
52
|
-
onClose: () => setUploaderOpen(false),
|
|
53
|
-
name,
|
|
54
|
-
useFieldArrayOutput,
|
|
55
|
-
...csvProps
|
|
56
|
-
}
|
|
57
|
-
)
|
|
58
|
-
] });
|
|
59
|
-
}
|
|
60
|
-
export {
|
|
61
|
-
BottomRightButtons
|
|
62
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { GsLang } from '../../../../utils';
|
|
2
|
-
export interface CsvUploaderProps {
|
|
3
|
-
name: string;
|
|
4
|
-
onClose: () => void;
|
|
5
|
-
open: boolean;
|
|
6
|
-
title: string[];
|
|
7
|
-
fileHeaders: string[];
|
|
8
|
-
fileName: string;
|
|
9
|
-
csvData: unknown;
|
|
10
|
-
validateData: (rows: string[][]) => boolean;
|
|
11
|
-
getDataFromCsv: any;
|
|
12
|
-
useFieldArrayOutput: any;
|
|
13
|
-
language: GsLang;
|
|
14
|
-
}
|
|
15
|
-
export declare function CsvUploader({ name, onClose, open, title, fileHeaders, fileName, csvData, validateData, getDataFromCsv, useFieldArrayOutput, language, }: Readonly<CsvUploaderProps>): import("react/jsx-runtime").JSX.Element;
|