@gridsuite/commons-ui 0.266.0 → 0.268.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/composite/grid/grid-section.d.ts +5 -2
- package/dist/components/composite/grid/grid-section.js +56 -4
- package/dist/components/ui/inputs/checkbox-autocomplete/checkbox-autocomplete.js +2 -1
- package/dist/components/ui/reactHookForm/CheckboxNullableInput.js +4 -2
- package/dist/components/ui/reactHookForm/autocompleteInputs/MultipleAutocompleteInput.js +3 -2
- package/dist/components/ui/reactHookForm/booleans/BooleanInput.d.ts +1 -1
- package/dist/components/ui/reactHookForm/booleans/BooleanInput.js +5 -7
- package/dist/components/ui/reactHookForm/tableInputs/table-numerical-input.js +4 -2
- package/dist/components/ui/reactHookForm/tableInputs/table-text-input.d.ts +1 -1
- package/dist/components/ui/reactHookForm/tableInputs/table-text-input.js +2 -3
- package/dist/components/ui/reactHookForm/text/ExpandingTextField.js +15 -13
- package/dist/components/ui/reactHookForm/text/TextInput.js +4 -2
- package/dist/components/ui/reactHookForm/text/UniqueNameInput.js +4 -2
- package/dist/components/ui/reactHookForm/utils/TextFieldWithAdornment.js +2 -1
- package/dist/features/common/index.d.ts +7 -0
- package/dist/features/common/index.js +4 -0
- package/dist/features/common/renderTable-ExportCsv.d.ts +18 -0
- package/dist/features/common/renderTable-ExportCsv.js +136 -0
- package/dist/features/index.d.ts +5 -0
- package/dist/features/index.js +50 -2
- package/dist/features/network-modifications/common/connectivity/connectivity.type.d.ts +1 -1
- package/dist/features/network-modifications/index.d.ts +1 -0
- package/dist/features/network-modifications/index.js +40 -1
- package/dist/features/network-modifications/static-var-compensator/common/constants.d.ts +20 -0
- package/dist/features/network-modifications/static-var-compensator/common/constants.js +9 -0
- package/dist/features/network-modifications/static-var-compensator/common/index.d.ts +13 -0
- package/dist/features/network-modifications/static-var-compensator/common/index.js +20 -0
- package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form-utils.d.ts +91 -0
- package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form-utils.js +166 -0
- package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form.d.ts +8 -0
- package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form.js +200 -0
- package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form-utils.d.ts +66 -0
- package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form-utils.js +149 -0
- package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form.d.ts +7 -0
- package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form.js +153 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-header.d.ts +7 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-header.js +72 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-tabs.d.ts +7 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-tabs.js +44 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tab-utils.d.ts +8 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tab-utils.js +34 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tabs-content.d.ts +9 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tabs-content.js +100 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator.types.d.ts +68 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator.types.js +1 -0
- package/dist/features/network-modifications/static-var-compensator/common/susceptance-area.d.ts +7 -0
- package/dist/features/network-modifications/static-var-compensator/common/susceptance-area.js +161 -0
- package/dist/features/network-modifications/static-var-compensator/creation/index.d.ts +9 -0
- package/dist/features/network-modifications/static-var-compensator/creation/index.js +9 -0
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-form.d.ts +8 -0
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-form.js +105 -0
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-utils.d.ts +114 -0
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-utils.js +189 -0
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation.types.d.ts +34 -0
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation.types.js +1 -0
- package/dist/features/network-modifications/static-var-compensator/index.d.ts +8 -0
- package/dist/features/network-modifications/static-var-compensator/index.js +27 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-form.d.ts +8 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-form.js +153 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-utils.d.ts +20 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-utils.js +40 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation.types.d.ts +11 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation.types.js +1 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/index.d.ts +3 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/index.js +9 -0
- package/dist/features/network-modifications/voltageLevel/creation/index.js +1 -1
- package/dist/features/network-modifications/voltageLevel/index.d.ts +2 -0
- package/dist/features/network-modifications/voltageLevel/index.js +15 -1
- package/dist/features/network-modifications/voltageLevel/topology/CreateVoltageLevelTopologyForm.d.ts +6 -0
- package/dist/features/network-modifications/voltageLevel/topology/CreateVoltageLevelTopologyForm.js +145 -0
- package/dist/features/network-modifications/voltageLevel/topology/index.d.ts +9 -0
- package/dist/features/network-modifications/voltageLevel/topology/index.js +9 -0
- package/dist/features/network-modifications/voltageLevel/topology/voltageLevelTopologyCreation.types.d.ts +8 -0
- package/dist/features/network-modifications/voltageLevel/topology/voltageLevelTopologyCreation.types.js +1 -0
- package/dist/features/network-modifications/voltageLevel/topology/voltageLevelTopologyCreation.utils.d.ts +25 -0
- package/dist/features/network-modifications/voltageLevel/topology/voltageLevelTopologyCreation.utils.js +48 -0
- package/dist/features/results/constants.d.ts +7 -0
- package/dist/features/results/constants.js +4 -0
- package/dist/features/results/hooks/index.d.ts +7 -0
- package/dist/features/results/hooks/index.js +4 -0
- package/dist/features/results/hooks/useIntlResultStatusMessages.d.ts +19 -0
- package/dist/features/results/hooks/useIntlResultStatusMessages.js +23 -0
- package/dist/features/results/loadflow/index.d.ts +8 -0
- package/dist/features/results/loadflow/index.js +4 -0
- package/dist/features/results/loadflow/limit-violation-result.d.ts +2 -0
- package/dist/features/results/loadflow/limit-violation-result.js +134 -0
- package/dist/features/results/loadflow/load-flow-result.type.d.ts +29 -0
- package/dist/features/results/loadflow/load-flow-result.type.js +1 -0
- package/dist/features/results/securityanalysis/index.js +1 -2
- package/dist/features/results/securityanalysis/security-analysis-result-nmk.js +2 -1
- package/dist/features/results/securityanalysis/utils.d.ts +0 -2
- package/dist/features/results/securityanalysis/utils.js +0 -22
- package/dist/features/results/utils/index.d.ts +7 -0
- package/dist/features/results/utils/index.js +4 -0
- package/dist/features/results/utils/no-rows-message.d.ts +2 -0
- package/dist/features/results/utils/no-rows-message.js +24 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/useOpenLoaderShortWait.d.ts +18 -0
- package/dist/hooks/useOpenLoaderShortWait.js +19 -0
- package/dist/index.js +53 -1
- package/dist/translations/en/networkModificationsEn.d.ts +35 -0
- package/dist/translations/en/networkModificationsEn.js +38 -1
- package/dist/translations/fr/networkModificationsFr.d.ts +35 -0
- package/dist/translations/fr/networkModificationsFr.js +38 -1
- package/dist/utils/constants/fieldConstants.d.ts +28 -1
- package/dist/utils/constants/fieldConstants.js +27 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +2 -0
- package/package.json +1 -1
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { SxStyle } from '../../../utils
|
|
1
|
+
import { SxStyle } from '../../../utils';
|
|
2
2
|
export interface GridSectionProps {
|
|
3
3
|
title: string;
|
|
4
4
|
heading?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
5
|
size?: number;
|
|
6
6
|
customStyle?: SxStyle;
|
|
7
|
+
tooltipEnabled?: boolean;
|
|
8
|
+
tooltipMessage?: string;
|
|
9
|
+
isLiteralText?: boolean;
|
|
7
10
|
}
|
|
8
|
-
export declare function GridSection({ title, heading, size, customStyle }: Readonly<GridSectionProps>): import("react").JSX.Element;
|
|
11
|
+
export declare function GridSection({ title, heading, size, customStyle, tooltipEnabled, tooltipMessage, isLiteralText, }: Readonly<GridSectionProps>): import("react").JSX.Element;
|
|
@@ -1,8 +1,60 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Grid, Box } from "@mui/material";
|
|
3
|
-
import { FormattedMessage } from "react-intl";
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { useIntl, FormattedMessage } from "react-intl";
|
|
4
|
+
import { InfoOutlined } from "@mui/icons-material";
|
|
5
|
+
import "../../../utils/conversionUtils.js";
|
|
6
|
+
import "../../../utils/types/equipmentType.js";
|
|
7
|
+
import { mergeSx } from "../../../utils/styles.js";
|
|
8
|
+
import "../../ui/overflowableText/OverflowableText.js";
|
|
9
|
+
import "react";
|
|
10
|
+
import "react-hook-form";
|
|
11
|
+
import "localized-countries";
|
|
12
|
+
import "localized-countries/data/fr";
|
|
13
|
+
import "localized-countries/data/en";
|
|
14
|
+
import "notistack";
|
|
15
|
+
import "../../ui/reactHookForm/provider/CustomFormProvider.js";
|
|
16
|
+
import "yup";
|
|
17
|
+
import { CustomTooltip } from "../../ui/tooltip/CustomTooltip.js";
|
|
18
|
+
import "../../ui/treeViewFinder/TreeViewFinder.js";
|
|
19
|
+
import "../../ui/reactHookForm/numbers/RangeInput.js";
|
|
20
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
21
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
22
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
23
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
24
|
+
import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
|
|
25
|
+
import "../../ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
26
|
+
import "../../ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
27
|
+
import "../../ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
28
|
+
import "@hello-pangea/dnd";
|
|
29
|
+
import "../../ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
30
|
+
import "../../ui/snackbarProvider/SnackbarProvider.js";
|
|
31
|
+
import "mui-nested-menu";
|
|
32
|
+
import "react-resizable-panels";
|
|
33
|
+
import "react-papaparse";
|
|
34
|
+
function GridSection({
|
|
35
|
+
title,
|
|
36
|
+
heading = 3,
|
|
37
|
+
size = 12,
|
|
38
|
+
customStyle,
|
|
39
|
+
tooltipEnabled = false,
|
|
40
|
+
tooltipMessage,
|
|
41
|
+
isLiteralText = false
|
|
42
|
+
}) {
|
|
43
|
+
const intl = useIntl();
|
|
44
|
+
return /* @__PURE__ */ jsx(Grid, { container: true, spacing: 2, sx: { width: "100%" }, children: /* @__PURE__ */ jsx(Grid, { size, children: /* @__PURE__ */ jsxs(
|
|
45
|
+
Box,
|
|
46
|
+
{
|
|
47
|
+
sx: mergeSx(customStyle, {
|
|
48
|
+
display: "flex",
|
|
49
|
+
alignItems: "center"
|
|
50
|
+
}),
|
|
51
|
+
component: `h${heading}`,
|
|
52
|
+
children: [
|
|
53
|
+
isLiteralText ? title : /* @__PURE__ */ jsx(FormattedMessage, { id: title }),
|
|
54
|
+
tooltipEnabled && /* @__PURE__ */ jsx(CustomTooltip, { sx: { paddingLeft: 1 }, title: intl.formatMessage({ id: tooltipMessage }), children: /* @__PURE__ */ jsx(InfoOutlined, { color: "info", fontSize: "medium" }) })
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
) }) });
|
|
6
58
|
}
|
|
7
59
|
export {
|
|
8
60
|
GridSection
|
|
@@ -105,6 +105,7 @@ function CheckboxAutocomplete({
|
|
|
105
105
|
disableCloseOnSelect: true,
|
|
106
106
|
size: "small",
|
|
107
107
|
disableListWrap: true,
|
|
108
|
+
slots: { popper: StyledPopper },
|
|
108
109
|
options,
|
|
109
110
|
noOptionsText: intl.formatMessage({ id: "noOption" }),
|
|
110
111
|
getOptionLabel,
|
|
@@ -116,8 +117,8 @@ function CheckboxAutocomplete({
|
|
|
116
117
|
inputValue,
|
|
117
118
|
onChange: handleChange,
|
|
118
119
|
onBlur: handleBlur,
|
|
119
|
-
slots: { popper: StyledPopper },
|
|
120
120
|
slotProps: {
|
|
121
|
+
...otherProps?.slotProps,
|
|
121
122
|
listbox: { component: virtualize ? VirtualizedList : void 0 }
|
|
122
123
|
}
|
|
123
124
|
}
|
|
@@ -36,6 +36,7 @@ function CheckboxNullableInput({
|
|
|
36
36
|
onChange?.(newValue);
|
|
37
37
|
}, [rhfOnChange, onChange, value]);
|
|
38
38
|
const currentLabel = typeof label === "function" ? label(value) : label;
|
|
39
|
+
const { slotProps, ...otherFormProps } = formProps ?? {};
|
|
39
40
|
return /* @__PURE__ */ jsxs(FormControl, { fullWidth: true, size: "small", children: [
|
|
40
41
|
/* @__PURE__ */ jsx(
|
|
41
42
|
FormControlLabel,
|
|
@@ -51,9 +52,10 @@ function CheckboxNullableInput({
|
|
|
51
52
|
slotProps: {
|
|
52
53
|
input: {
|
|
53
54
|
"aria-label": "primary checkbox"
|
|
54
|
-
}
|
|
55
|
+
},
|
|
56
|
+
...slotProps
|
|
55
57
|
},
|
|
56
|
-
...
|
|
58
|
+
...otherFormProps
|
|
57
59
|
}
|
|
58
60
|
),
|
|
59
61
|
label: !label ? "" : intl.formatMessage({
|
|
@@ -20,6 +20,7 @@ function MultipleAutocompleteInput({ name, ...props }) {
|
|
|
20
20
|
const newValues = values.map((val) => val.trim());
|
|
21
21
|
return newValues.filter((val, index) => newValues.indexOf(val) === index);
|
|
22
22
|
};
|
|
23
|
+
const { slotProps, ...otherProps } = props;
|
|
23
24
|
return /* @__PURE__ */ jsx(
|
|
24
25
|
AutocompleteInput,
|
|
25
26
|
{
|
|
@@ -34,8 +35,8 @@ function MultipleAutocompleteInput({ name, ...props }) {
|
|
|
34
35
|
onBlur: handleOnBlur,
|
|
35
36
|
blurOnSelect: false,
|
|
36
37
|
multiple: true,
|
|
37
|
-
slotProps: { chip: { size: "small" } },
|
|
38
|
-
...
|
|
38
|
+
slotProps: { chip: { size: "small" }, ...slotProps },
|
|
39
|
+
...otherProps
|
|
39
40
|
}
|
|
40
41
|
);
|
|
41
42
|
}
|
|
@@ -8,5 +8,5 @@ export type BooleanInputProps<TInput extends InputTypes> = {
|
|
|
8
8
|
formProps?: InputProps<TInput>;
|
|
9
9
|
Input: TInput;
|
|
10
10
|
};
|
|
11
|
-
export declare function BooleanInput<TInput extends InputTypes>({ name, label, formProps, Input,
|
|
11
|
+
export declare function BooleanInput<TInput extends InputTypes>({ name, label, formProps, Input, }: Readonly<BooleanInputProps<TInput>>): JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -7,10 +7,9 @@ function BooleanInput({
|
|
|
7
7
|
name,
|
|
8
8
|
label,
|
|
9
9
|
formProps,
|
|
10
|
-
Input
|
|
11
|
-
...props
|
|
10
|
+
Input
|
|
12
11
|
}) {
|
|
13
|
-
const { onChange, ...otherFormProps } = formProps ?? { onChange: void 0 };
|
|
12
|
+
const { onChange, slotProps, ...otherFormProps } = formProps ?? { onChange: void 0 };
|
|
14
13
|
const {
|
|
15
14
|
field: { onChange: onChangeRhf, value, ref }
|
|
16
15
|
} = useController({ name });
|
|
@@ -25,12 +24,11 @@ function BooleanInput({
|
|
|
25
24
|
const CustomInput = /* @__PURE__ */ jsx(
|
|
26
25
|
Input,
|
|
27
26
|
{
|
|
28
|
-
checked: value,
|
|
27
|
+
checked: value ?? false,
|
|
29
28
|
onChange: handleChangeValue,
|
|
30
29
|
inputRef: ref,
|
|
31
|
-
slotProps: { input: { "aria-label": "primary checkbox" } },
|
|
32
|
-
...otherFormProps
|
|
33
|
-
...props
|
|
30
|
+
slotProps: { input: { "aria-label": "primary checkbox" }, ...slotProps },
|
|
31
|
+
...otherFormProps
|
|
34
32
|
}
|
|
35
33
|
);
|
|
36
34
|
if (label) {
|
|
@@ -64,6 +64,7 @@ function TableNumericalInput({
|
|
|
64
64
|
const handleClearValue = () => {
|
|
65
65
|
onChange(outputTransform(previousValue));
|
|
66
66
|
};
|
|
67
|
+
const { slotProps, ...otherProps } = props;
|
|
67
68
|
return /* @__PURE__ */ jsx(
|
|
68
69
|
TextField,
|
|
69
70
|
{
|
|
@@ -103,10 +104,11 @@ function TableNumericalInput({
|
|
|
103
104
|
// to have '.' as decimal separator
|
|
104
105
|
...inputProps
|
|
105
106
|
}
|
|
106
|
-
}
|
|
107
|
+
},
|
|
108
|
+
...slotProps
|
|
107
109
|
},
|
|
108
110
|
...hideErrorMessage ? {} : genHelperError(error?.message),
|
|
109
|
-
...
|
|
111
|
+
...otherProps
|
|
110
112
|
}
|
|
111
113
|
);
|
|
112
114
|
}
|
|
@@ -4,5 +4,5 @@ interface TableTextInputProps {
|
|
|
4
4
|
hideErrorMessage?: boolean;
|
|
5
5
|
inputProps?: InputBaseComponentProps;
|
|
6
6
|
}
|
|
7
|
-
export declare function TableTextInput({ name, hideErrorMessage, inputProps
|
|
7
|
+
export declare function TableTextInput({ name, hideErrorMessage, inputProps }: Readonly<TableTextInputProps>): import("react").JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -5,7 +5,7 @@ import "react-intl";
|
|
|
5
5
|
import "react";
|
|
6
6
|
import "@mui/icons-material";
|
|
7
7
|
import { genHelperError } from "../utils/functions.js";
|
|
8
|
-
function TableTextInput({ name, hideErrorMessage, inputProps
|
|
8
|
+
function TableTextInput({ name, hideErrorMessage, inputProps }) {
|
|
9
9
|
const {
|
|
10
10
|
field: { onChange, value, ref },
|
|
11
11
|
fieldState: { error }
|
|
@@ -37,8 +37,7 @@ function TableTextInput({ name, hideErrorMessage, inputProps, ...props }) {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
|
-
...hideErrorMessage ? {} : genHelperError(error?.message)
|
|
41
|
-
...props
|
|
40
|
+
...hideErrorMessage ? {} : genHelperError(error?.message)
|
|
42
41
|
}
|
|
43
42
|
);
|
|
44
43
|
}
|
|
@@ -27,34 +27,36 @@ function ExpandingTextField({
|
|
|
27
27
|
const descriptionLength = descriptionWatch?.length ?? 0;
|
|
28
28
|
const descriptionCounter = `${descriptionLength}/${maxCharactersNumber}`;
|
|
29
29
|
const rowsToDisplay = isFocused ? rows : minRows;
|
|
30
|
+
const { slotProps, ...otherProps } = textFieldFormProps ?? {};
|
|
30
31
|
const formProps = {
|
|
31
32
|
size: "medium",
|
|
32
33
|
multiline: true,
|
|
33
34
|
onFocus: handleFocus,
|
|
34
35
|
onBlur: handleBlur,
|
|
35
|
-
InputProps: {
|
|
36
|
-
style: {
|
|
37
|
-
textOverflow: "ellipsis",
|
|
38
|
-
overflow: "hidden",
|
|
39
|
-
// disable scrolling
|
|
40
|
-
whiteSpace: "pre",
|
|
41
|
-
resize: "none"
|
|
42
|
-
// or 'horizontal' for horizontal resizing
|
|
43
|
-
},
|
|
44
|
-
inputProps: { "data-testid": "DescriptionInputField" }
|
|
45
|
-
},
|
|
46
36
|
helperText: /* @__PURE__ */ jsx(Typography, { variant: "caption", children: descriptionCounter }),
|
|
47
37
|
slotProps: {
|
|
38
|
+
input: {
|
|
39
|
+
style: {
|
|
40
|
+
textOverflow: "ellipsis",
|
|
41
|
+
overflow: "hidden",
|
|
42
|
+
// disable scrolling
|
|
43
|
+
whiteSpace: "pre",
|
|
44
|
+
resize: "none"
|
|
45
|
+
// or 'horizontal' for horizontal resizing
|
|
46
|
+
},
|
|
47
|
+
inputProps: { "data-testid": "DescriptionInputField" }
|
|
48
|
+
},
|
|
48
49
|
formHelperText: {
|
|
49
50
|
sx: {
|
|
50
51
|
ml: "auto",
|
|
51
52
|
color: (theme) => isOverTheLimit ? theme.palette.error.main : theme.palette.text.secondary
|
|
52
53
|
}
|
|
53
|
-
}
|
|
54
|
+
},
|
|
55
|
+
...slotProps
|
|
54
56
|
},
|
|
55
57
|
...rowsToDisplay && { rows: rowsToDisplay },
|
|
56
58
|
...sx && { sx },
|
|
57
|
-
...
|
|
59
|
+
...otherProps
|
|
58
60
|
};
|
|
59
61
|
return /* @__PURE__ */ jsx(TextInput, { name, label, formProps, ...otherTexFieldProps });
|
|
60
62
|
}
|
|
@@ -56,6 +56,7 @@ function TextInput({
|
|
|
56
56
|
values: labelValues,
|
|
57
57
|
optional: !isFieldRequired(name, validationSchema, getValues()) && !formProps?.disabled && !removeOptional
|
|
58
58
|
});
|
|
59
|
+
const { slotProps, ...otherFormProps } = formProps ?? {};
|
|
59
60
|
return /* @__PURE__ */ jsx(
|
|
60
61
|
Field,
|
|
61
62
|
{
|
|
@@ -73,7 +74,8 @@ function TextInput({
|
|
|
73
74
|
clearable && transformedValue !== void 0 && transformedValue !== "" && /* @__PURE__ */ jsx(IconButton, { onClick: handleClearValue, size: "small", children: /* @__PURE__ */ jsx(Clear, { fontSize: "small" }) }),
|
|
74
75
|
customAdornment && { ...customAdornment }
|
|
75
76
|
] })
|
|
76
|
-
}
|
|
77
|
+
},
|
|
78
|
+
...slotProps
|
|
77
79
|
},
|
|
78
80
|
inputRef: ref,
|
|
79
81
|
...clearable && adornment && {
|
|
@@ -89,7 +91,7 @@ function TextInput({
|
|
|
89
91
|
}
|
|
90
92
|
),
|
|
91
93
|
...genHelperError(error?.message),
|
|
92
|
-
...
|
|
94
|
+
...otherFormProps,
|
|
93
95
|
...adornment && { ...finalAdornment }
|
|
94
96
|
},
|
|
95
97
|
id ?? label
|
|
@@ -41,6 +41,7 @@ function UniqueNameInput({
|
|
|
41
41
|
isValidating && /* @__PURE__ */ jsx(CircularProgress, { size: "1rem" }),
|
|
42
42
|
showOk && /* @__PURE__ */ jsx(Check, { style: { color: "green" } })
|
|
43
43
|
] });
|
|
44
|
+
const { slotProps, ...otherFormProps } = formProps ?? {};
|
|
44
45
|
return /* @__PURE__ */ jsx(
|
|
45
46
|
TextField,
|
|
46
47
|
{
|
|
@@ -64,9 +65,10 @@ function UniqueNameInput({
|
|
|
64
65
|
inputProps: {
|
|
65
66
|
"data-testid": "NameInputField"
|
|
66
67
|
}
|
|
67
|
-
}
|
|
68
|
+
},
|
|
69
|
+
...slotProps
|
|
68
70
|
},
|
|
69
|
-
...
|
|
71
|
+
...otherFormProps
|
|
70
72
|
}
|
|
71
73
|
);
|
|
72
74
|
}
|
|
@@ -3,7 +3,7 @@ import { useState, useCallback } from "react";
|
|
|
3
3
|
import { Clear } from "@mui/icons-material";
|
|
4
4
|
import { InputAdornment, IconButton, TextField } from "@mui/material";
|
|
5
5
|
function TextFieldWithAdornment(props) {
|
|
6
|
-
const { adornmentPosition, adornmentText, value, variant, handleClearValue, ...otherProps } = props;
|
|
6
|
+
const { adornmentPosition, adornmentText, value, variant, handleClearValue, slotProps, ...otherProps } = props;
|
|
7
7
|
const [isFocused, setIsFocused] = useState(false);
|
|
8
8
|
const getAdornmentStyle = useCallback((innerVariant) => {
|
|
9
9
|
if (innerVariant === "filled") {
|
|
@@ -54,6 +54,7 @@ function TextFieldWithAdornment(props) {
|
|
|
54
54
|
onFocus: () => setIsFocused(true),
|
|
55
55
|
onBlur: () => setIsFocused(false),
|
|
56
56
|
slotProps: {
|
|
57
|
+
...slotProps,
|
|
57
58
|
input: adornmentPosition === "start" ? withStartAdornmentText() : withEndAdornmentText()
|
|
58
59
|
}
|
|
59
60
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, RTE (http://www.rte-france.com)
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
+
*/
|
|
7
|
+
export * from './renderTable-ExportCsv';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Key, RefObject } from 'react';
|
|
2
|
+
import { ColDef, GridReadyEvent, RowClassParams, RowStyle } from 'ag-grid-community';
|
|
3
|
+
import { AgGridReact } from 'ag-grid-react';
|
|
4
|
+
import { GsLangUser } from '../../utils';
|
|
5
|
+
export interface RenderTableAndExportCsvProps {
|
|
6
|
+
gridRef: RefObject<AgGridReact | null>;
|
|
7
|
+
columns: ColDef[];
|
|
8
|
+
defaultColDef: ColDef;
|
|
9
|
+
tableName: string;
|
|
10
|
+
rows: any[];
|
|
11
|
+
language: GsLangUser;
|
|
12
|
+
getRowStyle?: (params: RowClassParams) => RowStyle | undefined;
|
|
13
|
+
overlayNoRowsTemplate: string | undefined;
|
|
14
|
+
skipColumnHeaders: boolean;
|
|
15
|
+
exportCsvResetKey?: Key;
|
|
16
|
+
onGridReady?: (params: GridReadyEvent) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function RenderTableAndExportCsv({ gridRef, columns, defaultColDef, tableName, rows, language, getRowStyle, overlayNoRowsTemplate, skipColumnHeaders, exportCsvResetKey, onGridReady, }: RenderTableAndExportCsvProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { Box } from "@mui/material";
|
|
4
|
+
import "@mui/icons-material";
|
|
5
|
+
import "react-intl";
|
|
6
|
+
import "../../components/ui/overflowableText/OverflowableText.js";
|
|
7
|
+
import "../../utils/conversionUtils.js";
|
|
8
|
+
import "../../utils/types/equipmentType.js";
|
|
9
|
+
import "react-hook-form";
|
|
10
|
+
import "localized-countries";
|
|
11
|
+
import "localized-countries/data/fr";
|
|
12
|
+
import "localized-countries/data/en";
|
|
13
|
+
import "notistack";
|
|
14
|
+
import "../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
15
|
+
import "yup";
|
|
16
|
+
import "../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
17
|
+
import "../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
18
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
19
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
20
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
21
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
22
|
+
import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
|
|
23
|
+
import "../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
24
|
+
import "../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
25
|
+
import "../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
26
|
+
import "@hello-pangea/dnd";
|
|
27
|
+
import "../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
28
|
+
import "../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
29
|
+
import "mui-nested-menu";
|
|
30
|
+
import "react-resizable-panels";
|
|
31
|
+
import "react-papaparse";
|
|
32
|
+
import { CsvExport } from "../../components/ui/csvDownloader/csv-export.js";
|
|
33
|
+
import "react-dom";
|
|
34
|
+
import "autosuggest-highlight/match";
|
|
35
|
+
import "autosuggest-highlight/parse";
|
|
36
|
+
import "clsx";
|
|
37
|
+
import "../../components/composite/filter/FilterCreationDialog.js";
|
|
38
|
+
import "../../components/composite/filter/HeaderFilterForm.js";
|
|
39
|
+
import "../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
40
|
+
import "../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
41
|
+
import "../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
42
|
+
import "../../components/composite/filter/expert/expertFilterConstants.js";
|
|
43
|
+
import "react-querybuilder";
|
|
44
|
+
import "uuid";
|
|
45
|
+
import "../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
46
|
+
import "../../components/composite/filter/utils/filterFormUtils.js";
|
|
47
|
+
import "@react-querybuilder/material";
|
|
48
|
+
import "../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
49
|
+
import "../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
50
|
+
import "../../components/composite/agGridTable/BottomTableButtons.js";
|
|
51
|
+
import "../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
52
|
+
import "ag-grid-community";
|
|
53
|
+
import { CustomAGGrid } from "../../components/composite/customAGGrid/customAggrid.js";
|
|
54
|
+
import "../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
55
|
+
import "mathjs";
|
|
56
|
+
import "../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
57
|
+
import "react-window";
|
|
58
|
+
import "../../components/composite/report/report-treeview/treeview-item.js";
|
|
59
|
+
import "../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
60
|
+
import { AGGRID_LOCALES } from "../../translations/not-intl/aggrid-locales.js";
|
|
61
|
+
const styles = {
|
|
62
|
+
gridContainer: {
|
|
63
|
+
display: "flex",
|
|
64
|
+
flexDirection: "column",
|
|
65
|
+
height: "100%"
|
|
66
|
+
},
|
|
67
|
+
csvExport: {
|
|
68
|
+
display: "flex",
|
|
69
|
+
alignItems: "baseline",
|
|
70
|
+
marginTop: "-45px"
|
|
71
|
+
},
|
|
72
|
+
grid: {
|
|
73
|
+
flexGrow: "1"
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
function RenderTableAndExportCsv({
|
|
77
|
+
gridRef,
|
|
78
|
+
columns,
|
|
79
|
+
defaultColDef,
|
|
80
|
+
tableName,
|
|
81
|
+
rows,
|
|
82
|
+
language,
|
|
83
|
+
getRowStyle,
|
|
84
|
+
overlayNoRowsTemplate,
|
|
85
|
+
skipColumnHeaders = false,
|
|
86
|
+
exportCsvResetKey,
|
|
87
|
+
onGridReady
|
|
88
|
+
}) {
|
|
89
|
+
const isRowsEmpty = !rows || rows.length === 0;
|
|
90
|
+
const onRowDataUpdated = useCallback((params) => {
|
|
91
|
+
if (params.api) {
|
|
92
|
+
params.api.sizeColumnsToFit();
|
|
93
|
+
}
|
|
94
|
+
}, []);
|
|
95
|
+
return /* @__PURE__ */ jsxs(Box, { sx: styles.gridContainer, children: [
|
|
96
|
+
/* @__PURE__ */ jsxs(Box, { sx: styles.csvExport, children: [
|
|
97
|
+
/* @__PURE__ */ jsx(Box, { style: { flexGrow: 1 } }),
|
|
98
|
+
/* @__PURE__ */ jsx(
|
|
99
|
+
CsvExport,
|
|
100
|
+
{
|
|
101
|
+
columns,
|
|
102
|
+
tableName,
|
|
103
|
+
disabled: isRowsEmpty,
|
|
104
|
+
language,
|
|
105
|
+
skipColumnHeaders,
|
|
106
|
+
getData: (params) => gridRef.current?.api?.exportDataAsCsv(params),
|
|
107
|
+
resetKey: exportCsvResetKey
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
] }),
|
|
111
|
+
rows && /* @__PURE__ */ jsx(Box, { sx: styles.grid, children: /* @__PURE__ */ jsx(
|
|
112
|
+
CustomAGGrid,
|
|
113
|
+
{
|
|
114
|
+
ref: gridRef,
|
|
115
|
+
rowData: rows,
|
|
116
|
+
defaultColDef,
|
|
117
|
+
columnDefs: columns,
|
|
118
|
+
onRowDataUpdated,
|
|
119
|
+
onGridReady,
|
|
120
|
+
getRowStyle,
|
|
121
|
+
overlayNoRowsTemplate,
|
|
122
|
+
onModelUpdated: ({ api }) => {
|
|
123
|
+
if (api.getDisplayedRowCount()) {
|
|
124
|
+
api.hideOverlay();
|
|
125
|
+
} else {
|
|
126
|
+
api.showNoRowsOverlay();
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
overrideLocales: AGGRID_LOCALES
|
|
130
|
+
}
|
|
131
|
+
) })
|
|
132
|
+
] });
|
|
133
|
+
}
|
|
134
|
+
export {
|
|
135
|
+
RenderTableAndExportCsv
|
|
136
|
+
};
|
package/dist/features/index.d.ts
CHANGED
|
@@ -14,5 +14,10 @@ export * from './node';
|
|
|
14
14
|
export * from './network-modification-table';
|
|
15
15
|
export * from './announcement';
|
|
16
16
|
export * from './results/securityanalysis';
|
|
17
|
+
export * from './results/loadflow';
|
|
18
|
+
export * from './results/utils';
|
|
19
|
+
export * from './results/constants';
|
|
17
20
|
export * from './process-configs';
|
|
18
21
|
export * from './global-filter';
|
|
22
|
+
export * from './common';
|
|
23
|
+
export * from './results/hooks';
|