@gridsuite/commons-ui 0.109.1 → 0.111.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 (68) hide show
  1. package/dist/components/csvDownloader/csv-export.d.ts +2 -0
  2. package/dist/components/csvDownloader/csv-export.js +23 -0
  3. package/dist/components/csvDownloader/csv-export.type.d.ts +16 -0
  4. package/dist/components/csvDownloader/csv-export.type.js +1 -0
  5. package/dist/components/csvDownloader/export-csv-button.d.ts +7 -0
  6. package/dist/components/csvDownloader/export-csv-button.js +33 -0
  7. package/dist/components/csvDownloader/index.d.ts +10 -0
  8. package/dist/components/csvDownloader/index.js +8 -0
  9. package/dist/components/csvDownloader/use-csv-export.d.ts +4 -0
  10. package/dist/components/csvDownloader/use-csv-export.js +52 -0
  11. package/dist/components/index.d.ts +1 -0
  12. package/dist/components/index.js +15 -2
  13. package/dist/components/inputs/index.js +3 -2
  14. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.d.ts +0 -2
  15. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +2 -5
  16. package/dist/components/inputs/reactHookForm/constants.d.ts +8 -0
  17. package/dist/components/inputs/reactHookForm/constants.js +6 -0
  18. package/dist/components/inputs/reactHookForm/index.d.ts +1 -0
  19. package/dist/components/inputs/reactHookForm/index.js +3 -2
  20. package/dist/components/parameters/common/index.js +2 -0
  21. package/dist/components/parameters/common/limitreductions/columns-definitions.d.ts +1 -1
  22. package/dist/components/parameters/common/limitreductions/columns-definitions.js +3 -1
  23. package/dist/components/parameters/common/name-element-editor/name-element-editor-utils.js +4 -3
  24. package/dist/components/parameters/common/parameters-edition-dialog-props.d.ts +4 -0
  25. package/dist/components/parameters/common/parameters-edition-dialog-props.js +14 -1
  26. package/dist/components/parameters/index.d.ts +1 -0
  27. package/dist/components/parameters/index.js +6 -0
  28. package/dist/components/parameters/loadflow/load-flow-parameters-content.js +1 -1
  29. package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +1 -1
  30. package/dist/components/parameters/loadflow/load-flow-parameters-utils.d.ts +1 -1
  31. package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +34 -4
  32. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +4 -2
  33. package/dist/components/parameters/network-visualizations/map-parameters.js +1 -1
  34. package/dist/components/parameters/network-visualizations/single-line-diagram-parameters.js +1 -1
  35. package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.js +4 -3
  36. package/dist/components/parameters/security-analysis/index.d.ts +8 -0
  37. package/dist/components/parameters/security-analysis/index.js +6 -0
  38. package/dist/components/parameters/security-analysis/security-analysis-parameters-dialog.d.ts +2 -0
  39. package/dist/components/parameters/security-analysis/security-analysis-parameters-dialog.js +107 -0
  40. package/dist/components/parameters/security-analysis/security-analysis-parameters-form.d.ts +8 -0
  41. package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +139 -0
  42. package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.d.ts +10 -0
  43. package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.js +197 -0
  44. package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.d.ts +7 -0
  45. package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.js +84 -0
  46. package/dist/components/parameters/security-analysis/security-analysis-violations-hiding.d.ts +7 -0
  47. package/dist/components/parameters/security-analysis/security-analysis-violations-hiding.js +138 -0
  48. package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.d.ts +24 -0
  49. package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.js +162 -0
  50. package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +5 -4
  51. package/dist/components/parameters/voltage-init/general-parameters.js +1 -1
  52. package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +4 -3
  53. package/dist/components/parameters/voltage-init/voltage-init-form-utils.js +2 -1
  54. package/dist/hooks/use-parameters-backend.d.ts +1 -1
  55. package/dist/index.js +26 -2
  56. package/dist/services/index.d.ts +1 -0
  57. package/dist/services/index.js +11 -0
  58. package/dist/services/security-analysis.d.ts +11 -0
  59. package/dist/services/security-analysis.js +91 -0
  60. package/dist/translations/en/parameters.d.ts +8 -0
  61. package/dist/translations/en/parameters.js +9 -1
  62. package/dist/translations/en/tableEn.d.ts +1 -0
  63. package/dist/translations/en/tableEn.js +2 -1
  64. package/dist/translations/fr/parameters.d.ts +8 -0
  65. package/dist/translations/fr/parameters.js +9 -1
  66. package/dist/translations/fr/tableFr.d.ts +1 -0
  67. package/dist/translations/fr/tableFr.js +2 -1
  68. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ import { CsvExportProps } from './csv-export.type';
2
+ export declare function CsvExport({ gridRef, columns, tableNamePrefix, tableName, disabled, skipColumnHeaders, language, exportDataAsCsv, }: CsvExportProps): JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useCallback } from "react";
3
+ import { useCsvExport } from "./use-csv-export.js";
4
+ import { ExportCsvButton } from "./export-csv-button.js";
5
+ function CsvExport({
6
+ gridRef,
7
+ columns,
8
+ tableNamePrefix = "",
9
+ tableName,
10
+ disabled,
11
+ skipColumnHeaders = false,
12
+ language,
13
+ exportDataAsCsv
14
+ }) {
15
+ const { downloadCSVData } = useCsvExport();
16
+ const download = useCallback(() => {
17
+ downloadCSVData({ gridRef, columns, tableName, tableNamePrefix, skipColumnHeaders, language, exportDataAsCsv });
18
+ }, [downloadCSVData, gridRef, columns, tableName, tableNamePrefix, skipColumnHeaders, language, exportDataAsCsv]);
19
+ return /* @__PURE__ */ jsx(ExportCsvButton, { disabled, onClick: download });
20
+ }
21
+ export {
22
+ CsvExport
23
+ };
@@ -0,0 +1,16 @@
1
+ import { RefObject } from 'react';
2
+ import { AgGridReact } from 'ag-grid-react';
3
+ import { ColDef, CsvExportParams } from 'ag-grid-community';
4
+ import { GsLang } from '../../utils';
5
+ export type CsvDownloadProps = {
6
+ gridRef: RefObject<AgGridReact>;
7
+ columns: ColDef[];
8
+ tableName: string;
9
+ tableNamePrefix?: string;
10
+ skipColumnHeaders?: boolean;
11
+ language: GsLang;
12
+ exportDataAsCsv: (params?: CsvExportParams) => void;
13
+ };
14
+ export type CsvExportProps = CsvDownloadProps & {
15
+ disabled: boolean;
16
+ };
@@ -0,0 +1,7 @@
1
+ export interface ExportButtonProps {
2
+ disabled?: boolean;
3
+ onClick: () => void;
4
+ isDownloadLoading?: boolean;
5
+ isDownloadSuccessful?: boolean;
6
+ }
7
+ export declare function ExportCsvButton({ onClick, disabled, isDownloadLoading: isCsvLoading, isDownloadSuccessful, }: Readonly<ExportButtonProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { Box, IconButton, CircularProgress } from "@mui/material";
3
+ import { FormattedMessage } from "react-intl";
4
+ import { Check, GetApp } from "@mui/icons-material";
5
+ function ExportCsvButton({
6
+ onClick,
7
+ disabled = false,
8
+ isDownloadLoading: isCsvLoading = false,
9
+ isDownloadSuccessful = false
10
+ }) {
11
+ return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center" }, children: [
12
+ /* @__PURE__ */ jsx(FormattedMessage, { id: "MuiVirtualizedTable/exportCSV" }),
13
+ /* @__PURE__ */ jsxs(Box, { sx: { position: "relative" }, children: [
14
+ /* @__PURE__ */ jsx(IconButton, { disabled, "aria-label": "exportCSVButton", onClick, children: isDownloadSuccessful ? /* @__PURE__ */ jsx(Check, {}) : /* @__PURE__ */ jsx(GetApp, {}) }),
15
+ isCsvLoading && /* @__PURE__ */ jsx(
16
+ CircularProgress,
17
+ {
18
+ size: 30,
19
+ sx: {
20
+ position: "absolute",
21
+ top: "50%",
22
+ left: "50%",
23
+ marginTop: "-15px",
24
+ marginLeft: "-15px"
25
+ }
26
+ }
27
+ )
28
+ ] })
29
+ ] });
30
+ }
31
+ export {
32
+ ExportCsvButton
33
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright (c) 2025, 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 './csv-export';
8
+ export * from './csv-export.type';
9
+ export * from './export-csv-button';
10
+ export * from './use-csv-export';
@@ -0,0 +1,8 @@
1
+ import { CsvExport } from "./csv-export.js";
2
+ import { ExportCsvButton } from "./export-csv-button.js";
3
+ import { useCsvExport } from "./use-csv-export.js";
4
+ export {
5
+ CsvExport,
6
+ ExportCsvButton,
7
+ useCsvExport
8
+ };
@@ -0,0 +1,4 @@
1
+ import { CsvDownloadProps } from './csv-export.type';
2
+ export declare const useCsvExport: () => {
3
+ downloadCSVData: (props: CsvDownloadProps) => void;
4
+ };
@@ -0,0 +1,52 @@
1
+ import { useCallback } from "react";
2
+ import { useIntl } from "react-intl";
3
+ import "../../utils/conversionUtils.js";
4
+ import { LANG_FRENCH } from "../../utils/langs.js";
5
+ import "react/jsx-runtime";
6
+ import "@mui/icons-material";
7
+ import "../../utils/types/equipmentType.js";
8
+ import "../../utils/yupConfig.js";
9
+ const NA_VALUE = "N/A";
10
+ const formatNAValue = (value, intl) => {
11
+ return value === NA_VALUE ? intl.formatMessage({ id: "export/undefined" }) : value;
12
+ };
13
+ const useCsvExport = () => {
14
+ const intl = useIntl();
15
+ const getCSVFilename = useCallback((tableName) => {
16
+ return tableName.trim().replace(/[\\/:"*?<>|\s]/g, "-").substring(0, 27);
17
+ }, []);
18
+ const downloadCSVData = useCallback(
19
+ (props) => {
20
+ const hasColId = (colId) => {
21
+ return colId !== void 0;
22
+ };
23
+ const processCell = (params) => {
24
+ if (params.column.getColId() === "limitName") {
25
+ return formatNAValue(params.value, intl);
26
+ }
27
+ if (props.language === LANG_FRENCH && typeof params.value === "number") {
28
+ return params.value.toString().replace(".", ",");
29
+ }
30
+ return params.value;
31
+ };
32
+ const prefix = props.tableNamePrefix ?? "";
33
+ props.exportDataAsCsv({
34
+ suppressQuotes: false,
35
+ columnSeparator: props.language === LANG_FRENCH ? ";" : ",",
36
+ columnKeys: props.columns.map((col) => col.colId).filter(hasColId),
37
+ skipColumnHeaders: props.skipColumnHeaders,
38
+ processHeaderCallback: (params) => {
39
+ var _a;
40
+ return ((_a = params.column.getColDef().headerComponentParams) == null ? void 0 : _a.displayName) ?? params.column.getColDef().headerName ?? params.column.getColId();
41
+ },
42
+ fileName: prefix.concat(getCSVFilename(props.tableName)),
43
+ processCellCallback: processCell
44
+ });
45
+ },
46
+ [getCSVFilename, intl]
47
+ );
48
+ return { downloadCSVData };
49
+ };
50
+ export {
51
+ useCsvExport
52
+ };
@@ -8,6 +8,7 @@ export * from './announcement';
8
8
  export * from './authentication';
9
9
  export * from './cardErrorBoundary';
10
10
  export * from './checkBoxList';
11
+ export * from './csvDownloader';
11
12
  export * from './customAGGrid';
12
13
  export * from './dialogs';
13
14
  export * from './directoryItemSelector/DirectoryItemSelector';
@@ -14,6 +14,9 @@ import { dispatchUser, getPreLoginPath, handleSigninCallback, handleSilentRenewC
14
14
  import { UserManagerMock } from "./authentication/utils/userManagerMock.js";
15
15
  import { CardErrorBoundary } from "./cardErrorBoundary/CardErrorBoundary.js";
16
16
  import { CheckBoxList } from "./checkBoxList/CheckBoxList.js";
17
+ import { CsvExport } from "./csvDownloader/csv-export.js";
18
+ import { ExportCsvButton } from "./csvDownloader/export-csv-button.js";
19
+ import { useCsvExport } from "./csvDownloader/use-csv-export.js";
17
20
  import { CUSTOM_AGGRID_THEME, styles } from "./customAGGrid/customAggrid.style.js";
18
21
  import { CustomAGGrid } from "./customAGGrid/customAggrid.js";
19
22
  import { CustomMuiDialog, unscrollableDialogStyles } from "./dialogs/customMuiDialog/CustomMuiDialog.js";
@@ -53,7 +56,7 @@ import "@mui/material";
53
56
  import "react-intl";
54
57
  import { SelectClearable } from "./inputs/SelectClearable.js";
55
58
  import { ChipItemsInput } from "./inputs/reactHookForm/chip-items-input.js";
56
- import { DESCRIPTION_INPUT, DirectoryItemsInput, NAME } from "./inputs/reactHookForm/DirectoryItemsInput.js";
59
+ import { DirectoryItemsInput } from "./inputs/reactHookForm/DirectoryItemsInput.js";
57
60
  import { RawReadOnlyInput } from "./inputs/reactHookForm/RawReadOnlyInput.js";
58
61
  import { BottomRightButtons } from "./inputs/reactHookForm/agGridTable/BottomRightButtons.js";
59
62
  import { CustomAgGridTable } from "./inputs/reactHookForm/agGridTable/CustomAgGridTable.js";
@@ -91,6 +94,7 @@ import { SubmitButton } from "./inputs/reactHookForm/utils/SubmitButton.js";
91
94
  import { TextFieldWithAdornment } from "./inputs/reactHookForm/utils/TextFieldWithAdornment.js";
92
95
  import { genHelperError, gridItem, identity, isFieldRequired, toFloatOrNullValue } from "./inputs/reactHookForm/utils/functions.js";
93
96
  import { HelperPreviousValue } from "./inputs/reactHookForm/utils/HelperPreviousValue.js";
97
+ import { DESCRIPTION, NAME } from "./inputs/reactHookForm/constants.js";
94
98
  import { AddButton } from "./inputs/reactQueryBuilder/AddButton.js";
95
99
  import { AutocompleteWithFavorites } from "./inputs/reactQueryBuilder/AutocompleteWithFavorites.js";
96
100
  import { CombinatorSelector } from "./inputs/reactQueryBuilder/CombinatorSelector.js";
@@ -125,6 +129,7 @@ import { LeftPanelCloseIcon } from "./icons/LeftPanelCloseIcon.js";
125
129
  import { DeviceHubIcon } from "./icons/DeviceHubIcon.js";
126
130
  import { ComputingType, formatComputingTypeLabel, isValidComputingType } from "./parameters/common/computing-type.js";
127
131
  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, ReactivePowerAdornment, VOLTAGE_LEVEL, VoltageAdornment } from "./parameters/common/constant.js";
132
+ import { getDialogParametersFormSchema } from "./parameters/common/parameters-edition-dialog-props.js";
128
133
  import { LineSeparator } from "./parameters/common/line-separator.js";
129
134
  import { LabelledButton, SwitchWithLabel, TabPanel } from "./parameters/common/parameters.js";
130
135
  import { CreateParameterDialog } from "./parameters/common/parameters-creation-dialog.js";
@@ -157,6 +162,8 @@ import { DEFAULT_GENERAL_APPLY_MODIFICATIONS, DEFAULT_REACTIVE_SLACKS_THRESHOLD,
157
162
  import { EquipmentsSelectionType } from "./parameters/voltage-init/voltage-init.type.js";
158
163
  import { VoltageInitParametersEditionDialog } from "./parameters/voltage-init/voltage-init-parameters-dialog.js";
159
164
  import { VoltageInitParametersInLine } from "./parameters/voltage-init/voltage-init-parameters-inline.js";
165
+ import { SecurityAnalysisParametersInline } from "./parameters/security-analysis/security-analysis-parameters-inline.js";
166
+ import { SecurityAnalysisParametersDialog } from "./parameters/security-analysis/security-analysis-parameters-dialog.js";
160
167
  import { CustomMenuItem, CustomNestedMenuItem } from "./menus/custom-nested-menu.js";
161
168
  export {
162
169
  AboutDialog,
@@ -193,6 +200,7 @@ export {
193
200
  CountryValueEditor,
194
201
  CreateParameterDialog,
195
202
  CriteriaBasedForm,
203
+ CsvExport,
196
204
  CsvUploader,
197
205
  CustomAGGrid,
198
206
  CustomAgGridTable,
@@ -214,7 +222,7 @@ export {
214
222
  DEFAULT_REACTIVE_SLACKS_THRESHOLD,
215
223
  DEFAULT_SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD,
216
224
  DEFAULT_UPDATE_BUS_VOLTAGE,
217
- DESCRIPTION_INPUT,
225
+ DESCRIPTION,
218
226
  DIAGONAL_LABEL,
219
227
  DISTRIBUTED_SLACK,
220
228
  DISTRIBUTION_KEY,
@@ -248,6 +256,7 @@ export {
248
256
  ExpertFilterForm,
249
257
  ExplicitNamingFilterEditionDialog,
250
258
  ExplicitNamingFilterForm,
259
+ ExportCsvButton,
251
260
  FIELDS_OPTIONS,
252
261
  FILTERS,
253
262
  FILTER_EQUIPMENTS,
@@ -383,6 +392,8 @@ export {
383
392
  SPECIFIC_PARAMETERS,
384
393
  SUBSTATION_LAYOUT,
385
394
  SVAR_REGULATION_MODE_OPTIONS,
395
+ SecurityAnalysisParametersDialog,
396
+ SecurityAnalysisParametersInline,
386
397
  SelectClearable,
387
398
  SelectInput,
388
399
  ShortCircuitParametersEditionDialog,
@@ -441,6 +452,7 @@ export {
441
452
  generateTreeViewFinderClass,
442
453
  getCriteriaBasedFormData,
443
454
  getCriteriaBasedSchema,
455
+ getDialogParametersFormSchema,
444
456
  getExpertFilterEmptyFormData,
445
457
  getExplicitNamingFilterEmptyFormData,
446
458
  getLimitReductionsFormSchema,
@@ -480,6 +492,7 @@ export {
480
492
  toFormValuesLimitReductions,
481
493
  unscrollableDialogStyles,
482
494
  useConvertValue,
495
+ useCsvExport,
483
496
  useCustomFormContext,
484
497
  useElementSearch,
485
498
  useGlobalAnnouncement,
@@ -1,6 +1,6 @@
1
1
  import { SelectClearable } from "./SelectClearable.js";
2
2
  import { ChipItemsInput } from "./reactHookForm/chip-items-input.js";
3
- import { DESCRIPTION_INPUT, DirectoryItemsInput, NAME } from "./reactHookForm/DirectoryItemsInput.js";
3
+ import { DirectoryItemsInput } from "./reactHookForm/DirectoryItemsInput.js";
4
4
  import { RawReadOnlyInput } from "./reactHookForm/RawReadOnlyInput.js";
5
5
  import { BottomRightButtons } from "./reactHookForm/agGridTable/BottomRightButtons.js";
6
6
  import { CustomAgGridTable } from "./reactHookForm/agGridTable/CustomAgGridTable.js";
@@ -38,6 +38,7 @@ import { SubmitButton } from "./reactHookForm/utils/SubmitButton.js";
38
38
  import { TextFieldWithAdornment } from "./reactHookForm/utils/TextFieldWithAdornment.js";
39
39
  import { genHelperError, gridItem, identity, isFieldRequired, toFloatOrNullValue } from "./reactHookForm/utils/functions.js";
40
40
  import { HelperPreviousValue } from "./reactHookForm/utils/HelperPreviousValue.js";
41
+ import { DESCRIPTION, NAME } from "./reactHookForm/constants.js";
41
42
  import { AddButton } from "./reactQueryBuilder/AddButton.js";
42
43
  import { AutocompleteWithFavorites } from "./reactQueryBuilder/AutocompleteWithFavorites.js";
43
44
  import { CombinatorSelector } from "./reactQueryBuilder/CombinatorSelector.js";
@@ -74,7 +75,7 @@ export {
74
75
  CustomFormProvider,
75
76
  CustomReactQueryBuilder,
76
77
  DEFAULT_RANGE_VALUE,
77
- DESCRIPTION_INPUT,
78
+ DESCRIPTION,
78
79
  DescriptionField,
79
80
  DirectoryItemsInput,
80
81
  ElementValueEditor,
@@ -1,6 +1,4 @@
1
1
  import { ElementAttributes } from '../../../utils';
2
- export declare const NAME = "name";
3
- export declare const DESCRIPTION_INPUT = "description";
4
2
  export interface DirectoryItemsInputProps {
5
3
  label: string | undefined;
6
4
  name: string;
@@ -15,8 +15,7 @@ import { OverflowableText } from "../../overflowableText/OverflowableText.js";
15
15
  import { MidFormError } from "./errorManagement/MidFormError.js";
16
16
  import { DirectoryItemSelector } from "../../directoryItemSelector/DirectoryItemSelector.js";
17
17
  import { fetchDirectoryElementPath } from "../../../services/directory.js";
18
- const NAME = "name";
19
- const DESCRIPTION_INPUT = "description";
18
+ import { NAME } from "./constants.js";
20
19
  const styles = {
21
20
  formDirectoryElements1: {
22
21
  display: "flex",
@@ -213,7 +212,5 @@ function DirectoryItemsInput({
213
212
  ] });
214
213
  }
215
214
  export {
216
- DESCRIPTION_INPUT,
217
- DirectoryItemsInput,
218
- NAME
215
+ DirectoryItemsInput
219
216
  };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright (c) 2025, 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 const NAME = "name";
8
+ export declare const DESCRIPTION = "description";
@@ -0,0 +1,6 @@
1
+ const NAME = "name";
2
+ const DESCRIPTION = "description";
3
+ export {
4
+ DESCRIPTION,
5
+ NAME
6
+ };
@@ -17,3 +17,4 @@ export * from './selectInputs';
17
17
  export * from './tableInputs';
18
18
  export * from './text';
19
19
  export * from './utils';
20
+ export * from './constants';
@@ -1,5 +1,5 @@
1
1
  import { ChipItemsInput } from "./chip-items-input.js";
2
- import { DESCRIPTION_INPUT, DirectoryItemsInput, NAME } from "./DirectoryItemsInput.js";
2
+ import { DirectoryItemsInput } from "./DirectoryItemsInput.js";
3
3
  import { RawReadOnlyInput } from "./RawReadOnlyInput.js";
4
4
  import { BottomRightButtons } from "./agGridTable/BottomRightButtons.js";
5
5
  import { CustomAgGridTable } from "./agGridTable/CustomAgGridTable.js";
@@ -37,6 +37,7 @@ import { SubmitButton } from "./utils/SubmitButton.js";
37
37
  import { TextFieldWithAdornment } from "./utils/TextFieldWithAdornment.js";
38
38
  import { genHelperError, gridItem, identity, isFieldRequired, toFloatOrNullValue } from "./utils/functions.js";
39
39
  import { HelperPreviousValue } from "./utils/HelperPreviousValue.js";
40
+ import { DESCRIPTION, NAME } from "./constants.js";
40
41
  export {
41
42
  AutocompleteInput,
42
43
  BooleanInput,
@@ -50,7 +51,7 @@ export {
50
51
  CustomFormContext,
51
52
  CustomFormProvider,
52
53
  DEFAULT_RANGE_VALUE,
53
- DESCRIPTION_INPUT,
54
+ DESCRIPTION,
54
55
  DescriptionField,
55
56
  DirectoryItemsInput,
56
57
  ErrorInput,
@@ -1,5 +1,6 @@
1
1
  import { ComputingType, formatComputingTypeLabel, isValidComputingType } from "./computing-type.js";
2
2
  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, ReactivePowerAdornment, VOLTAGE_LEVEL, VoltageAdornment } from "./constant.js";
3
+ import { getDialogParametersFormSchema } from "./parameters-edition-dialog-props.js";
3
4
  import { LineSeparator } from "./line-separator.js";
4
5
  import { LabelledButton, SwitchWithLabel, TabPanel } from "./parameters.js";
5
6
  import { CreateParameterDialog } from "./parameters-creation-dialog.js";
@@ -54,6 +55,7 @@ export {
54
55
  VOLTAGE_LEVELS_FORM,
55
56
  VoltageAdornment,
56
57
  formatComputingTypeLabel,
58
+ getDialogParametersFormSchema,
57
59
  getLimitReductionsFormSchema,
58
60
  getSAParametersFromSchema,
59
61
  isValidComputingType,
@@ -58,7 +58,7 @@ export declare const getLimitReductionsFormSchema: (nbTemporaryLimits: number) =
58
58
  }, yup.AnyObject, {
59
59
  limitReductionsForm: "";
60
60
  }, "">;
61
- export declare const getSAParametersFromSchema: (limitReductions?: ILimitReductionsByVoltageLevel[]) => yup.ObjectSchema<{
61
+ export declare const getSAParametersFromSchema: (name: string | null, limitReductions?: ILimitReductionsByVoltageLevel[]) => yup.ObjectSchema<{
62
62
  flowProportionalThreshold: unknown;
63
63
  lowVoltageProportionalThreshold: unknown;
64
64
  lowVoltageAbsoluteThreshold: unknown;
@@ -1,5 +1,6 @@
1
1
  import "../../../../utils/yupConfig.js";
2
2
  import { PARAM_SA_PROVIDER, 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_FLOW_PROPORTIONAL_THRESHOLD } from "../constant.js";
3
+ import { getDialogParametersFormSchema } from "../parameters-edition-dialog-props.js";
3
4
  import * as yup from "yup";
4
5
  const LIMIT_REDUCTIONS_FORM = "limitReductionsForm";
5
6
  const VOLTAGE_LEVELS_FORM = "voltageLevelsForm";
@@ -50,7 +51,7 @@ const getLimitReductionsFormSchema = (nbTemporaryLimits) => {
50
51
  )
51
52
  }).required();
52
53
  };
53
- const getSAParametersFromSchema = (limitReductions) => {
54
+ const getSAParametersFromSchema = (name, limitReductions) => {
54
55
  const providerSchema = yup.object().shape({
55
56
  [PARAM_SA_PROVIDER]: yup.string().required()
56
57
  });
@@ -65,6 +66,7 @@ const getSAParametersFromSchema = (limitReductions) => {
65
66
  [PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD]: yup.number().required()
66
67
  });
67
68
  return yup.object().shape({
69
+ ...getDialogParametersFormSchema(name),
68
70
  ...providerSchema.fields,
69
71
  ...limitReductionsSchema.fields,
70
72
  ...thresholdsSchema.fields
@@ -13,7 +13,8 @@ import "../../../inputs/reactHookForm/provider/CustomFormProvider.js";
13
13
  import "@mui/icons-material";
14
14
  import * as yup from "yup";
15
15
  import "../../../overflowableText/OverflowableText.js";
16
- import { DESCRIPTION_INPUT, NAME } from "../../../inputs/reactHookForm/DirectoryItemsInput.js";
16
+ import "../../../treeViewFinder/TreeViewFinder.js";
17
+ import { DESCRIPTION, NAME } from "../../../inputs/reactHookForm/constants.js";
17
18
  import "../../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
18
19
  import "../../../customAGGrid/customAggrid.js";
19
20
  import "ag-grid-community";
@@ -30,7 +31,7 @@ import "react-querybuilder";
30
31
  function getNameElementEditorEmptyFormData(initialElementName, initialElementdescripton) {
31
32
  return {
32
33
  [NAME]: initialElementName,
33
- [DESCRIPTION_INPUT]: initialElementdescripton
34
+ [DESCRIPTION]: initialElementdescripton
34
35
  };
35
36
  }
36
37
  function getNameElementEditorSchema(initialElementName) {
@@ -40,7 +41,7 @@ function getNameElementEditorSchema(initialElementName) {
40
41
  then: () => yup.string().required(),
41
42
  otherwise: () => yup.string()
42
43
  }),
43
- [DESCRIPTION_INPUT]: yup.string()
44
+ [DESCRIPTION]: yup.string()
44
45
  });
45
46
  }
46
47
  export {
@@ -1,5 +1,6 @@
1
1
  import { UUID } from 'crypto';
2
2
  import { User } from 'oidc-client';
3
+ import { default as yup } from '../../../utils/yupConfig';
3
4
  export interface ParametersEditionDialogProps {
4
5
  id: UUID;
5
6
  open: boolean;
@@ -12,3 +13,6 @@ export interface ParametersEditionDialogProps {
12
13
  user: User | null;
13
14
  enableDeveloperMode?: boolean;
14
15
  }
16
+ export declare const getDialogParametersFormSchema: (name: string | null) => {
17
+ [key: string]: yup.AnySchema;
18
+ };
@@ -1 +1,14 @@
1
-
1
+ import "../../../utils/yupConfig.js";
2
+ import { NAME, DESCRIPTION } from "../../inputs/reactHookForm/constants.js";
3
+ import * as yup from "yup";
4
+ const getDialogParametersFormSchema = (name) => {
5
+ const shape = {};
6
+ if (name) {
7
+ shape[NAME] = yup.string().required();
8
+ shape[DESCRIPTION] = yup.string();
9
+ }
10
+ return shape;
11
+ };
12
+ export {
13
+ getDialogParametersFormSchema
14
+ };
@@ -10,3 +10,4 @@ export * from './parameters-style';
10
10
  export * from './loadflow';
11
11
  export * from './short-circuit';
12
12
  export * from './voltage-init';
13
+ export * from './security-analysis';
@@ -1,5 +1,6 @@
1
1
  import { ComputingType, formatComputingTypeLabel, isValidComputingType } from "./common/computing-type.js";
2
2
  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, ReactivePowerAdornment, VOLTAGE_LEVEL, VoltageAdornment } from "./common/constant.js";
3
+ import { getDialogParametersFormSchema } from "./common/parameters-edition-dialog-props.js";
3
4
  import { LineSeparator } from "./common/line-separator.js";
4
5
  import { LabelledButton, SwitchWithLabel, TabPanel } from "./common/parameters.js";
5
6
  import { CreateParameterDialog } from "./common/parameters-creation-dialog.js";
@@ -32,6 +33,8 @@ import { DEFAULT_GENERAL_APPLY_MODIFICATIONS, DEFAULT_REACTIVE_SLACKS_THRESHOLD,
32
33
  import { EquipmentsSelectionType } from "./voltage-init/voltage-init.type.js";
33
34
  import { VoltageInitParametersEditionDialog } from "./voltage-init/voltage-init-parameters-dialog.js";
34
35
  import { VoltageInitParametersInLine } from "./voltage-init/voltage-init-parameters-inline.js";
36
+ import { SecurityAnalysisParametersInline } from "./security-analysis/security-analysis-parameters-inline.js";
37
+ import { SecurityAnalysisParametersDialog } from "./security-analysis/security-analysis-parameters-dialog.js";
35
38
  export {
36
39
  BALANCE_TYPE,
37
40
  CENTER_LABEL,
@@ -141,6 +144,8 @@ export {
141
144
  SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON,
142
145
  SPECIFIC_PARAMETERS,
143
146
  SUBSTATION_LAYOUT,
147
+ SecurityAnalysisParametersDialog,
148
+ SecurityAnalysisParametersInline,
144
149
  ShortCircuitParametersEditionDialog,
145
150
  ShortCircuitParametersInLine,
146
151
  SubstationLayout,
@@ -167,6 +172,7 @@ export {
167
172
  WRITE_SLACK_BUS,
168
173
  alertThresholdMarks,
169
174
  formatComputingTypeLabel,
175
+ getDialogParametersFormSchema,
170
176
  getLimitReductionsFormSchema,
171
177
  getSAParametersFromSchema,
172
178
  getTabIndicatorStyle,
@@ -2,6 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Box, Grid } from "@mui/material";
3
3
  import { TabValues } from "./load-flow-parameters-utils.js";
4
4
  import LoadFlowGeneralParameters from "./load-flow-general-parameters.js";
5
+ import "../../../utils/yupConfig.js";
5
6
  import { TabPanel } from "../common/parameters.js";
6
7
  import "react";
7
8
  import "react-intl";
@@ -26,7 +27,6 @@ import "react-papaparse";
26
27
  import "react-csv-downloader";
27
28
  import "../../inputs/reactHookForm/numbers/RangeInput.js";
28
29
  import "../../../utils/conversionUtils.js";
29
- import "../../../utils/yupConfig.js";
30
30
  import "@react-querybuilder/material";
31
31
  import "../../filter/expert/expertFilterConstants.js";
32
32
  import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
@@ -12,6 +12,7 @@ import "../../treeViewFinder/TreeViewFinder.js";
12
12
  import "notistack";
13
13
  import { getLoadFlowDefaultLimitReductions, getLoadFlowSpecificParametersDescription, setLoadFlowParameters, fetchLoadFlowParameters, getDefaultLoadFlowProvider, getLoadFlowProviders } from "../../../services/loadflow.js";
14
14
  import { ComputingType } from "../common/computing-type.js";
15
+ import "../../../utils/yupConfig.js";
15
16
  import "../../../utils/types/equipmentType.js";
16
17
  import "localized-countries";
17
18
  import "localized-countries/data/fr";
@@ -28,7 +29,6 @@ import "react-papaparse";
28
29
  import "react-csv-downloader";
29
30
  import "../../inputs/reactHookForm/numbers/RangeInput.js";
30
31
  import "../../../utils/conversionUtils.js";
31
- import "../../../utils/yupConfig.js";
32
32
  import "@react-querybuilder/material";
33
33
  import "../../filter/expert/expertFilterConstants.js";
34
34
  import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
@@ -1,5 +1,5 @@
1
1
  import { UseFormReturn } from 'react-hook-form';
2
- import { ILimitReductionsByVoltageLevel } from '../common/limitreductions/columns-definitions';
2
+ import { ILimitReductionsByVoltageLevel } from '../common';
3
3
  import { default as yup } from '../../../utils/yupConfig';
4
4
  import { SpecificParameterInfos } from '../../../utils/types/parameters.type';
5
5
  import { SpecificParametersPerProvider } from '../../../utils/types/loadflow.type';
@@ -1,9 +1,39 @@
1
- import { LIMIT_REDUCTIONS_FORM, IST_FORM, LIMIT_DURATION_FORM } from "../common/limitreductions/columns-definitions.js";
2
- import { HVDC_AC_EMULATION, CONNECTED_COMPONENT_MODE, COUNTRIES_TO_BALANCE, BALANCE_TYPE, DC, PHASE_SHIFTER_REGULATION_ON, DC_POWER_FACTOR, DC_USE_TRANSFORMER_RATIO, SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON, DISTRIBUTED_SLACK, WRITE_SLACK_BUS, READ_SLACK_BUS, TWT_SPLIT_SHUNT_ADMITTANCE, USE_REACTIVE_LIMITS, VOLTAGE_INIT_MODE, COMMON_PARAMETERS, SPECIFIC_PARAMETERS, PARAM_PROVIDER_OPENLOADFLOW, PARAM_LIMIT_REDUCTION, DEFAULT_LIMIT_REDUCTION_VALUE } from "./constants.js";
3
- import { toFormValuesLimitReductions } from "../common/limitreductions/limit-reductions-form-util.js";
4
1
  import "../../../utils/yupConfig.js";
5
- import { ParameterType } from "../../../utils/types/parameters.type.js";
2
+ import "react/jsx-runtime";
3
+ import "@mui/material";
4
+ import "react-intl";
5
+ import "react";
6
+ import "../../../utils/types/equipmentType.js";
7
+ import "localized-countries";
8
+ import "localized-countries/data/fr";
9
+ import "localized-countries/data/en";
10
+ import "notistack";
11
+ import "react-hook-form";
12
+ import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
13
+ import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
14
+ import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
15
+ import "@mui/icons-material";
16
+ import "../../treeViewFinder/TreeViewFinder.js";
6
17
  import * as yup from "yup";
18
+ import "../../overflowableText/OverflowableText.js";
19
+ import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
20
+ import "../../customAGGrid/customAggrid.js";
21
+ import "ag-grid-community";
22
+ import "react-papaparse";
23
+ import "react-csv-downloader";
24
+ import "../../inputs/reactHookForm/numbers/RangeInput.js";
25
+ import "../../../utils/conversionUtils.js";
26
+ import { ParameterType } from "../../../utils/types/parameters.type.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 "../common/widget/parameter-line-slider.js";
34
+ import { LIMIT_REDUCTIONS_FORM, IST_FORM, LIMIT_DURATION_FORM } from "../common/limitreductions/columns-definitions.js";
35
+ import { toFormValuesLimitReductions } from "../common/limitreductions/limit-reductions-form-util.js";
36
+ import { HVDC_AC_EMULATION, CONNECTED_COMPONENT_MODE, COUNTRIES_TO_BALANCE, BALANCE_TYPE, DC, PHASE_SHIFTER_REGULATION_ON, DC_POWER_FACTOR, DC_USE_TRANSFORMER_RATIO, SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON, DISTRIBUTED_SLACK, WRITE_SLACK_BUS, READ_SLACK_BUS, TWT_SPLIT_SHUNT_ADMITTANCE, USE_REACTIVE_LIMITS, VOLTAGE_INIT_MODE, COMMON_PARAMETERS, SPECIFIC_PARAMETERS, PARAM_PROVIDER_OPENLOADFLOW, PARAM_LIMIT_REDUCTION, DEFAULT_LIMIT_REDUCTION_VALUE } from "./constants.js";
7
37
  var TabValues = /* @__PURE__ */ ((TabValues2) => {
8
38
  TabValues2["GENERAL"] = "General";
9
39
  TabValues2["LIMIT_REDUCTIONS"] = "LimitReductions";