@gridsuite/commons-ui 0.202.0 → 0.203.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/addButton/AddButton.d.ts +10 -0
- package/dist/components/addButton/AddButton.js +16 -0
- package/dist/components/addButton/index.d.ts +1 -0
- package/dist/components/addButton/index.js +5 -0
- package/dist/components/cardErrorBoundary/CardErrorBoundary.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +36 -1
- package/dist/components/inputs/index.js +0 -2
- package/dist/components/inputs/reactHookForm/expandableInput/ExpandableInput.js +3 -28
- package/dist/components/inputs/reactHookForm/text/DescriptionField.js +4 -4
- package/dist/components/inputs/reactQueryBuilder/index.d.ts +0 -1
- package/dist/components/inputs/reactQueryBuilder/index.js +0 -2
- package/dist/components/network-modifications/common/activePowerControl/ActivePowerControlForm.d.ts +6 -0
- package/dist/components/network-modifications/common/activePowerControl/ActivePowerControlForm.js +97 -0
- package/dist/components/network-modifications/common/activePowerControl/activePowerControlForm.type.d.ts +10 -0
- package/dist/components/network-modifications/common/activePowerControl/activePowerControlForm.type.js +1 -0
- package/dist/components/network-modifications/common/activePowerControl/activePowerControlForm.utils.d.ts +8 -0
- package/dist/components/network-modifications/common/activePowerControl/activePowerControlForm.utils.js +26 -0
- package/dist/components/network-modifications/common/activePowerControl/index.d.ts +9 -0
- package/dist/components/network-modifications/common/activePowerControl/index.js +7 -0
- package/dist/components/network-modifications/common/connectivity/BranchConnectivityForm.js +0 -2
- package/dist/components/network-modifications/common/connectivity/ConnectivityForm.d.ts +9 -17
- package/dist/components/network-modifications/common/connectivity/ConnectivityForm.js +56 -219
- package/dist/components/network-modifications/common/connectivity/PositionForm.d.ts +11 -0
- package/dist/components/network-modifications/common/connectivity/PositionForm.js +111 -0
- package/dist/components/network-modifications/common/connectivity/VoltageLevelConnectivityForm.d.ts +13 -0
- package/dist/components/network-modifications/common/connectivity/VoltageLevelConnectivityForm.js +164 -0
- package/dist/components/network-modifications/common/connectivity/connectivityForm.utils.js +3 -3
- package/dist/components/network-modifications/common/connectivity/index.d.ts +1 -0
- package/dist/components/network-modifications/common/connectivity/index.js +2 -0
- package/dist/components/network-modifications/common/index.d.ts +3 -0
- package/dist/components/network-modifications/common/index.js +35 -1
- package/dist/components/network-modifications/common/reactiveLimits/ReactiveLimitsForm.d.ts +8 -0
- package/dist/components/network-modifications/common/reactiveLimits/ReactiveLimitsForm.js +102 -0
- package/dist/components/network-modifications/common/reactiveLimits/index.d.ts +10 -0
- package/dist/components/network-modifications/common/reactiveLimits/index.js +23 -0
- package/dist/components/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveRowForm.d.ts +12 -0
- package/dist/components/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveRowForm.js +101 -0
- package/dist/components/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveTableForm.d.ts +10 -0
- package/dist/components/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveTableForm.js +118 -0
- package/dist/components/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/index.d.ts +9 -0
- package/dist/components/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/index.js +15 -0
- package/dist/components/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.d.ts +20 -0
- package/dist/components/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.js +152 -0
- package/dist/components/network-modifications/common/reactiveLimits/reactiveLimits.type.d.ts +21 -0
- package/dist/components/network-modifications/common/reactiveLimits/reactiveLimits.type.js +1 -0
- package/dist/components/network-modifications/common/reactiveLimits/reactiveLimits.utils.d.ts +55 -0
- package/dist/components/network-modifications/common/reactiveLimits/reactiveLimits.utils.js +66 -0
- package/dist/components/network-modifications/common/setpoints/setPoints.utils.js +3 -3
- package/dist/components/network-modifications/common/shortCircuit/ShortCircuitForm.d.ts +5 -0
- package/dist/components/network-modifications/common/shortCircuit/ShortCircuitForm.js +68 -0
- package/dist/components/network-modifications/common/shortCircuit/index.d.ts +9 -0
- package/dist/components/network-modifications/common/shortCircuit/index.js +8 -0
- package/dist/components/network-modifications/common/shortCircuit/shortCircuitForm.type.d.ts +10 -0
- package/dist/components/network-modifications/common/shortCircuit/shortCircuitForm.type.js +1 -0
- package/dist/components/network-modifications/common/shortCircuit/shortCircuitForm.utils.d.ts +15 -0
- package/dist/components/network-modifications/common/shortCircuit/shortCircuitForm.utils.js +37 -0
- package/dist/components/network-modifications/generator/creation/generatorCreation.types.d.ts +40 -0
- package/dist/components/network-modifications/generator/creation/generatorCreation.types.js +1 -0
- package/dist/components/network-modifications/generator/creation/index.d.ts +7 -0
- package/dist/components/network-modifications/generator/creation/index.js +1 -0
- package/dist/components/network-modifications/generator/generatorDialog.type.d.ts +102 -0
- package/dist/components/network-modifications/generator/generatorDialog.type.js +1 -0
- package/dist/components/network-modifications/generator/index.d.ts +9 -0
- package/dist/components/network-modifications/generator/index.js +1 -0
- package/dist/components/network-modifications/generator/modification/generatorModification.types.d.ts +41 -0
- package/dist/components/network-modifications/generator/modification/generatorModification.types.js +1 -0
- package/dist/components/network-modifications/generator/modification/index.d.ts +7 -0
- package/dist/components/network-modifications/generator/modification/index.js +1 -0
- package/dist/components/network-modifications/index.d.ts +1 -0
- package/dist/components/network-modifications/index.js +34 -0
- package/dist/components/network-modifications/load/common/LoadDialogTabsContent.js +0 -1
- package/dist/components/network-modifications/load/creation/loadCreation.utils.js +1 -1
- package/dist/components/network-modifications/voltageLevel/creation/tabs/substationTab/SubstationTab.js +4 -3
- package/dist/components/parameters/common/hook/use-parameters-form.js +1 -1
- package/dist/index.js +36 -1
- package/dist/translations/en/networkModificationsEn.d.ts +26 -0
- package/dist/translations/en/networkModificationsEn.js +26 -0
- package/dist/translations/fr/networkModificationsFr.d.ts +26 -0
- package/dist/translations/fr/networkModificationsFr.js +26 -0
- package/dist/utils/constants/fieldConstants.d.ts +22 -1
- package/dist/utils/constants/fieldConstants.js +22 -1
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ButtonProps } from '@mui/material';
|
|
2
|
+
export declare enum AddButtonMode {
|
|
3
|
+
ADD = "add",
|
|
4
|
+
EDIT = "edit"
|
|
5
|
+
}
|
|
6
|
+
export interface AddButtonProps extends ButtonProps {
|
|
7
|
+
label: string;
|
|
8
|
+
mode?: AddButtonMode;
|
|
9
|
+
}
|
|
10
|
+
export declare function AddButton({ label, mode, ...buttonProps }: Readonly<AddButtonProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "@mui/material";
|
|
3
|
+
import { ControlPoint, Edit } from "@mui/icons-material";
|
|
4
|
+
import { FormattedMessage } from "react-intl";
|
|
5
|
+
var AddButtonMode = /* @__PURE__ */ ((AddButtonMode2) => {
|
|
6
|
+
AddButtonMode2["ADD"] = "add";
|
|
7
|
+
AddButtonMode2["EDIT"] = "edit";
|
|
8
|
+
return AddButtonMode2;
|
|
9
|
+
})(AddButtonMode || {});
|
|
10
|
+
function AddButton({ label, mode = "add", ...buttonProps }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(Button, { startIcon: mode === "add" ? /* @__PURE__ */ jsx(ControlPoint, {}) : /* @__PURE__ */ jsx(Edit, {}), ...buttonProps, children: /* @__PURE__ */ jsx(FormattedMessage, { id: label }) });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
AddButton,
|
|
15
|
+
AddButtonMode
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AddButton';
|
|
@@ -22,6 +22,6 @@ export declare class CardErrorBoundary extends Component<PropsWithChildren<{}>,
|
|
|
22
22
|
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
23
23
|
private handleExpandClick;
|
|
24
24
|
private handleReloadClick;
|
|
25
|
-
render(): string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> |
|
|
25
|
+
render(): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | null | undefined;
|
|
26
26
|
}
|
|
27
27
|
export {};
|
|
@@ -4,6 +4,7 @@
|
|
|
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
|
+
export * from './addButton';
|
|
7
8
|
export * from './announcement';
|
|
8
9
|
export * from './authentication';
|
|
9
10
|
export * from './cardErrorBoundary';
|
package/dist/components/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AddButton, AddButtonMode } from "./addButton/AddButton.js";
|
|
1
2
|
import { AnnouncementBanner } from "./announcement/AnnouncementBanner.js";
|
|
2
3
|
import { AnnouncementNotification } from "./announcement/AnnouncementNotification.js";
|
|
3
4
|
import { useGlobalAnnouncement } from "./announcement/useGlobalAnnouncement.js";
|
|
@@ -106,7 +107,6 @@ import { DESCRIPTION, NAME } from "./inputs/reactHookForm/constants.js";
|
|
|
106
107
|
import { ExpandableInput } from "./inputs/reactHookForm/expandableInput/ExpandableInput.js";
|
|
107
108
|
import { CountrySelectionInput } from "./inputs/reactHookForm/CountrySelectionInput.js";
|
|
108
109
|
import { CheckboxNullableInput } from "./inputs/reactHookForm/CheckboxNullableInput.js";
|
|
109
|
-
import { AddButton } from "./inputs/reactQueryBuilder/AddButton.js";
|
|
110
110
|
import { AutocompleteWithFavorites } from "./inputs/reactQueryBuilder/AutocompleteWithFavorites.js";
|
|
111
111
|
import { CombinatorSelector } from "./inputs/reactQueryBuilder/CombinatorSelector.js";
|
|
112
112
|
import { CountryValueEditor } from "./inputs/reactQueryBuilder/CountryValueEditor.js";
|
|
@@ -207,6 +207,16 @@ import { SetPointsForm } from "./network-modifications/common/setpoints/SetPoint
|
|
|
207
207
|
import { createConnectivityData, getCon1andCon2WithPositionValidationSchema, getConnectivityBusBarSectionData, getConnectivityData, getConnectivityFormData, getConnectivityFormDataProps, getConnectivityPropertiesData, getConnectivityPropertiesEmptyFormData, getConnectivityPropertiesValidationSchema, getConnectivityVoltageLevelData, getConnectivityWithPositionEmptyFormData, getConnectivityWithPositionEmptyFormDataProps, getConnectivityWithPositionSchema, getConnectivityWithPositionValidationSchema, getConnectivityWithoutPositionEmptyFormData, getConnectivityWithoutPositionValidationSchema, getCont1Cont2WithPositionEmptyFormData, getNewVoltageLevelData } from "./network-modifications/common/connectivity/connectivityForm.utils.js";
|
|
208
208
|
import { ConnectivityForm } from "./network-modifications/common/connectivity/ConnectivityForm.js";
|
|
209
209
|
import { BranchConnectivityForm } from "./network-modifications/common/connectivity/BranchConnectivityForm.js";
|
|
210
|
+
import { VoltageLevelConnectivityForm } from "./network-modifications/common/connectivity/VoltageLevelConnectivityForm.js";
|
|
211
|
+
import { getActivePowerControlEmptyFormData, getActivePowerControlSchema } from "./network-modifications/common/activePowerControl/activePowerControlForm.utils.js";
|
|
212
|
+
import { ActivePowerControlForm } from "./network-modifications/common/activePowerControl/ActivePowerControlForm.js";
|
|
213
|
+
import { getShortCircuitEmptyFormData, getShortCircuitFormData, getShortCircuitFormSchema } from "./network-modifications/common/shortCircuit/shortCircuitForm.utils.js";
|
|
214
|
+
import { ShortCircuitForm } from "./network-modifications/common/shortCircuit/ShortCircuitForm.js";
|
|
215
|
+
import { INSERT, REMOVE, getReactiveCapabilityCurveValidationSchema, getRowEmptyFormData, setCurrentReactiveCapabilityCurveTable, setSelectedReactiveLimits, toReactiveCapabilityCurveChoiceForGeneratorCreation, toReactiveCapabilityCurveChoiceForGeneratorModification } from "./network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.js";
|
|
216
|
+
import { ReactiveCapabilityCurveRowForm } from "./network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveRowForm.js";
|
|
217
|
+
import { ReactiveCapabilityCurveTableForm } from "./network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveTableForm.js";
|
|
218
|
+
import { REACTIVE_LIMIT_TYPES, getReactiveLimitsEmptyFormData, getReactiveLimitsFormData, getReactiveLimitsSchema, getReactiveLimitsValidationSchema } from "./network-modifications/common/reactiveLimits/reactiveLimits.utils.js";
|
|
219
|
+
import { ReactiveLimitsForm } from "./network-modifications/common/reactiveLimits/ReactiveLimitsForm.js";
|
|
210
220
|
import { getHvdcLccDeletionSchema } from "./network-modifications/equipmentDeletion/hvdcLccDeletion/hvdcLccDeletion.utils.js";
|
|
211
221
|
import { ShuntCompensatorSelectionForm } from "./network-modifications/equipmentDeletion/hvdcLccDeletion/ShuntCompensatorSelectionForm.js";
|
|
212
222
|
import { useHvdcLccDeletion } from "./network-modifications/equipmentDeletion/hvdcLccDeletion/useHvdcLccDeletion.js";
|
|
@@ -263,7 +273,9 @@ export {
|
|
|
263
273
|
AUTO_EXTENSIBLE_COLUMNS,
|
|
264
274
|
AboutDialog,
|
|
265
275
|
ActivableChip,
|
|
276
|
+
ActivePowerControlForm,
|
|
266
277
|
AddButton,
|
|
278
|
+
AddButtonMode,
|
|
267
279
|
AnnouncementBanner,
|
|
268
280
|
AnnouncementNotification,
|
|
269
281
|
ArrowsOutputIcon,
|
|
@@ -421,6 +433,7 @@ export {
|
|
|
421
433
|
HvdcLccDeletionSpecificForm,
|
|
422
434
|
INJECTIONS_EQUIPMENT_TYPES,
|
|
423
435
|
INJECTION_DISTRIBUTION_TYPES,
|
|
436
|
+
INSERT,
|
|
424
437
|
INTL_LINE_FLOW_MODE_OPTIONS,
|
|
425
438
|
INTL_SUBSTATION_LAYOUT_OPTIONS,
|
|
426
439
|
IST_FORM,
|
|
@@ -544,14 +557,19 @@ export {
|
|
|
544
557
|
RATIO_REGULATION_MODE_OPTIONS,
|
|
545
558
|
RATIO_TAP_CHANGER_POSITION,
|
|
546
559
|
RATIO_TAP_CHANGER_TARGET_V,
|
|
560
|
+
REACTIVE_LIMIT_TYPES,
|
|
547
561
|
REACTIVE_SLACKS_THRESHOLD,
|
|
548
562
|
READ_SLACK_BUS,
|
|
549
563
|
REGULATION_TYPE_OPTIONS,
|
|
564
|
+
REMOVE,
|
|
550
565
|
RULES,
|
|
551
566
|
RadioInput,
|
|
552
567
|
RangeInput,
|
|
553
568
|
RangeType,
|
|
554
569
|
RawReadOnlyInput,
|
|
570
|
+
ReactiveCapabilityCurveRowForm,
|
|
571
|
+
ReactiveCapabilityCurveTableForm,
|
|
572
|
+
ReactiveLimitsForm,
|
|
555
573
|
ReadOnlyInput,
|
|
556
574
|
RemoveButton,
|
|
557
575
|
ResizeHandle,
|
|
@@ -598,6 +616,7 @@ export {
|
|
|
598
616
|
SensitivityAnalysisParametersInline,
|
|
599
617
|
SeparatorCellRenderer,
|
|
600
618
|
SetPointsForm,
|
|
619
|
+
ShortCircuitForm,
|
|
601
620
|
ShortCircuitParametersEditionDialog,
|
|
602
621
|
ShortCircuitParametersInLine,
|
|
603
622
|
ShuntCompensatorSelectionForm,
|
|
@@ -647,6 +666,7 @@ export {
|
|
|
647
666
|
VoltageInitParametersEditionDialog,
|
|
648
667
|
VoltageInitParametersInLine,
|
|
649
668
|
VoltageInitTabValues,
|
|
669
|
+
VoltageLevelConnectivityForm,
|
|
650
670
|
VoltageLevelCreationForm,
|
|
651
671
|
VoltageLevelModificationForm,
|
|
652
672
|
WRITE_SLACK_BUS,
|
|
@@ -694,6 +714,8 @@ export {
|
|
|
694
714
|
formatToComposedModification,
|
|
695
715
|
genHelperError,
|
|
696
716
|
generateTreeViewFinderClass,
|
|
717
|
+
getActivePowerControlEmptyFormData,
|
|
718
|
+
getActivePowerControlSchema,
|
|
697
719
|
getActivePowerSetPointSchema,
|
|
698
720
|
getBranchActiveReactivePowerEditData,
|
|
699
721
|
getBranchActiveReactivePowerEditDataProperties,
|
|
@@ -742,9 +764,18 @@ export {
|
|
|
742
764
|
getPropertiesFromModification,
|
|
743
765
|
getPropertyValue,
|
|
744
766
|
getRangeInputSchema,
|
|
767
|
+
getReactiveCapabilityCurveValidationSchema,
|
|
768
|
+
getReactiveLimitsEmptyFormData,
|
|
769
|
+
getReactiveLimitsFormData,
|
|
770
|
+
getReactiveLimitsSchema,
|
|
771
|
+
getReactiveLimitsValidationSchema,
|
|
745
772
|
getReactivePowerSetPointSchema,
|
|
773
|
+
getRowEmptyFormData,
|
|
746
774
|
getSetPointsEmptyFormData,
|
|
747
775
|
getSetPointsSchema,
|
|
776
|
+
getShortCircuitEmptyFormData,
|
|
777
|
+
getShortCircuitFormData,
|
|
778
|
+
getShortCircuitFormSchema,
|
|
748
779
|
gridItem,
|
|
749
780
|
handleSigninCallback,
|
|
750
781
|
handleSilentRenewCallback,
|
|
@@ -788,6 +819,8 @@ export {
|
|
|
788
819
|
sanitizePercentageValue,
|
|
789
820
|
saveExpertFilter,
|
|
790
821
|
saveExplicitNamingFilter,
|
|
822
|
+
setCurrentReactiveCapabilityCurveTable,
|
|
823
|
+
setSelectedReactiveLimits,
|
|
791
824
|
standardTextField,
|
|
792
825
|
styles,
|
|
793
826
|
substationCreationDtoToForm,
|
|
@@ -804,6 +837,8 @@ export {
|
|
|
804
837
|
toFormValuesContingencyListsInfos,
|
|
805
838
|
toFormValuesLimitReductions,
|
|
806
839
|
toModificationProperties,
|
|
840
|
+
toReactiveCapabilityCurveChoiceForGeneratorCreation,
|
|
841
|
+
toReactiveCapabilityCurveChoiceForGeneratorModification,
|
|
807
842
|
translateSwitchKinds,
|
|
808
843
|
unscrollableDialogStyles,
|
|
809
844
|
updateModificationFieldInTree,
|
|
@@ -49,7 +49,6 @@ import { DESCRIPTION, NAME } from "./reactHookForm/constants.js";
|
|
|
49
49
|
import { ExpandableInput } from "./reactHookForm/expandableInput/ExpandableInput.js";
|
|
50
50
|
import { CountrySelectionInput } from "./reactHookForm/CountrySelectionInput.js";
|
|
51
51
|
import { CheckboxNullableInput } from "./reactHookForm/CheckboxNullableInput.js";
|
|
52
|
-
import { AddButton } from "./reactQueryBuilder/AddButton.js";
|
|
53
52
|
import { AutocompleteWithFavorites } from "./reactQueryBuilder/AutocompleteWithFavorites.js";
|
|
54
53
|
import { CombinatorSelector } from "./reactQueryBuilder/CombinatorSelector.js";
|
|
55
54
|
import { CountryValueEditor } from "./reactQueryBuilder/CountryValueEditor.js";
|
|
@@ -68,7 +67,6 @@ import { useValid } from "./reactQueryBuilder/hooks/useValid.js";
|
|
|
68
67
|
import { ActivableChip } from "./ActivableChip.js";
|
|
69
68
|
export {
|
|
70
69
|
ActivableChip,
|
|
71
|
-
AddButton,
|
|
72
70
|
AutocompleteInput,
|
|
73
71
|
AutocompleteWithFavorites,
|
|
74
72
|
BooleanInput,
|
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useFieldArray } from "react-hook-form";
|
|
3
|
-
import { Grid
|
|
4
|
-
import { ControlPoint } from "@mui/icons-material";
|
|
5
|
-
import { FormattedMessage } from "react-intl";
|
|
3
|
+
import { Grid } from "@mui/material";
|
|
6
4
|
import { forwardRef, useImperativeHandle } from "react";
|
|
7
5
|
import { DeletableRow } from "./DeletableRow.js";
|
|
8
6
|
import { ErrorInput } from "../errorManagement/ErrorInput.js";
|
|
9
7
|
import { MidFormError } from "../errorManagement/MidFormError.js";
|
|
10
|
-
import "
|
|
11
|
-
import "../../../../utils/types/equipmentType.js";
|
|
12
|
-
import { mergeSx } from "../../../../utils/styles.js";
|
|
13
|
-
import "../../../../utils/yupConfig.js";
|
|
14
|
-
const styles = {
|
|
15
|
-
button: (theme) => ({
|
|
16
|
-
justifyContent: "flex-start",
|
|
17
|
-
fontSize: "small",
|
|
18
|
-
marginTop: theme.spacing(1)
|
|
19
|
-
}),
|
|
20
|
-
paddingButton: (theme) => ({
|
|
21
|
-
paddingLeft: theme.spacing(2)
|
|
22
|
-
})
|
|
23
|
-
};
|
|
8
|
+
import { AddButton } from "../../../addButton/AddButton.js";
|
|
24
9
|
const ExpandableInput = forwardRef(
|
|
25
10
|
({
|
|
26
11
|
name,
|
|
@@ -73,17 +58,7 @@ const ExpandableInput = forwardRef(
|
|
|
73
58
|
},
|
|
74
59
|
value.id
|
|
75
60
|
)),
|
|
76
|
-
/* @__PURE__ */ jsx(
|
|
77
|
-
Button,
|
|
78
|
-
{
|
|
79
|
-
disabled,
|
|
80
|
-
fullWidth: true,
|
|
81
|
-
sx: mergeSx(styles.button, styles.paddingButton),
|
|
82
|
-
startIcon: /* @__PURE__ */ jsx(ControlPoint, {}),
|
|
83
|
-
onClick: () => append(initialValue),
|
|
84
|
-
children: addButtonLabel && /* @__PURE__ */ jsx(FormattedMessage, { id: addButtonLabel })
|
|
85
|
-
}
|
|
86
|
-
) })
|
|
61
|
+
addButtonLabel && /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(AddButton, { disabled, onClick: () => append(initialValue), label: addButtonLabel }) })
|
|
87
62
|
] });
|
|
88
63
|
}
|
|
89
64
|
);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
|
-
import { FormattedMessage } from "react-intl";
|
|
4
3
|
import { Box, Button } from "@mui/material";
|
|
5
|
-
import {
|
|
4
|
+
import { Delete } from "@mui/icons-material";
|
|
6
5
|
import { useFormContext } from "react-hook-form";
|
|
7
6
|
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
8
7
|
import { ExpandingTextField } from "./ExpandingTextField.js";
|
|
@@ -10,6 +9,7 @@ import { MAX_CHAR_DESCRIPTION } from "../../../../utils/constants/uiConstants.js
|
|
|
10
9
|
import "../../../../utils/conversionUtils.js";
|
|
11
10
|
import "../../../../utils/types/equipmentType.js";
|
|
12
11
|
import "../../../../utils/yupConfig.js";
|
|
12
|
+
import { AddButton } from "../../../addButton/AddButton.js";
|
|
13
13
|
function DescriptionField({
|
|
14
14
|
expandingTextSx,
|
|
15
15
|
maxCharactersNumber = MAX_CHAR_DESCRIPTION,
|
|
@@ -30,7 +30,7 @@ function DescriptionField({
|
|
|
30
30
|
setIsDescriptionFieldVisible(true);
|
|
31
31
|
}
|
|
32
32
|
}, [description]);
|
|
33
|
-
return
|
|
33
|
+
return !isDescriptionFieldVisible ? /* @__PURE__ */ jsx(AddButton, { onClick: handleOpenDescription, "data-testid": "AddDescriptionButton", label: "AddDescription" }) : /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "flex-start" }, children: [
|
|
34
34
|
/* @__PURE__ */ jsx(
|
|
35
35
|
ExpandingTextField,
|
|
36
36
|
{
|
|
@@ -55,7 +55,7 @@ function DescriptionField({
|
|
|
55
55
|
children: /* @__PURE__ */ jsx(Delete, {})
|
|
56
56
|
}
|
|
57
57
|
)
|
|
58
|
-
] })
|
|
58
|
+
] });
|
|
59
59
|
}
|
|
60
60
|
export {
|
|
61
61
|
DescriptionField
|
|
@@ -4,7 +4,6 @@
|
|
|
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
|
-
export * from './AddButton';
|
|
8
7
|
export * from './AutocompleteWithFavorites';
|
|
9
8
|
export * from './CombinatorSelector';
|
|
10
9
|
export * from './CountryValueEditor';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AddButton } from "./AddButton.js";
|
|
2
1
|
import { AutocompleteWithFavorites } from "./AutocompleteWithFavorites.js";
|
|
3
2
|
import { CombinatorSelector } from "./CombinatorSelector.js";
|
|
4
3
|
import { CountryValueEditor } from "./CountryValueEditor.js";
|
|
@@ -15,7 +14,6 @@ import { RuleValueEditor } from "./compositeRuleEditor/RuleValueEditor.js";
|
|
|
15
14
|
import { useConvertValue } from "./hooks/useConvertValue.js";
|
|
16
15
|
import { useValid } from "./hooks/useValid.js";
|
|
17
16
|
export {
|
|
18
|
-
AddButton,
|
|
19
17
|
AutocompleteWithFavorites,
|
|
20
18
|
CombinatorSelector,
|
|
21
19
|
CountryValueEditor,
|
package/dist/components/network-modifications/common/activePowerControl/ActivePowerControlForm.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ActivePowerControlInfos } from './activePowerControlForm.type';
|
|
2
|
+
export interface ActivePowerControlFormProps {
|
|
3
|
+
isEquipmentModification?: boolean;
|
|
4
|
+
previousValues?: ActivePowerControlInfos;
|
|
5
|
+
}
|
|
6
|
+
export declare function ActivePowerControlForm({ isEquipmentModification, previousValues, }: Readonly<ActivePowerControlFormProps>): import("react/jsx-runtime").JSX.Element;
|
package/dist/components/network-modifications/common/activePowerControl/ActivePowerControlForm.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useWatch } from "react-hook-form";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { useIntl, FormattedMessage } from "react-intl";
|
|
5
|
+
import { Box, Tooltip } from "@mui/material";
|
|
6
|
+
import { InfoOutlined } from "@mui/icons-material";
|
|
7
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
8
|
+
import "../../../../utils/conversionUtils.js";
|
|
9
|
+
import "../../../../utils/types/equipmentType.js";
|
|
10
|
+
import "../../../../utils/yupConfig.js";
|
|
11
|
+
import GridItem from "../../../grid/grid-item.js";
|
|
12
|
+
import "../../../overflowableText/OverflowableText.js";
|
|
13
|
+
import "localized-countries";
|
|
14
|
+
import "localized-countries/data/fr";
|
|
15
|
+
import "localized-countries/data/en";
|
|
16
|
+
import "notistack";
|
|
17
|
+
import "../../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
18
|
+
import "yup";
|
|
19
|
+
import "../../../treeViewFinder/TreeViewFinder.js";
|
|
20
|
+
import "../../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
21
|
+
import "../../../customAGGrid/customAggrid.js";
|
|
22
|
+
import "ag-grid-community";
|
|
23
|
+
import "react-papaparse";
|
|
24
|
+
import "react-csv-downloader";
|
|
25
|
+
import { SwitchInput } from "../../../inputs/reactHookForm/booleans/SwitchInput.js";
|
|
26
|
+
import { FloatInput } from "../../../inputs/reactHookForm/numbers/FloatInput.js";
|
|
27
|
+
import "../../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
28
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
29
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
30
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
31
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
32
|
+
import "../../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
33
|
+
import "../../../inputs/reactHookForm/expandableInput/ExpandableInput.js";
|
|
34
|
+
import { CheckboxNullableInput } from "../../../inputs/reactHookForm/CheckboxNullableInput.js";
|
|
35
|
+
import "@react-querybuilder/material";
|
|
36
|
+
import "../../../filter/expert/expertFilterConstants.js";
|
|
37
|
+
import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
38
|
+
import "uuid";
|
|
39
|
+
import "../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
40
|
+
import "react-querybuilder";
|
|
41
|
+
function ActivePowerControlForm({
|
|
42
|
+
isEquipmentModification = false,
|
|
43
|
+
previousValues
|
|
44
|
+
}) {
|
|
45
|
+
const intl = useIntl();
|
|
46
|
+
const watchFrequencyRegulation = useWatch({
|
|
47
|
+
name: FieldConstants.FREQUENCY_REGULATION
|
|
48
|
+
});
|
|
49
|
+
const previousFrequencyRegulation = useMemo(() => {
|
|
50
|
+
if (previousValues?.participate) {
|
|
51
|
+
return intl.formatMessage({ id: "On" });
|
|
52
|
+
}
|
|
53
|
+
if (previousValues?.participate === false || previousValues && previousValues?.participate === void 0) {
|
|
54
|
+
return intl.formatMessage({ id: "Off" });
|
|
55
|
+
}
|
|
56
|
+
return void 0;
|
|
57
|
+
}, [intl, previousValues]);
|
|
58
|
+
const frequencyRegulationField = isEquipmentModification ? (
|
|
59
|
+
/** wrap with box to avoid warning */
|
|
60
|
+
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
|
|
61
|
+
CheckboxNullableInput,
|
|
62
|
+
{
|
|
63
|
+
name: FieldConstants.FREQUENCY_REGULATION,
|
|
64
|
+
label: "FrequencyRegulation",
|
|
65
|
+
previousValue: previousFrequencyRegulation
|
|
66
|
+
}
|
|
67
|
+
) })
|
|
68
|
+
) : /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(SwitchInput, { name: FieldConstants.FREQUENCY_REGULATION, label: "FrequencyRegulation" }) });
|
|
69
|
+
const droopField = /* @__PURE__ */ jsx(
|
|
70
|
+
FloatInput,
|
|
71
|
+
{
|
|
72
|
+
name: FieldConstants.DROOP,
|
|
73
|
+
label: "Droop",
|
|
74
|
+
previousValue: Number.isNaN(previousValues?.droop) ? void 0 : previousValues?.droop ?? void 0,
|
|
75
|
+
clearable: true
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
const descriptionTooltip = useMemo(
|
|
79
|
+
() => /* @__PURE__ */ jsx(Tooltip, { title: intl.formatMessage({ id: "activePowerControlTooltip" }), children: /* @__PURE__ */ jsx(InfoOutlined, { color: "info", fontSize: "medium" }) }),
|
|
80
|
+
[intl]
|
|
81
|
+
);
|
|
82
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
83
|
+
isEquipmentModification ? /* @__PURE__ */ jsx(
|
|
84
|
+
GridItem,
|
|
85
|
+
{
|
|
86
|
+
tooltip: watchFrequencyRegulation === null ? /* @__PURE__ */ jsx(FormattedMessage, { id: "NoModification" }) : "",
|
|
87
|
+
size: 4,
|
|
88
|
+
children: frequencyRegulationField
|
|
89
|
+
}
|
|
90
|
+
) : /* @__PURE__ */ jsx(GridItem, { size: 4, children: frequencyRegulationField }),
|
|
91
|
+
/* @__PURE__ */ jsx(GridItem, { size: 4, children: droopField }),
|
|
92
|
+
/* @__PURE__ */ jsx(GridItem, { size: 4, children: descriptionTooltip })
|
|
93
|
+
] });
|
|
94
|
+
}
|
|
95
|
+
export {
|
|
96
|
+
ActivePowerControlForm
|
|
97
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2023, RTE (http://www.rte-france.com)
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
+
*/
|
|
7
|
+
export interface ActivePowerControlInfos {
|
|
8
|
+
participate?: boolean | null;
|
|
9
|
+
droop?: number | null;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const getActivePowerControlEmptyFormData: (isEquipmentModification?: boolean) => {
|
|
2
|
+
frequencyRegulation: boolean | null;
|
|
3
|
+
droop: null;
|
|
4
|
+
};
|
|
5
|
+
export declare const getActivePowerControlSchema: (isEquipmentModification?: boolean) => {
|
|
6
|
+
frequencyRegulation: import('yup').BooleanSchema<boolean | null | undefined, import('yup').AnyObject, undefined, "">;
|
|
7
|
+
droop: import('yup').NumberSchema<number | null | undefined, import('yup').AnyObject, undefined, "">;
|
|
8
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { number, bool } from "yup";
|
|
2
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
3
|
+
import { YUP_REQUIRED } from "../../../../utils/constants/translationKeys.js";
|
|
4
|
+
import "../../../../utils/conversionUtils.js";
|
|
5
|
+
import "../../../../utils/types/equipmentType.js";
|
|
6
|
+
import "react/jsx-runtime";
|
|
7
|
+
import "@mui/icons-material";
|
|
8
|
+
import "../../../../utils/yupConfig.js";
|
|
9
|
+
const getActivePowerControlEmptyFormData = (isEquipmentModification = false) => ({
|
|
10
|
+
[FieldConstants.FREQUENCY_REGULATION]: isEquipmentModification ? null : false,
|
|
11
|
+
[FieldConstants.DROOP]: null
|
|
12
|
+
});
|
|
13
|
+
const getActivePowerControlSchema = (isEquipmentModification = false) => ({
|
|
14
|
+
[FieldConstants.FREQUENCY_REGULATION]: bool().nullable().when([], {
|
|
15
|
+
is: () => !isEquipmentModification,
|
|
16
|
+
then: (schema) => schema.required(YUP_REQUIRED)
|
|
17
|
+
}),
|
|
18
|
+
[FieldConstants.DROOP]: number().nullable().min(0, "NormalizedPercentage").max(100, "NormalizedPercentage").when([FieldConstants.FREQUENCY_REGULATION], {
|
|
19
|
+
is: (frequencyRegulation) => !isEquipmentModification && frequencyRegulation,
|
|
20
|
+
then: (schema) => schema.required(YUP_REQUIRED)
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
getActivePowerControlEmptyFormData,
|
|
25
|
+
getActivePowerControlSchema
|
|
26
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, RTE (http://www.rte-france.com)
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
+
*/
|
|
7
|
+
export * from './activePowerControlForm.type';
|
|
8
|
+
export * from './activePowerControlForm.utils';
|
|
9
|
+
export * from './ActivePowerControlForm';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { getActivePowerControlEmptyFormData, getActivePowerControlSchema } from "./activePowerControlForm.utils.js";
|
|
2
|
+
import { ActivePowerControlForm } from "./ActivePowerControlForm.js";
|
|
3
|
+
export {
|
|
4
|
+
ActivePowerControlForm,
|
|
5
|
+
getActivePowerControlEmptyFormData,
|
|
6
|
+
getActivePowerControlSchema
|
|
7
|
+
};
|
|
@@ -21,7 +21,6 @@ function BranchConnectivityForm({
|
|
|
21
21
|
ConnectivityForm,
|
|
22
22
|
{
|
|
23
23
|
id: id1,
|
|
24
|
-
withPosition: true,
|
|
25
24
|
isEquipmentModification: isModification,
|
|
26
25
|
previousValues: {
|
|
27
26
|
connectablePosition: previousValues?.connectablePosition1,
|
|
@@ -39,7 +38,6 @@ function BranchConnectivityForm({
|
|
|
39
38
|
ConnectivityForm,
|
|
40
39
|
{
|
|
41
40
|
id: id2,
|
|
42
|
-
withPosition: true,
|
|
43
41
|
isEquipmentModification: isModification,
|
|
44
42
|
previousValues: {
|
|
45
43
|
connectablePosition: previousValues?.connectablePosition2,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ConnectablePositionFormInfos
|
|
1
|
+
import { VoltageLevelConnectivityFormPreviousValuesProps, VoltageLevelConnectivityFormProps } from './VoltageLevelConnectivityForm';
|
|
2
|
+
import { ConnectablePositionFormInfos } from './connectivity.type';
|
|
3
3
|
/**
|
|
4
4
|
* Hook to handle a 'connectivity value' (voltage level, bus or bus bar section)
|
|
5
5
|
* @param id optional id that has to be defined if the component is used more than once in a form
|
|
@@ -15,20 +15,12 @@ import { ConnectablePositionFormInfos, ConnectivityNetworkProps } from './connec
|
|
|
15
15
|
* @param fetchBusesOrBusbarSections a promise to retrieve bus bars for a given voltage level
|
|
16
16
|
* @returns JSX.Element
|
|
17
17
|
*/
|
|
18
|
-
interface
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
direction?: GridDirection;
|
|
22
|
-
withDirectionsInfos?: boolean;
|
|
23
|
-
withPosition: boolean;
|
|
24
|
-
onVoltageLevelChangeCallback?: () => void;
|
|
25
|
-
isEquipmentModification?: boolean;
|
|
26
|
-
previousValues?: {
|
|
27
|
-
connectablePosition?: ConnectablePositionFormInfos;
|
|
28
|
-
voltageLevelId?: string;
|
|
29
|
-
busOrBusbarSectionId?: string;
|
|
30
|
-
terminalConnected?: boolean | null;
|
|
31
|
-
};
|
|
18
|
+
interface ConnectivityFormPreviousValuesProps extends VoltageLevelConnectivityFormPreviousValuesProps {
|
|
19
|
+
connectablePosition?: ConnectablePositionFormInfos;
|
|
20
|
+
terminalConnected?: boolean | null;
|
|
32
21
|
}
|
|
33
|
-
|
|
22
|
+
interface ConnectivityFormProps extends VoltageLevelConnectivityFormProps {
|
|
23
|
+
previousValues?: ConnectivityFormPreviousValuesProps;
|
|
24
|
+
}
|
|
25
|
+
export declare function ConnectivityForm({ id, voltageLevelSelectLabel, onVoltageLevelChangeCallback, isEquipmentModification, previousValues, voltageLevelOptions, PositionDiagramPane, fetchBusesOrBusbarSections, }: Readonly<ConnectivityFormProps>): import("react/jsx-runtime").JSX.Element;
|
|
34
26
|
export {};
|