@gridsuite/commons-ui 0.98.0 → 0.100.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 (149) hide show
  1. package/dist/components/announcement/AnnouncementBanner.d.ts +15 -0
  2. package/dist/components/announcement/AnnouncementBanner.js +87 -0
  3. package/dist/components/announcement/AnnouncementNotification.d.ts +7 -0
  4. package/dist/components/announcement/AnnouncementNotification.js +10 -0
  5. package/dist/components/announcement/index.d.ts +3 -0
  6. package/dist/components/announcement/index.js +8 -0
  7. package/dist/components/announcement/useGlobalAnnouncement.d.ts +10 -0
  8. package/dist/components/announcement/useGlobalAnnouncement.js +48 -0
  9. package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.js +1 -1
  10. package/dist/components/index.d.ts +2 -0
  11. package/dist/components/index.js +104 -3
  12. package/dist/components/inputs/index.js +2 -1
  13. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.d.ts +1 -0
  14. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +2 -0
  15. package/dist/components/inputs/reactHookForm/index.js +2 -1
  16. package/dist/components/inputs/reactHookForm/text/TextInput.d.ts +3 -1
  17. package/dist/components/inputs/reactHookForm/text/TextInput.js +4 -2
  18. package/dist/components/inputs/reactHookForm/utils/HelperPreviousValue.js +1 -1
  19. package/dist/components/parameters/common/ProviderParam.d.ts +7 -0
  20. package/dist/components/parameters/common/ProviderParam.js +51 -0
  21. package/dist/components/parameters/common/computing-type.d.ts +20 -0
  22. package/dist/components/parameters/common/computing-type.js +46 -0
  23. package/dist/components/parameters/common/constant.d.ts +8 -0
  24. package/dist/components/parameters/common/constant.js +18 -0
  25. package/dist/components/parameters/common/index.d.ts +15 -0
  26. package/dist/components/parameters/common/index.js +61 -0
  27. package/dist/components/parameters/common/limitreductions/columns-definitions.d.ts +77 -0
  28. package/dist/components/parameters/common/limitreductions/columns-definitions.js +83 -0
  29. package/dist/components/parameters/common/limitreductions/index.d.ts +11 -0
  30. package/dist/components/parameters/common/limitreductions/index.js +21 -0
  31. package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.d.ts +5 -0
  32. package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.js +38 -0
  33. package/dist/components/parameters/common/limitreductions/limit-reduction-table-row.d.ts +7 -0
  34. package/dist/components/parameters/common/limitreductions/limit-reduction-table-row.js +9 -0
  35. package/dist/components/parameters/common/limitreductions/limit-reductions-form-util.d.ts +29 -0
  36. package/dist/components/parameters/common/limitreductions/limit-reductions-form-util.js +27 -0
  37. package/dist/components/parameters/common/limitreductions/limit-reductions-table-form.d.ts +4 -0
  38. package/dist/components/parameters/common/limitreductions/limit-reductions-table-form.js +87 -0
  39. package/dist/components/parameters/common/line-separator.d.ts +1 -0
  40. package/dist/components/parameters/common/line-separator.js +8 -0
  41. package/dist/components/parameters/common/parameters-creation-dialog.d.ts +13 -0
  42. package/dist/components/parameters/common/parameters-creation-dialog.js +88 -0
  43. package/dist/components/parameters/common/parameters.d.ts +20 -0
  44. package/dist/components/parameters/common/parameters.js +42 -0
  45. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-cell.d.ts +6 -0
  46. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-cell.js +42 -0
  47. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-row.d.ts +8 -0
  48. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-row.js +17 -0
  49. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table.d.ts +8 -0
  50. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table.js +55 -0
  51. package/dist/components/parameters/common/voltage-level-table/index.d.ts +9 -0
  52. package/dist/components/parameters/common/voltage-level-table/index.js +8 -0
  53. package/dist/components/parameters/common/widget/index.d.ts +11 -0
  54. package/dist/components/parameters/common/widget/index.js +13 -0
  55. package/dist/components/parameters/common/widget/parameter-float.d.ts +10 -0
  56. package/dist/components/parameters/common/widget/parameter-float.js +51 -0
  57. package/dist/components/parameters/common/widget/parameter-group.d.ts +11 -0
  58. package/dist/components/parameters/common/widget/parameter-group.js +54 -0
  59. package/dist/components/parameters/common/widget/parameter-line-directory-items-input.d.ts +15 -0
  60. package/dist/components/parameters/common/widget/parameter-line-directory-items-input.js +55 -0
  61. package/dist/components/parameters/common/widget/parameter-line-slider.d.ts +12 -0
  62. package/dist/components/parameters/common/widget/parameter-line-slider.js +70 -0
  63. package/dist/components/parameters/common/widget/parameter-switch.d.ts +7 -0
  64. package/dist/components/parameters/common/widget/parameter-switch.js +9 -0
  65. package/dist/components/parameters/index.d.ts +9 -0
  66. package/dist/components/parameters/index.js +94 -0
  67. package/dist/components/parameters/loadflow/constants.d.ts +33 -0
  68. package/dist/components/parameters/loadflow/constants.js +59 -0
  69. package/dist/components/parameters/loadflow/index.d.ts +9 -0
  70. package/dist/components/parameters/loadflow/index.js +31 -0
  71. package/dist/components/parameters/loadflow/load-flow-general-parameters.d.ts +8 -0
  72. package/dist/components/parameters/loadflow/load-flow-general-parameters.js +179 -0
  73. package/dist/components/parameters/loadflow/load-flow-parameter-field.d.ts +19 -0
  74. package/dist/components/parameters/loadflow/load-flow-parameter-field.js +90 -0
  75. package/dist/components/parameters/loadflow/load-flow-parameters-content.d.ts +13 -0
  76. package/dist/components/parameters/loadflow/load-flow-parameters-content.js +82 -0
  77. package/dist/components/parameters/loadflow/load-flow-parameters-context.d.ts +13 -0
  78. package/dist/components/parameters/loadflow/load-flow-parameters-context.js +5 -0
  79. package/dist/components/parameters/loadflow/load-flow-parameters-dialog.d.ts +15 -0
  80. package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +112 -0
  81. package/dist/components/parameters/loadflow/load-flow-parameters-form.d.ts +9 -0
  82. package/dist/components/parameters/loadflow/load-flow-parameters-form.js +102 -0
  83. package/dist/components/parameters/loadflow/load-flow-parameters-header.d.ts +12 -0
  84. package/dist/components/parameters/loadflow/load-flow-parameters-header.js +84 -0
  85. package/dist/components/parameters/loadflow/load-flow-parameters-inline.d.ts +10 -0
  86. package/dist/components/parameters/loadflow/load-flow-parameters-inline.js +162 -0
  87. package/dist/components/parameters/loadflow/load-flow-parameters-provider.d.ts +4 -0
  88. package/dist/components/parameters/loadflow/load-flow-parameters-provider.js +20 -0
  89. package/dist/components/parameters/loadflow/load-flow-parameters-utils.d.ts +100 -0
  90. package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +158 -0
  91. package/dist/components/parameters/loadflow/use-load-flow-context.d.ts +7 -0
  92. package/dist/components/parameters/loadflow/use-load-flow-context.js +12 -0
  93. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.d.ts +32 -0
  94. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +263 -0
  95. package/dist/components/parameters/parameters-style.d.ts +150 -0
  96. package/dist/components/parameters/parameters-style.js +146 -0
  97. package/dist/components/topBar/DevModeBanner.d.ts +1 -0
  98. package/dist/components/topBar/DevModeBanner.js +42 -0
  99. package/dist/components/topBar/TopBar.js +302 -305
  100. package/dist/components/topBar/UserInformationDialog.js +1 -1
  101. package/dist/components/topBar/index.d.ts +3 -2
  102. package/dist/components/topBar/index.js +4 -2
  103. package/dist/hooks/index.d.ts +1 -0
  104. package/dist/hooks/index.js +3 -0
  105. package/dist/hooks/use-parameters-backend.d.ts +11 -0
  106. package/dist/hooks/use-parameters-backend.js +217 -0
  107. package/dist/index.js +135 -5
  108. package/dist/services/explore.d.ts +3 -0
  109. package/dist/services/explore.js +26 -1
  110. package/dist/services/index.d.ts +1 -0
  111. package/dist/services/index.js +9 -3
  112. package/dist/services/loadflow.d.ts +9 -0
  113. package/dist/services/loadflow.js +59 -0
  114. package/dist/services/userAdmin.d.ts +3 -3
  115. package/dist/services/userAdmin.js +9 -1
  116. package/dist/services/utils.d.ts +3 -8
  117. package/dist/services/utils.js +5 -0
  118. package/dist/translations/en/index.d.ts +1 -0
  119. package/dist/translations/en/index.js +2 -0
  120. package/dist/translations/en/parameters.d.ts +67 -0
  121. package/dist/translations/en/parameters.js +64 -0
  122. package/dist/translations/fr/index.d.ts +1 -0
  123. package/dist/translations/fr/index.js +2 -0
  124. package/dist/translations/fr/parameters.d.ts +67 -0
  125. package/dist/translations/fr/parameters.js +64 -0
  126. package/dist/utils/constants/notificationsProvider.d.ts +10 -0
  127. package/dist/utils/constants/notificationsProvider.js +17 -0
  128. package/dist/utils/index.d.ts +1 -0
  129. package/dist/utils/index.js +16 -0
  130. package/dist/utils/types/dynamic-security-analysis.type.d.ts +13 -0
  131. package/dist/utils/types/dynamic-security-analysis.type.js +1 -0
  132. package/dist/utils/types/dynamic-simulation.type.d.ts +111 -0
  133. package/dist/utils/types/dynamic-simulation.type.js +8 -0
  134. package/dist/utils/types/index.d.ts +6 -0
  135. package/dist/utils/types/index.js +11 -0
  136. package/dist/utils/types/loadflow.type.d.ts +11 -0
  137. package/dist/utils/types/loadflow.type.js +1 -0
  138. package/dist/utils/types/metadata.d.ts +1 -0
  139. package/dist/utils/types/non-evacuated-energy.type.d.ts +60 -0
  140. package/dist/utils/types/non-evacuated-energy.type.js +12 -0
  141. package/dist/utils/types/parameters.type.d.ts +41 -0
  142. package/dist/utils/types/parameters.type.js +12 -0
  143. package/dist/utils/types/sensitivity-analysis.type.d.ts +101 -0
  144. package/dist/utils/types/sensitivity-analysis.type.js +16 -0
  145. package/dist/utils/types/types.d.ts +12 -0
  146. package/dist/utils/types/types.js +8 -1
  147. package/package.json +2 -1
  148. package/dist/components/topBar/MessageBanner.d.ts +0 -6
  149. package/dist/components/topBar/MessageBanner.js +0 -54
@@ -0,0 +1,15 @@
1
+ import { UUID } from 'crypto';
2
+ import { PropsWithChildren, ReactNode } from 'react';
3
+ import { AlertProps } from '@mui/material';
4
+ import { User } from 'oidc-client';
5
+ import { AnnouncementSeverity } from '../../utils/types';
6
+ export type AnnouncementBannerProps = PropsWithChildren<{
7
+ user?: User | {};
8
+ /** only field used to detect if msg change */
9
+ id?: UUID;
10
+ duration?: number;
11
+ severity?: AnnouncementSeverity;
12
+ title?: ReactNode;
13
+ sx?: AlertProps['sx'];
14
+ }>;
15
+ export declare function AnnouncementBanner({ user, id, severity, title, children, duration, sx, }: Readonly<AnnouncementBannerProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,87 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useState, useEffect, useCallback } from "react";
3
+ import { useTheme, Collapse, Alert, AlertTitle, Tooltip } from "@mui/material";
4
+ import { Campaign } from "@mui/icons-material";
5
+ import "../../utils/types/equipmentType.js";
6
+ import { AnnouncementSeverity } from "../../utils/types/types.js";
7
+ const snackbarInfo = "#2196f3";
8
+ const snackbarWarning = "#ff9800";
9
+ const styles = {
10
+ alert: (theme) => ({
11
+ "&.MuiAlert-colorWarning": {
12
+ color: theme.palette.getContrastText(snackbarWarning),
13
+ backgroundColor: snackbarWarning
14
+ },
15
+ "&.MuiAlert-colorInfo": {
16
+ color: theme.palette.getContrastText(snackbarInfo),
17
+ backgroundColor: snackbarInfo
18
+ }
19
+ })
20
+ };
21
+ const iconMapping = {
22
+ info: /* @__PURE__ */ jsx(Campaign, {})
23
+ };
24
+ function convertSeverity(severity) {
25
+ switch (severity) {
26
+ case AnnouncementSeverity.INFO:
27
+ return "info";
28
+ case AnnouncementSeverity.WARN:
29
+ return "warning";
30
+ default:
31
+ return void 0;
32
+ }
33
+ }
34
+ function AnnouncementBanner({
35
+ user,
36
+ id,
37
+ severity = AnnouncementSeverity.INFO,
38
+ title,
39
+ children,
40
+ duration,
41
+ sx
42
+ }) {
43
+ const theme = useTheme();
44
+ const [visible, setVisible] = useState(false);
45
+ useEffect(
46
+ () => {
47
+ if (id) {
48
+ setVisible(true);
49
+ if (duration) {
50
+ const bannerTimer = setTimeout(() => {
51
+ setVisible(false);
52
+ }, duration);
53
+ return () => {
54
+ clearTimeout(bannerTimer);
55
+ };
56
+ }
57
+ } else {
58
+ setVisible(false);
59
+ }
60
+ return () => {
61
+ };
62
+ },
63
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- we check msg id in cas of an announcement
64
+ [id]
65
+ );
66
+ const handleClose = useCallback(() => setVisible(false), []);
67
+ return /* @__PURE__ */ jsx(Collapse, { in: user !== void 0 && visible, unmountOnExit: true, sx, style: { margin: theme.spacing(1) }, children: /* @__PURE__ */ jsxs(
68
+ Alert,
69
+ {
70
+ variant: "filled",
71
+ elevation: 0,
72
+ severity: convertSeverity(severity),
73
+ onClose: handleClose,
74
+ iconMapping,
75
+ hidden: !visible,
76
+ className: title ? void 0 : "no-title",
77
+ sx: styles.alert,
78
+ children: [
79
+ title && /* @__PURE__ */ jsx(AlertTitle, { children: title }),
80
+ /* @__PURE__ */ jsx(Tooltip, { title: children, placement: "bottom", children: /* @__PURE__ */ jsx("span", { children }) })
81
+ ]
82
+ }
83
+ ) });
84
+ }
85
+ export {
86
+ AnnouncementBanner
87
+ };
@@ -0,0 +1,7 @@
1
+ import { User } from 'oidc-client';
2
+ import { AnnouncementBannerProps } from './AnnouncementBanner';
3
+ export type AnnouncementNotificationProps = {
4
+ user: User | null;
5
+ sx?: AnnouncementBannerProps['sx'];
6
+ };
7
+ export declare function AnnouncementNotification({ user, sx }: Readonly<AnnouncementNotificationProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useGlobalAnnouncement } from "./useGlobalAnnouncement.js";
3
+ import { AnnouncementBanner } from "./AnnouncementBanner.js";
4
+ function AnnouncementNotification({ user, sx }) {
5
+ const { id, severity, message, duration } = useGlobalAnnouncement(user) ?? {};
6
+ return /* @__PURE__ */ jsx(AnnouncementBanner, { user: user ?? void 0, id, severity, duration, sx, children: message });
7
+ }
8
+ export {
9
+ AnnouncementNotification
10
+ };
@@ -0,0 +1,3 @@
1
+ export * from './AnnouncementBanner';
2
+ export * from './AnnouncementNotification';
3
+ export * from './useGlobalAnnouncement';
@@ -0,0 +1,8 @@
1
+ import { AnnouncementBanner } from "./AnnouncementBanner.js";
2
+ import { AnnouncementNotification } from "./AnnouncementNotification.js";
3
+ import { useGlobalAnnouncement } from "./useGlobalAnnouncement.js";
4
+ export {
5
+ AnnouncementBanner,
6
+ AnnouncementNotification,
7
+ useGlobalAnnouncement
8
+ };
@@ -0,0 +1,10 @@
1
+ import { UUID } from 'crypto';
2
+ import { User } from 'oidc-client';
3
+ import { AnnouncementSeverity } from '../../utils/types';
4
+ export type AnnouncementProps = {
5
+ id: UUID;
6
+ message: string;
7
+ duration: number;
8
+ severity: AnnouncementSeverity;
9
+ };
10
+ export declare function useGlobalAnnouncement(user: User | null): AnnouncementProps | undefined;
@@ -0,0 +1,48 @@
1
+ import { v4 } from "uuid";
2
+ import { useState, useEffect, useCallback } from "react";
3
+ import { fetchCurrentAnnouncement } from "../../services/userAdmin.js";
4
+ import { NotificationsUrlKeys } from "../../utils/constants/notificationsProvider.js";
5
+ import { useNotificationsListener } from "../notifications/hooks/useNotificationsListener.js";
6
+ function useGlobalAnnouncement(user) {
7
+ const [announcementInfos, setAnnouncementInfos] = useState();
8
+ useEffect(() => {
9
+ if (user) {
10
+ fetchCurrentAnnouncement().then((announcementDto) => {
11
+ if (announcementDto) {
12
+ setAnnouncementInfos({
13
+ id: announcementDto.id,
14
+ message: announcementDto.message,
15
+ duration: announcementDto.remainingDuration,
16
+ severity: announcementDto.severity
17
+ });
18
+ } else {
19
+ setAnnouncementInfos(void 0);
20
+ }
21
+ }).catch((error) => console.error("Failed to retrieve global announcement:", error));
22
+ } else {
23
+ setAnnouncementInfos(void 0);
24
+ }
25
+ }, [user]);
26
+ const handleAnnouncementMessage = useCallback((event) => {
27
+ const eventData = JSON.parse(event.data);
28
+ if (eventData.headers.messageType === "announcement") {
29
+ const announcement = {
30
+ id: eventData.id ?? v4(),
31
+ message: eventData.payload,
32
+ severity: eventData.headers.severity,
33
+ duration: eventData.headers.duration
34
+ };
35
+ console.debug("announcement incoming:", announcement);
36
+ setAnnouncementInfos(announcement);
37
+ } else if (eventData.headers.messageType === "cancelAnnouncement") {
38
+ setAnnouncementInfos(void 0);
39
+ }
40
+ }, []);
41
+ useNotificationsListener(NotificationsUrlKeys.GLOBAL_CONFIG, {
42
+ listenerCallbackMessage: handleAnnouncementMessage
43
+ });
44
+ return announcementInfos;
45
+ }
46
+ export {
47
+ useGlobalAnnouncement
48
+ };
@@ -10,7 +10,7 @@ const styles = {
10
10
  dialogPaper: {
11
11
  ".MuiDialog-paper": {
12
12
  width: "auto",
13
- minWidth: "1100px",
13
+ minWidth: "60vw",
14
14
  margin: "auto"
15
15
  }
16
16
  }
@@ -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 './announcement';
7
8
  export * from './authentication';
8
9
  export * from './cardErrorBoundary';
9
10
  export * from './checkBoxList';
@@ -21,4 +22,5 @@ export * from './topBar';
21
22
  export * from './treeViewFinder';
22
23
  export * from './notifications';
23
24
  export * from './icons';
25
+ export * from './parameters';
24
26
  export * from './menus';
@@ -1,3 +1,6 @@
1
+ import { AnnouncementBanner } from "./announcement/AnnouncementBanner.js";
2
+ import { AnnouncementNotification } from "./announcement/AnnouncementNotification.js";
3
+ import { useGlobalAnnouncement } from "./announcement/useGlobalAnnouncement.js";
1
4
  import { AuthenticationRouter } from "./authentication/AuthenticationRouter.js";
2
5
  import { default as default2 } from "./authentication/AuthenticationRouterErrorDisplay.js";
3
6
  import { Login } from "./authentication/Login.js";
@@ -41,7 +44,7 @@ import { saveExpertFilter, saveExplicitNamingFilter } from "./filter/utils/filte
41
44
  import { CONTINGENCY_LIST_EQUIPMENTS, FILTER_EQUIPMENTS } from "./filter/utils/filterFormUtils.js";
42
45
  import { FlatParameters, extractDefault } from "./flatParameters/FlatParameters.js";
43
46
  import { SelectClearable } from "./inputs/SelectClearable.js";
44
- import { DirectoryItemsInput, NAME } from "./inputs/reactHookForm/DirectoryItemsInput.js";
47
+ import { DESCRIPTION_INPUT, DirectoryItemsInput, NAME } from "./inputs/reactHookForm/DirectoryItemsInput.js";
45
48
  import { RawReadOnlyInput } from "./inputs/reactHookForm/RawReadOnlyInput.js";
46
49
  import { BottomRightButtons } from "./inputs/reactHookForm/agGridTable/BottomRightButtons.js";
47
50
  import { CustomAgGridTable } from "./inputs/reactHookForm/agGridTable/CustomAgGridTable.js";
@@ -97,9 +100,10 @@ import { ActivableChip } from "./inputs/ActivableChip.js";
97
100
  import { MultipleSelectionDialog } from "./multipleSelectionDialog/MultipleSelectionDialog.js";
98
101
  import { OverflowableText } from "./overflowableText/OverflowableText.js";
99
102
  import { SnackbarProvider } from "./snackbarProvider/SnackbarProvider.js";
100
- import { TopBar } from "./topBar/TopBar.js";
101
- import { GridLogo, LogoText } from "./topBar/GridLogo.js";
102
103
  import { AboutDialog } from "./topBar/AboutDialog.js";
104
+ import { GridLogo, LogoText } from "./topBar/GridLogo.js";
105
+ import { DevModeBanner } from "./topBar/DevModeBanner.js";
106
+ import { TopBar } from "./topBar/TopBar.js";
103
107
  import { TreeViewFinder, generateTreeViewFinderClass } from "./treeViewFinder/TreeViewFinder.js";
104
108
  import { NotificationsProvider } from "./notifications/NotificationsProvider.js";
105
109
  import { NotificationsContext } from "./notifications/contexts/NotificationsContext.js";
@@ -107,20 +111,50 @@ import { useNotificationsListener } from "./notifications/hooks/useNotifications
107
111
  import { useListenerManager } from "./notifications/hooks/useListenerManager.js";
108
112
  import { LeftPanelOpenIcon } from "./icons/LeftPanelOpenIcon.js";
109
113
  import { LeftPanelCloseIcon } from "./icons/LeftPanelCloseIcon.js";
114
+ import { ComputingType, formatComputingTypeLabel, isValidComputingType } from "./parameters/common/computing-type.js";
115
+ import { PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER, PROVIDER, VOLTAGE_LEVEL } from "./parameters/common/constant.js";
116
+ import { LineSeparator } from "./parameters/common/line-separator.js";
117
+ import { LabelledButton, SwitchWithLabel, TabPanel } from "./parameters/common/parameters.js";
118
+ import { CreateParameterDialog } from "./parameters/common/parameters-creation-dialog.js";
119
+ import { ProviderParam } from "./parameters/common/ProviderParam.js";
120
+ import { ParameterFloat } from "./parameters/common/widget/parameter-float.js";
121
+ import { ParameterGroup } from "./parameters/common/widget/parameter-group.js";
122
+ import { ParameterLineDirectoryItemsInput } from "./parameters/common/widget/parameter-line-directory-items-input.js";
123
+ import { ParameterLineSlider, sanitizePercentageValue } from "./parameters/common/widget/parameter-line-slider.js";
124
+ import { ParameterSwitch } from "./parameters/common/widget/parameter-switch.js";
125
+ import { CustomVoltageLevelTable } from "./parameters/common/voltage-level-table/custom-voltage-level-table.js";
126
+ import { CustomVoltageLevelTableCell } from "./parameters/common/voltage-level-table/custom-voltage-level-table-cell.js";
127
+ import { CustomVoltageLevelTableRow } from "./parameters/common/voltage-level-table/custom-voltage-level-table-row.js";
128
+ import { COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS, IST_FORM, LIMIT_DURATION_FORM, LIMIT_REDUCTIONS_FORM, TAB_INFO, TabValues, VOLTAGE_LEVELS_FORM, getLimitReductionsFormSchema, getSAParametersFromSchema } from "./parameters/common/limitreductions/columns-definitions.js";
129
+ import { toFormValueSaParameters, toFormValuesLimitReductions } from "./parameters/common/limitreductions/limit-reductions-form-util.js";
130
+ import { LimitReductionsTableForm } from "./parameters/common/limitreductions/limit-reductions-table-form.js";
131
+ import { LimitReductionTableRow } from "./parameters/common/limitreductions/limit-reduction-table-row.js";
132
+ import { LimitReductionTableCell } from "./parameters/common/limitreductions/limit-reduction-table-cell.js";
133
+ import { getTabIndicatorStyle, getTabStyle, parametersStyles } from "./parameters/parameters-style.js";
134
+ import { BALANCE_TYPE, COMMON_PARAMETERS, CONNECTED_COMPONENT_MODE, COUNTRIES_TO_BALANCE, DC, DC_POWER_FACTOR, DC_USE_TRANSFORMER_RATIO, DEFAULT_LIMIT_REDUCTION_VALUE, DISTRIBUTED_SLACK, HVDC_AC_EMULATION, MAX_VALUE_ALLOWED_FOR_LIMIT_REDUCTION, MIN_VALUE_ALLOWED_FOR_LIMIT_REDUCTION, PARAM_LIMIT_REDUCTION, PARAM_PROVIDER_OPENLOADFLOW, PHASE_SHIFTER_REGULATION_ON, READ_SLACK_BUS, SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON, SPECIFIC_PARAMETERS, TRANSFORMER_VOLTAGE_CONTROL_ON, TWT_SPLIT_SHUNT_ADMITTANCE, USE_REACTIVE_LIMITS, VOLTAGE_INIT_MODE, WRITE_SLACK_BUS, alertThresholdMarks } from "./parameters/loadflow/constants.js";
135
+ import { LoadFlowParametersInline } from "./parameters/loadflow/load-flow-parameters-inline.js";
136
+ import { LoadFlowParametersEditionDialog } from "./parameters/loadflow/load-flow-parameters-dialog.js";
110
137
  import { CustomMenuItem, CustomNestedMenuItem } from "./menus/custom-nested-menu.js";
111
138
  export {
112
139
  AboutDialog,
113
140
  ActivableChip,
114
141
  AddButton,
142
+ AnnouncementBanner,
143
+ AnnouncementNotification,
115
144
  AuthenticationRouter,
116
145
  default2 as AuthenticationRouterErrorDisplay,
117
146
  AutocompleteInput,
118
147
  AutocompleteWithFavorites,
148
+ BALANCE_TYPE,
119
149
  BooleanInput,
120
150
  BottomRightButtons,
151
+ COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS,
121
152
  COMBINATOR_OPTIONS,
153
+ COMMON_PARAMETERS,
154
+ CONNECTED_COMPONENT_MODE,
122
155
  CONTINGENCY_LIST_EQUIPMENTS,
123
156
  CONVERTERS_MODE_OPTIONS,
157
+ COUNTRIES_TO_BALANCE,
124
158
  CUSTOM_AGGRID_THEME,
125
159
  CancelButton,
126
160
  CardErrorBoundary,
@@ -128,8 +162,10 @@ export {
128
162
  CheckboxInput,
129
163
  CombinatorSelector,
130
164
  CombinatorType,
165
+ ComputingType,
131
166
  CountriesInput,
132
167
  CountryValueEditor,
168
+ CreateParameterDialog,
133
169
  CriteriaBasedForm,
134
170
  CsvUploader,
135
171
  CustomAGGrid,
@@ -140,11 +176,21 @@ export {
140
176
  CustomMuiDialog,
141
177
  CustomNestedMenuItem,
142
178
  CustomReactQueryBuilder,
179
+ CustomVoltageLevelTable,
180
+ CustomVoltageLevelTableCell,
181
+ CustomVoltageLevelTableRow,
182
+ DC,
183
+ DC_POWER_FACTOR,
184
+ DC_USE_TRANSFORMER_RATIO,
185
+ DEFAULT_LIMIT_REDUCTION_VALUE,
143
186
  DEFAULT_RANGE_VALUE,
187
+ DESCRIPTION_INPUT,
188
+ DISTRIBUTED_SLACK,
144
189
  DISTRIBUTION_KEY,
145
190
  DataType,
146
191
  DescriptionField,
147
192
  DescriptionModificationDialog,
193
+ DevModeBanner,
148
194
  DirectoryItemSelector,
149
195
  DirectoryItemsInput,
150
196
  ENERGY_SOURCE_OPTIONS,
@@ -176,15 +222,28 @@ export {
176
222
  FloatInput,
177
223
  GridLogo,
178
224
  GroupValueEditor,
225
+ HVDC_AC_EMULATION,
179
226
  HelperPreviousValue,
227
+ IST_FORM,
180
228
  InputWithPopupConfirmation,
181
229
  IntegerInput,
230
+ LIMIT_DURATION_FORM,
231
+ LIMIT_REDUCTIONS_FORM,
182
232
  LOAD_TYPE_OPTIONS,
233
+ LabelledButton,
183
234
  LeftPanelCloseIcon,
184
235
  LeftPanelOpenIcon,
236
+ LimitReductionTableCell,
237
+ LimitReductionTableRow,
238
+ LimitReductionsTableForm,
239
+ LineSeparator,
240
+ LoadFlowParametersEditionDialog,
241
+ LoadFlowParametersInline,
185
242
  Login,
186
243
  LogoText,
187
244
  Logout,
245
+ MAX_VALUE_ALLOWED_FOR_LIMIT_REDUCTION,
246
+ MIN_VALUE_ALLOWED_FOR_LIMIT_REDUCTION,
188
247
  MidFormError,
189
248
  ModifyElementSelection,
190
249
  MuiSelectInput,
@@ -198,10 +257,27 @@ export {
198
257
  OPERATOR_OPTIONS,
199
258
  OperatorType,
200
259
  OverflowableText,
260
+ PARAM_LIMIT_REDUCTION,
261
+ PARAM_PROVIDER_OPENLOADFLOW,
262
+ PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD,
263
+ PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD,
264
+ PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD,
265
+ PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD,
266
+ PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD,
267
+ PARAM_SA_PROVIDER,
201
268
  PHASE_REGULATION_MODE_OPTIONS,
269
+ PHASE_SHIFTER_REGULATION_ON,
270
+ PROVIDER,
271
+ ParameterFloat,
272
+ ParameterGroup,
273
+ ParameterLineDirectoryItemsInput,
274
+ ParameterLineSlider,
275
+ ParameterSwitch,
202
276
  PopupConfirmationDialog,
203
277
  PropertyValueEditor,
278
+ ProviderParam,
204
279
  RATIO_REGULATION_MODE_OPTIONS,
280
+ READ_SLACK_BUS,
205
281
  REGULATION_TYPE_OPTIONS,
206
282
  RULES,
207
283
  RadioInput,
@@ -211,6 +287,8 @@ export {
211
287
  RemoveButton,
212
288
  RuleValueEditor,
213
289
  SHUNT_COMPENSATOR_TYPE_OPTIONS,
290
+ SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON,
291
+ SPECIFIC_PARAMETERS,
214
292
  SVAR_REGULATION_MODE_OPTIONS,
215
293
  SelectClearable,
216
294
  SelectInput,
@@ -220,6 +298,12 @@ export {
220
298
  SnackbarProvider,
221
299
  SubmitButton,
222
300
  SwitchInput,
301
+ SwitchWithLabel,
302
+ TAB_INFO,
303
+ TRANSFORMER_VOLTAGE_CONTROL_ON,
304
+ TWT_SPLIT_SHUNT_ADMITTANCE,
305
+ TabPanel,
306
+ TabValues,
223
307
  TagRenderer,
224
308
  TextFieldWithAdornment,
225
309
  TextInput,
@@ -227,27 +311,38 @@ export {
227
311
  TopBar,
228
312
  TranslatedValueEditor,
229
313
  TreeViewFinder,
314
+ USE_REACTIVE_LIMITS,
230
315
  UnauthorizedAccessAlert,
231
316
  UniqueNameInput,
232
317
  UserManagerMock,
318
+ VOLTAGE_INIT_MODE,
319
+ VOLTAGE_LEVEL,
320
+ VOLTAGE_LEVELS_FORM,
233
321
  ValueEditor,
234
322
  ValueSelector,
323
+ WRITE_SLACK_BUS,
324
+ alertThresholdMarks,
235
325
  countRules,
236
326
  dispatchUser,
237
327
  expertFilterSchema,
238
328
  explicitNamingFilterSchema,
239
329
  exportExpertRules,
240
330
  extractDefault,
331
+ formatComputingTypeLabel,
241
332
  genHelperError,
242
333
  generateTreeViewFinderClass,
243
334
  getCriteriaBasedFormData,
244
335
  getCriteriaBasedSchema,
245
336
  getExpertFilterEmptyFormData,
246
337
  getExplicitNamingFilterEmptyFormData,
338
+ getLimitReductionsFormSchema,
247
339
  getNumberOfSiblings,
248
340
  getOperators,
249
341
  getPreLoginPath,
250
342
  getRangeInputSchema,
343
+ getSAParametersFromSchema,
344
+ getTabIndicatorStyle,
345
+ getTabStyle,
251
346
  gridItem,
252
347
  handleSigninCallback,
253
348
  handleSilentRenewCallback,
@@ -258,20 +353,26 @@ export {
258
353
  isFieldRequired,
259
354
  isFloatNumber,
260
355
  isIntegerNumber,
356
+ isValidComputingType,
261
357
  login,
262
358
  logout,
359
+ parametersStyles,
263
360
  queryValidator,
264
361
  recursiveRemove,
265
362
  rqbQuerySchemaValidator,
363
+ sanitizePercentageValue,
266
364
  saveExpertFilter,
267
365
  saveExplicitNamingFilter,
268
366
  styles,
269
367
  testQuery,
270
368
  toFloatOrNullValue,
369
+ toFormValueSaParameters,
370
+ toFormValuesLimitReductions,
271
371
  unscrollableDialogStyles,
272
372
  useConvertValue,
273
373
  useCustomFormContext,
274
374
  useElementSearch,
375
+ useGlobalAnnouncement,
275
376
  useListenerManager,
276
377
  useNotificationsListener,
277
378
  useValid
@@ -1,5 +1,5 @@
1
1
  import { SelectClearable } from "./SelectClearable.js";
2
- import { DirectoryItemsInput, NAME } from "./reactHookForm/DirectoryItemsInput.js";
2
+ import { DESCRIPTION_INPUT, DirectoryItemsInput, NAME } from "./reactHookForm/DirectoryItemsInput.js";
3
3
  import { RawReadOnlyInput } from "./reactHookForm/RawReadOnlyInput.js";
4
4
  import { BottomRightButtons } from "./reactHookForm/agGridTable/BottomRightButtons.js";
5
5
  import { CustomAgGridTable } from "./reactHookForm/agGridTable/CustomAgGridTable.js";
@@ -70,6 +70,7 @@ export {
70
70
  CustomFormProvider,
71
71
  CustomReactQueryBuilder,
72
72
  DEFAULT_RANGE_VALUE,
73
+ DESCRIPTION_INPUT,
73
74
  DescriptionField,
74
75
  DirectoryItemsInput,
75
76
  ElementValueEditor,
@@ -1,5 +1,6 @@
1
1
  import { ElementAttributes } from '../../../utils';
2
2
  export declare const NAME = "name";
3
+ export declare const DESCRIPTION_INPUT = "description";
3
4
  export interface DirectoryItemsInputProps {
4
5
  label: string | undefined;
5
6
  name: string;
@@ -16,6 +16,7 @@ import { MidFormError } from "./errorManagement/MidFormError.js";
16
16
  import { DirectoryItemSelector } from "../../directoryItemSelector/DirectoryItemSelector.js";
17
17
  import { fetchDirectoryElementPath } from "../../../services/directory.js";
18
18
  const NAME = "name";
19
+ const DESCRIPTION_INPUT = "description";
19
20
  const styles = {
20
21
  formDirectoryElements1: {
21
22
  display: "flex",
@@ -212,6 +213,7 @@ function DirectoryItemsInput({
212
213
  ] });
213
214
  }
214
215
  export {
216
+ DESCRIPTION_INPUT,
215
217
  DirectoryItemsInput,
216
218
  NAME
217
219
  };
@@ -1,4 +1,4 @@
1
- import { DirectoryItemsInput, NAME } from "./DirectoryItemsInput.js";
1
+ import { DESCRIPTION_INPUT, DirectoryItemsInput, NAME } from "./DirectoryItemsInput.js";
2
2
  import { RawReadOnlyInput } from "./RawReadOnlyInput.js";
3
3
  import { BottomRightButtons } from "./agGridTable/BottomRightButtons.js";
4
4
  import { CustomAgGridTable } from "./agGridTable/CustomAgGridTable.js";
@@ -46,6 +46,7 @@ export {
46
46
  CustomFormContext,
47
47
  CustomFormProvider,
48
48
  DEFAULT_RANGE_VALUE,
49
+ DESCRIPTION_INPUT,
49
50
  DescriptionField,
50
51
  DirectoryItemsInput,
51
52
  ErrorInput,
@@ -19,9 +19,11 @@ export interface TextInputProps {
19
19
  clearable?: boolean;
20
20
  formProps?: Omit<TextFieldWithAdornmentProps | TextFieldProps, 'value' | 'onChange' | 'inputRef' | 'inputProps' | 'InputProps'>;
21
21
  disabledTooltip?: boolean;
22
+ disabled?: boolean;
22
23
  }
23
24
  export declare function TextInput({ name, label, labelValues, // this prop is used to add a value to label. this value is displayed without being translated
24
25
  id, adornment, customAdornment, outputTransform, // transform materialUi input value before sending it to react hook form, mostly used to deal with number fields
25
26
  inputTransform, // transform react hook form value before sending it to materialUi input, mostly used to deal with number fields
26
27
  acceptValue, // used to check user entry before committing the input change, used mostly to prevent user from typing a character in number field
27
- previousValue, clearable, formProps, disabledTooltip, }: TextInputProps): import("react/jsx-runtime").JSX.Element;
28
+ previousValue, clearable, formProps, disabledTooltip, // In case we don't want to show tooltip on the value and warning/info icons
29
+ disabled, }: TextInputProps): import("react/jsx-runtime").JSX.Element;
@@ -24,8 +24,9 @@ function TextInput({
24
24
  previousValue,
25
25
  clearable,
26
26
  formProps,
27
- disabledTooltip
27
+ disabledTooltip,
28
28
  // In case we don't want to show tooltip on the value and warning/info icons
29
+ disabled
29
30
  }) {
30
31
  const { validationSchema, getValues, removeOptional, isNodeBuilt, isUpdate } = useCustomFormContext();
31
32
  const {
@@ -81,7 +82,8 @@ function TextInput({
81
82
  ),
82
83
  ...genHelperError(error == null ? void 0 : error.message),
83
84
  ...formProps,
84
- ...adornment && { ...finalAdornment }
85
+ ...adornment && { ...finalAdornment },
86
+ disabled
85
87
  },
86
88
  id ?? label
87
89
  );
@@ -9,7 +9,7 @@ function HelperPreviousValue({
9
9
  adornmentText
10
10
  }) {
11
11
  const intl = useIntl();
12
- if (!previousValue && previousValue !== 0 || Number.isNaN(previousValue)) {
12
+ if (!previousValue && previousValue !== 0 || Number.isNaN(previousValue) || previousValue === "NaN") {
13
13
  return void 0;
14
14
  }
15
15
  return /* @__PURE__ */ jsx(FormHelperText, { error: false, sx: { marginLeft: 0 }, children: !disabledTooltip ? /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, sx: { alignItems: "center" }, children: [
@@ -0,0 +1,7 @@
1
+ export interface ProviderParamProps {
2
+ options: {
3
+ id: string;
4
+ label: string;
5
+ }[];
6
+ }
7
+ export declare function ProviderParam({ options }: Readonly<ProviderParamProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,51 @@
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { Grid } from "@mui/material";
3
+ import { FormattedMessage } from "react-intl";
4
+ import { LineSeparator } from "./line-separator.js";
5
+ import { parametersStyles } from "../parameters-style.js";
6
+ import "@mui/icons-material";
7
+ import "react";
8
+ import "react-hook-form";
9
+ import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
10
+ import "yup";
11
+ import "notistack";
12
+ import "../../overflowableText/OverflowableText.js";
13
+ import "../../treeViewFinder/TreeViewFinder.js";
14
+ import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
15
+ import "../../customAGGrid/customAggrid.js";
16
+ import "ag-grid-community";
17
+ import "react-papaparse";
18
+ import "react-csv-downloader";
19
+ import "../../inputs/reactHookForm/numbers/RangeInput.js";
20
+ import "localized-countries";
21
+ import "localized-countries/data/fr";
22
+ import "localized-countries/data/en";
23
+ import { MuiSelectInput } from "../../inputs/reactHookForm/selectInputs/MuiSelectInput.js";
24
+ import "../../../utils/conversionUtils.js";
25
+ import "../../../utils/types/equipmentType.js";
26
+ import "../../../utils/yupConfig.js";
27
+ import "@react-querybuilder/material";
28
+ import "../../filter/expert/expertFilterConstants.js";
29
+ import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
30
+ import "uuid";
31
+ import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
32
+ import "react-querybuilder";
33
+ import { PROVIDER } from "./constant.js";
34
+ const styles = {
35
+ providerParam: {
36
+ height: "fit-content",
37
+ justifyContent: "space-between"
38
+ }
39
+ };
40
+ function ProviderParam({ options }) {
41
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
42
+ /* @__PURE__ */ jsxs(Grid, { xl: 8, container: true, sx: styles.providerParam, paddingRight: 1, children: [
43
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: true, sx: parametersStyles.parameterName, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "Provider" }) }),
44
+ /* @__PURE__ */ jsx(Grid, { item: true, container: true, xs: 2, sx: parametersStyles.controlItem, children: /* @__PURE__ */ jsx(MuiSelectInput, { name: PROVIDER, size: "small", fullWidth: true, options }) })
45
+ ] }),
46
+ /* @__PURE__ */ jsx(Grid, { container: true, paddingTop: 1, paddingRight: 1, xl: 8, children: /* @__PURE__ */ jsx(LineSeparator, {}) })
47
+ ] });
48
+ }
49
+ export {
50
+ ProviderParam
51
+ };
@@ -0,0 +1,20 @@
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 declare enum ComputingType {
8
+ LOAD_FLOW = "LOAD_FLOW",
9
+ SECURITY_ANALYSIS = "SECURITY_ANALYSIS",
10
+ SENSITIVITY_ANALYSIS = "SENSITIVITY_ANALYSIS",
11
+ NON_EVACUATED_ENERGY_ANALYSIS = "NON_EVACUATED_ENERGY_ANALYSIS",
12
+ SHORT_CIRCUIT = "SHORT_CIRCUIT",
13
+ SHORT_CIRCUIT_ONE_BUS = "SHORT_CIRCUIT_ONE_BUS",
14
+ DYNAMIC_SIMULATION = "DYNAMIC_SIMULATION",
15
+ DYNAMIC_SECURITY_ANALYSIS = "DYNAMIC_SECURITY_ANALYSIS",
16
+ VOLTAGE_INITIALIZATION = "VOLTAGE_INITIALIZATION",
17
+ STATE_ESTIMATION = "STATE_ESTIMATION"
18
+ }
19
+ export declare const isValidComputingType: (value: string | undefined) => boolean;
20
+ export declare const formatComputingTypeLabel: (type: ComputingType) => string | undefined;