@gridsuite/commons-ui 0.219.0 → 0.219.2

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.
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useFieldArray } from "react-hook-form";
3
- import { Grid, Typography } from "@mui/material";
3
+ import { Grid2 } from "@mui/material";
4
4
  import { useIntl, FormattedMessage } from "react-intl";
5
5
  import { VoltageAdornment } from "../../../../utils/constants/adornments.js";
6
6
  import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
@@ -59,8 +59,8 @@ function BusbarSectionVoltageMeasurementsForm({
59
59
  }) {
60
60
  const { fields } = useFieldArray({ name: BUSBAR_SECTION_V_MEASUREMENTS });
61
61
  const intl = useIntl();
62
- return /* @__PURE__ */ jsxs(Grid, { container: true, direction: "column", spacing: 1, sx: { pt: 1 }, children: [
63
- fields.length === 0 && /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "text.secondary", sx: { p: 1 }, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "NoBusbarSectionFound" }) }) }),
62
+ return /* @__PURE__ */ jsxs(Grid2, { container: true, direction: "column", spacing: 1, children: [
63
+ fields.length === 0 && /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(FormattedMessage, { id: "NoBusbarSectionFound" }) }),
64
64
  fields.map((field, i) => {
65
65
  const bbsId = field.busbarSectionId;
66
66
  const networkBbs = busbarSections.find((b) => b.id === bbsId);
@@ -70,9 +70,9 @@ function BusbarSectionVoltageMeasurementsForm({
70
70
  if (validity != null) {
71
71
  previousValidity = intl.formatMessage({ id: validity ? "ValidMeasurement" : "InvalidMeasurement" });
72
72
  }
73
- return /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, alignItems: "center", children: [
74
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 3, children: /* @__PURE__ */ jsx(Typography, { variant: "body2", sx: { fontFamily: "monospace" }, children: bbsId }) }),
75
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 4, children: /* @__PURE__ */ jsx(
73
+ return /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 2, alignItems: "center", children: [
74
+ /* @__PURE__ */ jsx(Grid2, { size: 3, children: bbsId }),
75
+ /* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
76
76
  FloatInput,
77
77
  {
78
78
  name: `${BUSBAR_SECTION_V_MEASUREMENTS}.${i}.${FieldConstants.VALUE}`,
@@ -82,7 +82,7 @@ function BusbarSectionVoltageMeasurementsForm({
82
82
  clearable: true
83
83
  }
84
84
  ) }),
85
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 3, children: /* @__PURE__ */ jsx(
85
+ /* @__PURE__ */ jsx(Grid2, { size: 3, children: /* @__PURE__ */ jsx(
86
86
  CheckboxNullableInput,
87
87
  {
88
88
  name: `${BUSBAR_SECTION_V_MEASUREMENTS}.${i}.${FieldConstants.VALIDITY}`,
@@ -1,6 +1,6 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
- import { Tabs, Tab, Box, Grid, TextField } from "@mui/material";
3
+ import { Grid2, TextField, Tabs, Tab, Box } from "@mui/material";
4
4
  import { FormattedMessage } from "react-intl";
5
5
  import { useWatch } from "react-hook-form";
6
6
  import { VoltageAdornment, KiloAmpereAdornment } from "../../../../utils/constants/adornments.js";
@@ -71,8 +71,49 @@ function VoltageLevelModificationForm({
71
71
  0
72
72
  /* CHARACTERISTICS_TAB */
73
73
  );
74
- return /* @__PURE__ */ jsxs(Fragment, { children: [
75
- /* @__PURE__ */ jsxs(
74
+ return /* @__PURE__ */ jsxs(Grid2, { container: true, direction: "column", spacing: 2, children: [
75
+ /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 2, children: [
76
+ /* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
77
+ TextField,
78
+ {
79
+ size: "small",
80
+ fullWidth: true,
81
+ label: "ID",
82
+ value: equipmentId ?? "",
83
+ InputProps: {
84
+ readOnly: true
85
+ },
86
+ disabled: true,
87
+ ...filledTextField
88
+ }
89
+ ) }),
90
+ /* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
91
+ TextInput,
92
+ {
93
+ name: FieldConstants.EQUIPMENT_NAME,
94
+ label: "Name",
95
+ formProps: filledTextField,
96
+ clearable: true,
97
+ previousValue: voltageLevelToModify?.name ?? void 0
98
+ }
99
+ ) }),
100
+ !watchHideSubstationField && /* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
101
+ AutocompleteInput,
102
+ {
103
+ allowNewValue: true,
104
+ forcePopupIcon: true,
105
+ name: FieldConstants.SUBSTATION_ID,
106
+ label: "SUBSTATION",
107
+ options: [voltageLevelToModify?.substationId ?? ""],
108
+ inputTransform: (value) => value === null ? "" : value,
109
+ outputTransform: (value) => value,
110
+ size: "small",
111
+ formProps: filledTextField,
112
+ disabled: true
113
+ }
114
+ ) })
115
+ ] }) }),
116
+ /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsxs(
76
117
  Tabs,
77
118
  {
78
119
  value: tabIndex,
@@ -106,53 +147,12 @@ function VoltageLevelModificationForm({
106
147
  )
107
148
  ]
108
149
  }
109
- ),
110
- /* @__PURE__ */ jsx(Box, { hidden: tabIndex !== 0, p: 1, children: /* @__PURE__ */ jsxs(Grid, { container: true, direction: "column", spacing: 2, children: [
111
- /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
112
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 4, children: /* @__PURE__ */ jsx(
113
- TextField,
114
- {
115
- size: "small",
116
- fullWidth: true,
117
- label: "ID",
118
- value: equipmentId ?? "",
119
- InputProps: {
120
- readOnly: true
121
- },
122
- disabled: true,
123
- ...filledTextField
124
- }
125
- ) }),
126
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 4, children: /* @__PURE__ */ jsx(
127
- TextInput,
128
- {
129
- name: FieldConstants.EQUIPMENT_NAME,
130
- label: "Name",
131
- formProps: filledTextField,
132
- clearable: true,
133
- previousValue: voltageLevelToModify?.name ?? void 0
134
- }
135
- ) }),
136
- !watchHideSubstationField && /* @__PURE__ */ jsx(Grid, { item: true, xs: 4, children: /* @__PURE__ */ jsx(
137
- AutocompleteInput,
138
- {
139
- allowNewValue: true,
140
- forcePopupIcon: true,
141
- name: FieldConstants.SUBSTATION_ID,
142
- label: "SUBSTATION",
143
- options: [voltageLevelToModify?.substationId ?? ""],
144
- inputTransform: (value) => value === null ? "" : value,
145
- outputTransform: (value) => value,
146
- size: "small",
147
- formProps: filledTextField,
148
- disabled: true
149
- }
150
- ) })
151
- ] }) }),
152
- /* @__PURE__ */ jsxs(Grid, { item: true, children: [
150
+ ) }),
151
+ /* @__PURE__ */ jsxs(Grid2, { children: [
152
+ /* @__PURE__ */ jsx(Box, { hidden: tabIndex !== 0, children: /* @__PURE__ */ jsxs(Grid2, { children: [
153
153
  /* @__PURE__ */ jsx(GridSection, { title: "VoltageText" }),
154
- /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
155
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 4, children: /* @__PURE__ */ jsx(
154
+ /* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 2, children: [
155
+ /* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
156
156
  FloatInput,
157
157
  {
158
158
  name: FieldConstants.NOMINAL_V,
@@ -162,7 +162,7 @@ function VoltageLevelModificationForm({
162
162
  previousValue: voltageLevelToModify?.nominalV
163
163
  }
164
164
  ) }),
165
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 4, children: /* @__PURE__ */ jsx(
165
+ /* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
166
166
  FloatInput,
167
167
  {
168
168
  name: FieldConstants.LOW_VOLTAGE_LIMIT,
@@ -172,7 +172,7 @@ function VoltageLevelModificationForm({
172
172
  previousValue: voltageLevelToModify?.lowVoltageLimit ?? void 0
173
173
  }
174
174
  ) }),
175
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 4, children: /* @__PURE__ */ jsx(
175
+ /* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
176
176
  FloatInput,
177
177
  {
178
178
  name: FieldConstants.HIGH_VOLTAGE_LIMIT,
@@ -184,8 +184,8 @@ function VoltageLevelModificationForm({
184
184
  ) })
185
185
  ] }),
186
186
  /* @__PURE__ */ jsx(GridSection, { title: "ShortCircuit" }),
187
- /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
188
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 4, children: /* @__PURE__ */ jsx(
187
+ /* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 2, children: [
188
+ /* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
189
189
  FloatInput,
190
190
  {
191
191
  name: FieldConstants.LOW_SHORT_CIRCUIT_CURRENT_LIMIT,
@@ -195,7 +195,7 @@ function VoltageLevelModificationForm({
195
195
  previousValue: voltageLevelToModify?.identifiableShortCircuit?.ipMin ?? void 0
196
196
  }
197
197
  ) }),
198
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 4, children: /* @__PURE__ */ jsx(
198
+ /* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
199
199
  FloatInput,
200
200
  {
201
201
  name: FieldConstants.HIGH_SHORT_CIRCUIT_CURRENT_LIMIT,
@@ -207,11 +207,11 @@ function VoltageLevelModificationForm({
207
207
  ) })
208
208
  ] }),
209
209
  /* @__PURE__ */ jsx(PropertiesForm, { networkElementType: "voltageLevel", isModification: true })
210
+ ] }) }),
211
+ /* @__PURE__ */ jsxs(Box, { hidden: tabIndex !== 1, children: [
212
+ /* @__PURE__ */ jsx(GridSection, { title: "MeasurementsSection" }),
213
+ /* @__PURE__ */ jsx(BusbarSectionVoltageMeasurementsForm, { busbarSections })
210
214
  ] })
211
- ] }) }),
212
- /* @__PURE__ */ jsxs(Box, { hidden: tabIndex !== 1, p: 1, children: [
213
- /* @__PURE__ */ jsx(GridSection, { title: "MeasurementsSection" }),
214
- /* @__PURE__ */ jsx(BusbarSectionVoltageMeasurementsForm, { busbarSections })
215
215
  ] })
216
216
  ] });
217
217
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.219.0",
3
+ "version": "0.219.2",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",