@gridsuite/commons-ui 0.139.0 → 0.141.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 (59) hide show
  1. package/dist/components/csvDownloader/csv-export.d.ts +1 -1
  2. package/dist/components/csvDownloader/csv-export.js +5 -14
  3. package/dist/components/csvDownloader/csv-export.type.d.ts +1 -1
  4. package/dist/components/csvDownloader/use-csv-export.d.ts +1 -1
  5. package/dist/components/csvDownloader/use-csv-export.js +11 -11
  6. package/dist/components/customAGGrid/cell-renderers.d.ts +26 -0
  7. package/dist/components/customAGGrid/cell-renderers.js +199 -0
  8. package/dist/components/customAGGrid/index.d.ts +1 -0
  9. package/dist/components/customAGGrid/index.js +9 -0
  10. package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.js +2 -2
  11. package/dist/components/dialogs/descriptionModificationDialog/DescriptionModificationDialog.d.ts +1 -1
  12. package/dist/components/dialogs/modifyElementSelection/ModifyElementSelection.js +3 -0
  13. package/dist/components/directoryItemSelector/DirectoryItemSelector.js +5 -2
  14. package/dist/components/directoryItemSelector/utils.js +2 -1
  15. package/dist/components/filter/FilterCreationDialog.js +2 -1
  16. package/dist/components/filter/FilterForm.d.ts +16 -2
  17. package/dist/components/filter/FilterForm.js +5 -10
  18. package/dist/components/filter/HeaderFilterForm.d.ts +7 -11
  19. package/dist/components/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js +8 -1
  20. package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.d.ts +3 -1
  21. package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.js +9 -2
  22. package/dist/components/index.d.ts +2 -0
  23. package/dist/components/index.js +15 -0
  24. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.d.ts +2 -1
  25. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +44 -55
  26. package/dist/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.js +1 -0
  27. package/dist/components/inputs/reactQueryBuilder/ElementValueEditor.js +1 -1
  28. package/dist/components/muiTable/OverflowableTableCell.d.ts +3 -0
  29. package/dist/components/muiTable/OverflowableTableCell.js +10 -0
  30. package/dist/components/muiTable/OverflowableTableCellWithCheckbox.d.ts +6 -0
  31. package/dist/components/muiTable/OverflowableTableCellWithCheckbox.js +16 -0
  32. package/dist/components/muiTable/index.d.ts +8 -0
  33. package/dist/components/muiTable/index.js +6 -0
  34. package/dist/components/parameters/common/parameters-creation-dialog.js +1 -1
  35. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +1 -1
  36. package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.js +1 -1
  37. package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +1 -1
  38. package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +1 -1
  39. package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +1 -1
  40. package/dist/components/resizablePanels/ResizeHandle.d.ts +8 -0
  41. package/dist/components/resizablePanels/ResizeHandle.js +32 -0
  42. package/dist/components/resizablePanels/index.d.ts +7 -0
  43. package/dist/components/resizablePanels/index.js +4 -0
  44. package/dist/components/topBar/GridLogo.d.ts +4 -2
  45. package/dist/components/topBar/GridLogo.js +39 -21
  46. package/dist/components/topBar/TopBar.d.ts +2 -1
  47. package/dist/components/topBar/TopBar.js +81 -65
  48. package/dist/index.js +25 -5
  49. package/dist/services/config.d.ts +10 -0
  50. package/dist/services/config.js +34 -0
  51. package/dist/services/directory.d.ts +6 -4
  52. package/dist/services/directory.js +17 -32
  53. package/dist/services/index.d.ts +5 -4
  54. package/dist/services/index.js +8 -5
  55. package/dist/utils/index.d.ts +1 -0
  56. package/dist/utils/index.js +2 -0
  57. package/dist/utils/navigator-clipboard.d.ts +7 -0
  58. package/dist/utils/navigator-clipboard.js +16 -0
  59. package/package.json +2 -1
@@ -20,6 +20,7 @@ import { useCsvExport } from "./csvDownloader/use-csv-export.js";
20
20
  import { CUSTOM_AGGRID_THEME, styles } from "./customAGGrid/customAggrid.style.js";
21
21
  import { CustomAGGrid } from "./customAGGrid/customAggrid.js";
22
22
  import { SeparatorCellRenderer } from "./customAGGrid/separatorCellRenderer.js";
23
+ import { BooleanCellRenderer, BooleanNullableCellRenderer, ContingencyCellRenderer, DefaultCellRenderer, ErrorCellRenderer, MessageLogCellRenderer, NetworkModificationNameCellRenderer, NumericCellRenderer } from "./customAGGrid/cell-renderers.js";
23
24
  import { CustomMuiDialog, unscrollableDialogStyles } from "./dialogs/customMuiDialog/CustomMuiDialog.js";
24
25
  import { DescriptionModificationDialog } from "./dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
25
26
  import { ElementSaveDialog } from "./dialogs/elementSaveDialog/ElementSaveDialog.js";
@@ -172,6 +173,9 @@ import { SensitivityAnalysisParametersDialog } from "./parameters/sensi/sensitiv
172
173
  import { COLUMNS_DEFINITIONS_HVDCS, COLUMNS_DEFINITIONS_INJECTIONS, COLUMNS_DEFINITIONS_INJECTIONS_SET, COLUMNS_DEFINITIONS_NODES, COLUMNS_DEFINITIONS_PSTS, EQUIPMENTS_IN_VOLTAGE_REGULATION_TYPES, HVDC_EQUIPMENT_TYPES, INJECTIONS_EQUIPMENT_TYPES, INJECTION_DISTRIBUTION_TYPES, MONITORED_BRANCHES_EQUIPMENT_TYPES, MONITORED_VOLTAGE_LEVELS_EQUIPMENT_TYPES, PSTS_EQUIPMENT_TYPES, SENSITIVITY_TYPES, SensiBranchesTabValues, SensiHvdcs, SensiInjection, SensiInjectionsSet, SensiNodes, SensiPsts, SensiTabValues } from "./parameters/sensi/columns-definitions.js";
173
174
  import { SensitivityTable } from "./parameters/sensi/sensitivity-table.js";
174
175
  import { CustomMenuItem, CustomNestedMenuItem } from "./menus/custom-nested-menu.js";
176
+ import { OverflowableTableCell } from "./muiTable/OverflowableTableCell.js";
177
+ import { OverflowableTableCellWithCheckbox } from "./muiTable/OverflowableTableCellWithCheckbox.js";
178
+ import { ResizeHandle } from "./resizablePanels/ResizeHandle.js";
175
179
  export {
176
180
  AboutDialog,
177
181
  ActivableChip,
@@ -184,7 +188,9 @@ export {
184
188
  AutocompleteInput,
185
189
  AutocompleteWithFavorites,
186
190
  BALANCE_TYPE,
191
+ BooleanCellRenderer,
187
192
  BooleanInput,
193
+ BooleanNullableCellRenderer,
188
194
  BottomRightButtons,
189
195
  CENTER_LABEL,
190
196
  COLUMNS_DEFINITIONS_HVDCS,
@@ -209,6 +215,7 @@ export {
209
215
  CombinatorSelector,
210
216
  CombinatorType,
211
217
  ComputingType,
218
+ ContingencyCellRenderer,
212
219
  CountriesInput,
213
220
  CountryValueEditor,
214
221
  CreateParameterDialog,
@@ -239,6 +246,7 @@ export {
239
246
  DISTRIBUTED_SLACK,
240
247
  DISTRIBUTION_KEY,
241
248
  DataType,
249
+ DefaultCellRenderer,
242
250
  DescriptionField,
243
251
  DescriptionModificationDialog,
244
252
  DevModeBanner,
@@ -261,6 +269,7 @@ export {
261
269
  ElementValueEditor,
262
270
  EquipmentItem,
263
271
  EquipmentsSelectionType,
272
+ ErrorCellRenderer,
264
273
  ErrorInLogoutAlert,
265
274
  ErrorInUserValidationAlert,
266
275
  ErrorInput,
@@ -328,6 +337,7 @@ export {
328
337
  MIN_VALUE_ALLOWED_FOR_LIMIT_REDUCTION,
329
338
  MONITORED_BRANCHES_EQUIPMENT_TYPES,
330
339
  MONITORED_VOLTAGE_LEVELS_EQUIPMENT_TYPES,
340
+ MessageLogCellRenderer,
331
341
  MidFormError,
332
342
  ModifyElementSelection,
333
343
  MuiSelectInput,
@@ -338,16 +348,20 @@ export {
338
348
  NAME,
339
349
  NO_ITEM_SELECTION_FOR_COPY,
340
350
  NadPositionsGenerationMode,
351
+ NetworkModificationNameCellRenderer,
341
352
  NetworkVisualizationParametersInline,
342
353
  NetworkVisualizationTabValues,
343
354
  NetworkVisualizationsParametersEditionDialog,
344
355
  NotificationsContext,
345
356
  NotificationsProvider,
357
+ NumericCellRenderer,
346
358
  NumericEditor,
347
359
  OPERATOR_OPTIONS,
348
360
  OperatorType,
349
361
  OverflowableChip,
350
362
  OverflowableChipWithHelperText,
363
+ OverflowableTableCell,
364
+ OverflowableTableCellWithCheckbox,
351
365
  OverflowableText,
352
366
  PARAM_CENTER_LABEL,
353
367
  PARAM_COMPONENT_LIBRARY,
@@ -396,6 +410,7 @@ export {
396
410
  RawReadOnlyInput,
397
411
  ReactivePowerAdornment,
398
412
  RemoveButton,
413
+ ResizeHandle,
399
414
  RuleValueEditor,
400
415
  SELECTED,
401
416
  SELECTION_TYPE,
@@ -16,9 +16,10 @@ export interface DirectoryItemsInputProps<CP extends OverflowableChipProps = Ove
16
16
  labelRequiredFromContext?: boolean;
17
17
  ChipComponent?: ComponentType<CP>;
18
18
  chipProps?: Partial<CP>;
19
+ fullHeight?: boolean;
19
20
  }
20
21
  export declare function DirectoryItemsInput<CP extends OverflowableChipProps = OverflowableChipProps>({ label, name, elementType, // Used to specify type of element (Filter, Contingency list, ...)
21
22
  equipmentTypes, // Mostly used for filters, it allows the user to get elements of specific equipment only
22
23
  itemFilter, // Used to further filter the results displayed according to specific requirement
23
24
  titleId, // title of directory item selector dialogue
24
- hideErrorMessage, onRowChanged, onChange, disable, allowMultiSelect, labelRequiredFromContext, ChipComponent, chipProps, }: Readonly<DirectoryItemsInputProps<CP>>): import("react/jsx-runtime").JSX.Element;
25
+ hideErrorMessage, onRowChanged, onChange, disable, allowMultiSelect, labelRequiredFromContext, ChipComponent, chipProps, fullHeight, }: Readonly<DirectoryItemsInputProps<CP>>): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { FormControl, Grid, Tooltip, IconButton } from "@mui/material";
2
+ import { FormControl, Tooltip, IconButton } from "@mui/material";
3
3
  import { Folder } from "@mui/icons-material";
4
4
  import { useState, useMemo, useCallback, useEffect } from "react";
5
5
  import { useFieldArray, useWatch, useController } from "react-hook-form";
@@ -11,46 +11,35 @@ import { useCustomFormContext } from "./provider/useCustomFormContext.js";
11
11
  import { ErrorInput } from "./errorManagement/ErrorInput.js";
12
12
  import { MidFormError } from "./errorManagement/MidFormError.js";
13
13
  import "../../../utils/types/equipmentType.js";
14
+ import "../../../utils/conversionUtils.js";
15
+ import { mergeSx } from "../../../utils/styles.js";
16
+ import { ArrayAction } from "../../../utils/types/types.js";
17
+ import { getEquipmentTypeShortLabel } from "../../../utils/labelUtils.js";
18
+ import "../../../utils/yupConfig.js";
14
19
  import { fetchDirectoryElementPath } from "../../../services/directory.js";
15
20
  import "localized-countries";
16
21
  import "localized-countries/data/fr";
17
22
  import "localized-countries/data/en";
18
23
  import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
19
24
  import { DirectoryItemSelector } from "../../directoryItemSelector/DirectoryItemSelector.js";
20
- import "../../../utils/conversionUtils.js";
21
- import { mergeSx } from "../../../utils/styles.js";
22
- import { ArrayAction } from "../../../utils/types/types.js";
23
- import { getEquipmentTypeShortLabel } from "../../../utils/labelUtils.js";
24
- import "../../../utils/yupConfig.js";
25
25
  import { NAME } from "./constants.js";
26
26
  import { OverflowableChip } from "./OverflowableChip.js";
27
- import { RawReadOnlyInput } from "./RawReadOnlyInput.js";
28
27
  const styles = {
29
- formDirectoryElements1: {
28
+ formDirectoryElements: {
30
29
  display: "flex",
31
30
  gap: "8px",
32
31
  flexWrap: "wrap",
33
32
  flexDirection: "row",
33
+ alignContent: "flex-start",
34
+ alignItems: "center",
34
35
  border: "2px solid lightgray",
35
- padding: "4px",
36
+ padding: "2px 8px",
36
37
  borderRadius: "4px",
37
38
  overflow: "hidden"
38
39
  },
39
40
  formDirectoryElementsError: (theme) => ({
40
41
  borderColor: theme.palette.error.main
41
- }),
42
- formDirectoryElements2: {
43
- display: "flex",
44
- gap: "8px",
45
- flexWrap: "wrap",
46
- flexDirection: "row",
47
- marginTop: 0,
48
- padding: "4px",
49
- overflow: "hidden"
50
- },
51
- addDirectoryElements: {
52
- marginTop: "-5px"
53
- }
42
+ })
54
43
  };
55
44
  function DirectoryItemsInput({
56
45
  label,
@@ -70,7 +59,8 @@ function DirectoryItemsInput({
70
59
  allowMultiSelect = true,
71
60
  labelRequiredFromContext = true,
72
61
  ChipComponent = OverflowableChip,
73
- chipProps
62
+ chipProps,
63
+ fullHeight
74
64
  }) {
75
65
  const { snackError } = useSnackMessage();
76
66
  const intl = useIntl();
@@ -124,10 +114,11 @@ function DirectoryItemsInput({
124
114
  );
125
115
  const removeElements = useCallback(
126
116
  (index) => {
127
- const currentValues = getValues(name);
117
+ const elemToRemove = getValues(name)[index];
128
118
  remove(index);
119
+ const newElems = getValues(name);
129
120
  onRowChanged?.(true);
130
- onChange?.(currentValues, ArrayAction.REMOVE, currentValues[index]);
121
+ onChange?.(newElems, ArrayAction.REMOVE, elemToRemove);
131
122
  },
132
123
  [onRowChanged, remove, getValues, name, onChange]
133
124
  );
@@ -173,31 +164,41 @@ function DirectoryItemsInput({
173
164
  FormControl,
174
165
  {
175
166
  sx: mergeSx(
176
- styles.formDirectoryElements1,
167
+ styles.formDirectoryElements,
177
168
  // @ts-expect-error
178
- error?.message && styles.formDirectoryElementsError
169
+ error?.message && styles.formDirectoryElementsError,
170
+ fullHeight && { height: "100%" }
179
171
  ),
180
172
  error: !!error?.message,
181
173
  children: [
182
- elements?.length === 0 && label && /* @__PURE__ */ jsx(
183
- FieldLabel,
174
+ /* @__PURE__ */ jsx(Tooltip, { title: intl.formatMessage({ id: titleId }), children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
175
+ IconButton,
184
176
  {
185
- label,
186
- optional: labelRequiredFromContext && !isFieldRequired(name, validationSchema, getValues())
177
+ size: "small",
178
+ disabled: disable,
179
+ onClick: () => {
180
+ if (shouldReplaceElement) {
181
+ handleChipClick(0);
182
+ } else {
183
+ setDirectoryItemSelectorOpen(true);
184
+ if (allowMultiSelect) {
185
+ setMultiSelect(true);
186
+ }
187
+ }
188
+ },
189
+ children: /* @__PURE__ */ jsx(Folder, {})
187
190
  }
188
- ),
189
- elements?.length > 0 && /* @__PURE__ */ jsx(FormControl, { sx: styles.formDirectoryElements2, children: elements.map((item, index) => {
191
+ ) }) }),
192
+ elements?.map((item, index) => {
190
193
  const elementName = watchedElements?.[index]?.[NAME] ?? getValues(`${name}.${index}.${NAME}`) ?? item?.[NAME];
191
- const equipmentTypeShortLabel = getEquipmentTypeShortLabel(
192
- item?.specificMetadata?.equipmentType
193
- );
194
+ const equipmentTypeShortLabel = getEquipmentTypeShortLabel(item?.specificMetadata?.equipmentType);
194
195
  const { sx: chipSx, ...otherChipProps } = chipProps ?? {};
195
196
  return /* @__PURE__ */ jsx(
196
197
  ChipComponent,
197
198
  {
198
199
  onDelete: () => removeElements(index),
199
200
  onClick: () => handleChipClick(index),
200
- label: elementName ? /* @__PURE__ */ jsx(RawReadOnlyInput, { name: `${name}.${index}.${NAME}` }) : intl.formatMessage({ id: "elementNotFound" }),
201
+ label: elementName || intl.formatMessage({ id: "elementNotFound" }),
201
202
  ...equipmentTypeShortLabel && {
202
203
  helperText: intl.formatMessage({
203
204
  id: equipmentTypeShortLabel
@@ -215,26 +216,14 @@ function DirectoryItemsInput({
215
216
  },
216
217
  item.id
217
218
  );
218
- }) }),
219
- /* @__PURE__ */ jsx(Grid, { item: true, xs: true, children: /* @__PURE__ */ jsx(Grid, { container: true, direction: "row-reverse", children: /* @__PURE__ */ jsx(Tooltip, { title: intl.formatMessage({ id: titleId }), children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
220
- IconButton,
219
+ }),
220
+ elements?.length === 0 && label && /* @__PURE__ */ jsx(
221
+ FieldLabel,
221
222
  {
222
- sx: styles.addDirectoryElements,
223
- size: "small",
224
- disabled: disable,
225
- onClick: () => {
226
- if (shouldReplaceElement) {
227
- handleChipClick(0);
228
- } else {
229
- setDirectoryItemSelectorOpen(true);
230
- if (allowMultiSelect) {
231
- setMultiSelect(true);
232
- }
233
- }
234
- },
235
- children: /* @__PURE__ */ jsx(Folder, {})
223
+ label,
224
+ optional: labelRequiredFromContext && !isFieldRequired(name, validationSchema, getValues())
236
225
  }
237
- ) }) }) }) })
226
+ )
238
227
  ]
239
228
  }
240
229
  ),
@@ -9,6 +9,7 @@ import "../../../../utils/conversionUtils.js";
9
9
  import "@mui/icons-material";
10
10
  import "../../../../utils/types/equipmentType.js";
11
11
  import "../../../../utils/yupConfig.js";
12
+ import "react-intl";
12
13
  const style = (customProps) => ({
13
14
  grid: (theme) => ({
14
15
  width: "auto",
@@ -2,11 +2,11 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { validate } from "uuid";
3
3
  import { useEffect } from "react";
4
4
  import { useCustomFormContext } from "../reactHookForm/provider/useCustomFormContext.js";
5
- import { fetchElementsInfos } from "../../../services/explore.js";
6
5
  import "../../../utils/conversionUtils.js";
7
6
  import "@mui/icons-material";
8
7
  import "../../../utils/types/equipmentType.js";
9
8
  import "../../../utils/yupConfig.js";
9
+ import { fetchElementsInfos } from "../../../services/explore.js";
10
10
  import { DirectoryItemsInput } from "../reactHookForm/DirectoryItemsInput.js";
11
11
  function ElementValueEditor(props) {
12
12
  const { defaultValue, name, elementType, equipmentTypes, titleId, hideErrorMessage, itemFilter, onChange } = props;
@@ -0,0 +1,3 @@
1
+ import { OverflowableTextProps } from '../overflowableText';
2
+ export declare function OverflowableTableCell(overflowableTextProps: Readonly<OverflowableTextProps>): import("react/jsx-runtime").JSX.Element;
3
+ export default OverflowableTableCell;
@@ -0,0 +1,10 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { TableCell } from "@mui/material";
3
+ import { OverflowableText } from "../overflowableText/OverflowableText.js";
4
+ function OverflowableTableCell(overflowableTextProps) {
5
+ return /* @__PURE__ */ jsx(TableCell, { sx: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsx(OverflowableText, { sx: { flex: "1 1 0", width: 0, display: "block" }, ...overflowableTextProps }) });
6
+ }
7
+ export {
8
+ OverflowableTableCell,
9
+ OverflowableTableCell as default
10
+ };
@@ -0,0 +1,6 @@
1
+ import { OverflowableTextProps } from '../overflowableText';
2
+ export interface OverflowableTableCellProps extends OverflowableTextProps {
3
+ checked: boolean;
4
+ }
5
+ export declare function OverflowableTableCellWithCheckbox({ checked, ...overflowableTextProps }: Readonly<OverflowableTableCellProps>): import("react/jsx-runtime").JSX.Element;
6
+ export default OverflowableTableCellWithCheckbox;
@@ -0,0 +1,16 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { TableCell, Checkbox } from "@mui/material";
3
+ import { OverflowableText } from "../overflowableText/OverflowableText.js";
4
+ function OverflowableTableCellWithCheckbox({
5
+ checked,
6
+ ...overflowableTextProps
7
+ }) {
8
+ return /* @__PURE__ */ jsxs(TableCell, { padding: "checkbox", sx: { display: "flex", alignItems: "center", width: "100%" }, children: [
9
+ /* @__PURE__ */ jsx(Checkbox, { checked }),
10
+ /* @__PURE__ */ jsx(OverflowableText, { sx: { flex: "1 1 0", width: 0, display: "block" }, ...overflowableTextProps })
11
+ ] });
12
+ }
13
+ export {
14
+ OverflowableTableCellWithCheckbox,
15
+ OverflowableTableCellWithCheckbox as default
16
+ };
@@ -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 * from './OverflowableTableCell';
8
+ export * from './OverflowableTableCellWithCheckbox';
@@ -0,0 +1,6 @@
1
+ import { OverflowableTableCell } from "./OverflowableTableCell.js";
2
+ import { OverflowableTableCellWithCheckbox } from "./OverflowableTableCellWithCheckbox.js";
3
+ export {
4
+ OverflowableTableCell,
5
+ OverflowableTableCellWithCheckbox
6
+ };
@@ -2,11 +2,11 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { useCallback } from "react";
3
3
  import "react-intl";
4
4
  import "../../../utils/types/equipmentType.js";
5
- import { createParameter, updateParameter } from "../../../services/explore.js";
6
5
  import "../../../utils/conversionUtils.js";
7
6
  import { snackWithFallback } from "../../../utils/error.js";
8
7
  import "@mui/icons-material";
9
8
  import "../../../utils/yupConfig.js";
9
+ import { createParameter, updateParameter } from "../../../services/explore.js";
10
10
  import "@mui/material";
11
11
  import "localized-countries";
12
12
  import "localized-countries/data/fr";
@@ -8,12 +8,12 @@ import "react/jsx-runtime";
8
8
  import "@mui/material";
9
9
  import "react-intl";
10
10
  import "../../../utils/types/equipmentType.js";
11
- import { updateParameter } from "../../../services/explore.js";
12
11
  import "../../../utils/conversionUtils.js";
13
12
  import { snackWithFallback } from "../../../utils/error.js";
14
13
  import "@mui/icons-material";
15
14
  import { ElementType } from "../../../utils/types/elementType.js";
16
15
  import "../../../utils/yupConfig.js";
16
+ import { updateParameter } from "../../../services/explore.js";
17
17
  import "localized-countries";
18
18
  import "localized-countries/data/fr";
19
19
  import "localized-countries/data/en";
@@ -7,11 +7,11 @@ import "react-intl";
7
7
  import "@mui/material";
8
8
  import "../../overflowableText/OverflowableText.js";
9
9
  import "../../../utils/types/equipmentType.js";
10
- import { updateParameter } from "../../../services/explore.js";
11
10
  import "../../../utils/conversionUtils.js";
12
11
  import { snackWithFallback } from "../../../utils/error.js";
13
12
  import "@mui/icons-material";
14
13
  import { ElementType } from "../../../utils/types/elementType.js";
14
+ import { updateParameter } from "../../../services/explore.js";
15
15
  import { setStudyNetworkVisualizationParameters } from "../../../services/study.js";
16
16
  import { getNetworkVisualizationsParameters } from "../../../services/study-config.js";
17
17
  import "localized-countries";
@@ -6,13 +6,13 @@ import "react/jsx-runtime";
6
6
  import "@mui/material";
7
7
  import "react-intl";
8
8
  import "../../../utils/types/equipmentType.js";
9
- import { updateParameter } from "../../../services/explore.js";
10
9
  import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
11
10
  import "../../../utils/conversionUtils.js";
12
11
  import { snackWithFallback } from "../../../utils/error.js";
13
12
  import "@mui/icons-material";
14
13
  import { ElementType } from "../../../utils/types/elementType.js";
15
14
  import "../../../utils/yupConfig.js";
15
+ import { updateParameter } from "../../../services/explore.js";
16
16
  import "localized-countries";
17
17
  import "localized-countries/data/fr";
18
18
  import "localized-countries/data/en";
@@ -7,11 +7,11 @@ import "react-intl";
7
7
  import "@mui/material";
8
8
  import "../../overflowableText/OverflowableText.js";
9
9
  import "../../../utils/types/equipmentType.js";
10
- import { updateParameter } from "../../../services/explore.js";
11
10
  import "../../../utils/conversionUtils.js";
12
11
  import { snackWithFallback } from "../../../utils/error.js";
13
12
  import "@mui/icons-material";
14
13
  import { ElementType } from "../../../utils/types/elementType.js";
14
+ import { updateParameter } from "../../../services/explore.js";
15
15
  import { setStudyShortCircuitParameters, invalidateStudyShortCircuitStatus } from "../../../services/study.js";
16
16
  import "localized-countries";
17
17
  import "localized-countries/data/fr";
@@ -7,12 +7,12 @@ import "react-intl";
7
7
  import "@mui/material";
8
8
  import "../../overflowableText/OverflowableText.js";
9
9
  import "../../../utils/types/equipmentType.js";
10
- import { updateParameter } from "../../../services/explore.js";
11
10
  import { ID, FILTERS } from "../../../utils/constants/filterConstant.js";
12
11
  import { isBlankOrEmpty } from "../../../utils/conversionUtils.js";
13
12
  import { snackWithFallback } from "../../../utils/error.js";
14
13
  import "@mui/icons-material";
15
14
  import { ElementType } from "../../../utils/types/elementType.js";
15
+ import { updateParameter } from "../../../services/explore.js";
16
16
  import { updateVoltageInitParameters } from "../../../services/study.js";
17
17
  import { getVoltageInitParameters } from "../../../services/voltage-init.js";
18
18
  import "localized-countries";
@@ -0,0 +1,8 @@
1
+ import { Theme } from '@mui/material';
2
+ interface ResizeHandleProps {
3
+ visible?: boolean;
4
+ rotated?: boolean;
5
+ style?: (theme: Theme) => React.CSSProperties;
6
+ }
7
+ export declare function ResizeHandle({ visible, rotated, style }: Readonly<ResizeHandleProps>): import("react/jsx-runtime").JSX.Element;
8
+ export default ResizeHandle;
@@ -0,0 +1,32 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { PanelResizeHandle } from "react-resizable-panels";
3
+ import { DragIndicator } from "@mui/icons-material";
4
+ import { useTheme } from "@mui/material";
5
+ const getStyles = (theme, visible, rotated, customStyle) => ({
6
+ handle: {
7
+ display: visible ? "flex" : "none",
8
+ alignItems: "center",
9
+ backgroundColor: theme.palette.background.paper,
10
+ borderLeft: rotated ? "none" : `1px solid ${theme.palette.divider}`,
11
+ borderRight: rotated ? "none" : `1px solid ${theme.palette.divider}`,
12
+ borderBottom: rotated ? `1px solid ${theme.palette.divider}` : "none",
13
+ borderTop: rotated ? `1px solid ${theme.palette.divider}` : "none",
14
+ justifyContent: "center",
15
+ ...customStyle ? customStyle(theme) : {}
16
+ },
17
+ icon: {
18
+ transform: rotated ? "rotate(90deg)" : "none",
19
+ transition: "transform 0.2s",
20
+ color: "inherit",
21
+ cursor: "ns-resize"
22
+ }
23
+ });
24
+ function ResizeHandle({ visible = true, rotated = false, style }) {
25
+ const theme = useTheme();
26
+ const styles = getStyles(theme, visible, rotated, style);
27
+ return /* @__PURE__ */ jsx(PanelResizeHandle, { style: styles.handle, children: /* @__PURE__ */ jsx(DragIndicator, { fontSize: "small", style: styles.icon }) });
28
+ }
29
+ export {
30
+ ResizeHandle,
31
+ ResizeHandle as default
32
+ };
@@ -0,0 +1,7 @@
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 './ResizeHandle';
@@ -0,0 +1,4 @@
1
+ import { ResizeHandle } from "./ResizeHandle.js";
2
+ export {
3
+ ResizeHandle
4
+ };
@@ -2,12 +2,14 @@ import { ReactNode } from 'react';
2
2
  import { SxStyle } from '../../utils/styles';
3
3
  export interface GridLogoProps extends Omit<LogoTextProps, 'style'> {
4
4
  appLogo: ReactNode;
5
+ dense?: boolean;
5
6
  }
6
- export declare function LogoText({ appName, appColor, style, onClick }: Partial<LogoTextProps>): import("react/jsx-runtime").JSX.Element;
7
- export declare function GridLogo({ appLogo, appName, appColor, onClick }: Partial<GridLogoProps>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function LogoText({ appName, appColor, style, onClick, dense }: Readonly<Partial<LogoTextProps>>): import("react/jsx-runtime").JSX.Element;
8
+ export declare function GridLogo({ appLogo, appName, appColor, onClick, dense }: Readonly<Partial<GridLogoProps>>): import("react/jsx-runtime").JSX.Element;
8
9
  export interface LogoTextProps {
9
10
  appName: string;
10
11
  appColor: string;
11
12
  style: SxStyle;
12
13
  onClick: () => void;
14
+ dense?: boolean;
13
15
  }
@@ -1,32 +1,50 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { Typography, Box } from "@mui/material";
3
3
  import { BrokenImage } from "@mui/icons-material";
4
+ import { useMemo } from "react";
4
5
  import { mergeSx } from "../../utils/styles.js";
5
- const styles = {
6
- logo: {
7
- flexShrink: 0,
8
- width: 48,
9
- height: 48,
10
- marginBottom: "8px"
11
- },
12
- title: {
13
- marginLeft: "18px",
14
- display: { xs: "none", lg: "block" }
15
- },
16
- clickable: {
17
- cursor: "pointer"
18
- }
6
+ const LOGO_WIDTH = 32;
7
+ const LOGO_HEIGHT = 32;
8
+ const LOGO_WIDTH_DENSE = 26;
9
+ const LOGO_HEIGHT_DENSE = 26;
10
+ const getStyles = (dense = false) => {
11
+ return {
12
+ container: {
13
+ display: "flex",
14
+ alignItems: "center"
15
+ },
16
+ logo: (_theme) => ({
17
+ flexShrink: 0,
18
+ width: dense ? LOGO_WIDTH_DENSE : LOGO_WIDTH,
19
+ height: dense ? LOGO_HEIGHT_DENSE : LOGO_HEIGHT,
20
+ display: "flex",
21
+ alignItems: "center",
22
+ justifyContent: "center"
23
+ }),
24
+ title: (theme) => ({
25
+ marginLeft: theme.spacing(dense ? 0.5 : 1),
26
+ display: { xs: "none", lg: "block" },
27
+ ...dense && {
28
+ fontSize: 18
29
+ }
30
+ }),
31
+ clickable: {
32
+ cursor: "pointer"
33
+ }
34
+ };
19
35
  };
20
- function LogoText({ appName, appColor, style, onClick }) {
21
- return /* @__PURE__ */ jsxs(Typography, { variant: "h4", sx: mergeSx(style, onClick && styles.clickable), onClick, children: [
36
+ function LogoText({ appName, appColor, style, onClick, dense = false }) {
37
+ const styles = useMemo(() => getStyles(dense), [dense]);
38
+ return /* @__PURE__ */ jsxs(Typography, { sx: mergeSx(style, onClick && styles.clickable), onClick, children: [
22
39
  /* @__PURE__ */ jsx("span", { style: { fontWeight: "bold" }, children: "Grid" }),
23
40
  /* @__PURE__ */ jsx("span", { style: { color: appColor }, children: appName })
24
41
  ] });
25
42
  }
26
- function GridLogo({ appLogo, appName, appColor, onClick }) {
27
- return /* @__PURE__ */ jsxs(Fragment, { children: [
28
- /* @__PURE__ */ jsx(Box, { sx: mergeSx(styles.logo, onClick && styles.clickable), onClick, children: appLogo || /* @__PURE__ */ jsx(BrokenImage, {}) }),
29
- /* @__PURE__ */ jsx(LogoText, { appName, appColor, onClick, style: styles.title })
43
+ function GridLogo({ appLogo, appName, appColor, onClick, dense = false }) {
44
+ const styles = useMemo(() => getStyles(dense), [dense]);
45
+ return /* @__PURE__ */ jsxs(Box, { sx: mergeSx(styles.container, onClick && styles.clickable), onClick, children: [
46
+ /* @__PURE__ */ jsx(Box, { sx: styles.logo, children: appLogo || /* @__PURE__ */ jsx(BrokenImage, {}) }),
47
+ /* @__PURE__ */ jsx(LogoText, { appName, appColor, style: styles.title, dense })
30
48
  ] });
31
49
  }
32
50
  export {
@@ -20,5 +20,6 @@ export type TopBarProps = Omit<GridLogoProps, 'onClick'> & Omit<LogoutProps, 'di
20
20
  language: GsLang;
21
21
  developerMode?: boolean;
22
22
  onDeveloperModeClick?: (value: boolean) => void;
23
+ dense?: boolean;
23
24
  };
24
- export declare function TopBar({ appName, appColor, appLogo, appVersion, appLicense, logoAboutDialog, onLogoutClick, onLogoClick, user, children, appsAndUrls, onAboutClick, globalVersionPromise, additionalModulesPromise, onThemeClick, theme, developerMode, onDeveloperModeClick, onEquipmentLabellingClick, equipmentLabelling, onLanguageClick, language, }: PropsWithChildren<TopBarProps>): import("react/jsx-runtime").JSX.Element;
25
+ export declare function TopBar({ appName, appColor, appLogo, appVersion, appLicense, logoAboutDialog, onLogoutClick, onLogoClick, user, children, appsAndUrls, onAboutClick, globalVersionPromise, additionalModulesPromise, onThemeClick, theme, developerMode, onDeveloperModeClick, onEquipmentLabellingClick, equipmentLabelling, onLanguageClick, language, dense, }: PropsWithChildren<TopBarProps>): import("react/jsx-runtime").JSX.Element;