@gridsuite/commons-ui 0.274.0 → 0.276.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.
@@ -9,5 +9,5 @@ export type BooleanInputProps<TInput extends InputTypes> = {
9
9
  Input: TInput;
10
10
  dataTestId?: string;
11
11
  };
12
- export declare function BooleanInput<TInput extends InputTypes>({ name, label, formProps, Input, dataTestId, }: Readonly<BooleanInputProps<TInput>>): JSX.Element;
12
+ export declare function BooleanInput<TInput extends InputTypes>({ name, label, formProps, Input, dataTestId, ...props }: Readonly<BooleanInputProps<TInput>>): JSX.Element;
13
13
  export {};
@@ -8,7 +8,8 @@ function BooleanInput({
8
8
  label,
9
9
  formProps,
10
10
  Input,
11
- dataTestId
11
+ dataTestId,
12
+ ...props
12
13
  }) {
13
14
  const { onChange, slotProps, ...otherFormProps } = formProps ?? { onChange: void 0 };
14
15
  const {
@@ -30,7 +31,8 @@ function BooleanInput({
30
31
  inputRef: ref,
31
32
  slotProps: { input: { "aria-label": "primary checkbox" }, ...slotProps },
32
33
  "data-testid": dataTestId,
33
- ...otherFormProps
34
+ ...otherFormProps,
35
+ ...props
34
36
  }
35
37
  );
36
38
  if (label) {
@@ -5,5 +5,5 @@ interface TableTextInputProps {
5
5
  inputProps?: InputBaseComponentProps;
6
6
  dataTestId?: string;
7
7
  }
8
- export declare function TableTextInput({ name, hideErrorMessage, inputProps, dataTestId }: Readonly<TableTextInputProps>): import("react").JSX.Element;
8
+ export declare function TableTextInput({ name, hideErrorMessage, inputProps, dataTestId, ...props }: Readonly<TableTextInputProps>): import("react").JSX.Element;
9
9
  export {};
@@ -5,7 +5,13 @@ 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, dataTestId }) {
8
+ function TableTextInput({
9
+ name,
10
+ hideErrorMessage,
11
+ inputProps,
12
+ dataTestId,
13
+ ...props
14
+ }) {
9
15
  const {
10
16
  field: { onChange, value, ref },
11
17
  fieldState: { error }
@@ -38,7 +44,8 @@ function TableTextInput({ name, hideErrorMessage, inputProps, dataTestId }) {
38
44
  }
39
45
  }
40
46
  },
41
- ...hideErrorMessage ? {} : genHelperError(error?.message)
47
+ ...hideErrorMessage ? {} : genHelperError(error?.message),
48
+ ...props
42
49
  }
43
50
  );
44
51
  }
@@ -90,7 +90,10 @@ function ReferenceLinkCell({ data, disabled = false }) {
90
90
  `Cannot build reference link: ${!referenceId ? "referenceId" : "exploreUrl"} is missing`
91
91
  );
92
92
  }
93
- const link = `${exploreUrl}/elements/${referenceId}`;
93
+ const link = new URL(
94
+ `${exploreUrl}/elements/${referenceId}`,
95
+ globalThis.location.origin
96
+ ).toString();
94
97
  return navigator.clipboard.writeText(link).then(() => snackInfo({ headerId: "linkCopied" }));
95
98
  }).catch((error) => snackWithFallback(snackError, error, { headerId: "linkCopyError" })).finally(() => setIsLoading(false));
96
99
  },
@@ -95,7 +95,7 @@ function LimitsPane({
95
95
  const watchedOperationalLimitsGroups = useWatch({
96
96
  name: operationalLimitsGroupsFormName
97
97
  });
98
- const isAModification = useMemo(() => !!equipmentToModify, [equipmentToModify]);
98
+ const equipmentPresent = useMemo(() => !!equipmentToModify, [equipmentToModify]);
99
99
  const getCurrentLimits = (equipment, operationalLimitsGroupId) => {
100
100
  if (equipment?.currentLimits) {
101
101
  return equipment.currentLimits.find(
@@ -155,7 +155,7 @@ function LimitsPane({
155
155
  display: "flex",
156
156
  alignItems: "center"
157
157
  },
158
- children: isAModification && /* @__PURE__ */ jsx(
158
+ children: isModification && /* @__PURE__ */ jsx(
159
159
  InputWithPopupConfirmation,
160
160
  {
161
161
  Input: SwitchInput,
@@ -163,7 +163,7 @@ function LimitsPane({
163
163
  label: olgEditable ? "Edit" : "View",
164
164
  shouldOpenPopup: () => olgEditable,
165
165
  onValueChange: resetOLGs,
166
- message: "disableOLGedition",
166
+ message: equipmentPresent ? "disableOLGeditionByReplace" : "disableOLGedition",
167
167
  validateButtonLabel: "validate"
168
168
  }
169
169
  )
@@ -289,6 +289,7 @@ export declare const networkModificationsEn: {
289
289
  unlimited: string;
290
290
  forbidden: string;
291
291
  Applicability: string;
292
+ disableOLGeditionByReplace: string;
292
293
  disableOLGedition: string;
293
294
  Edit: string;
294
295
  View: string;
@@ -284,7 +284,8 @@ const networkModificationsEn = {
284
284
  unlimited: "Unlimited",
285
285
  forbidden: "Forbidden",
286
286
  Applicability: "Applicability",
287
- disableOLGedition: "Entered limit sets data will be lost. Do you wish to continue?",
287
+ disableOLGeditionByReplace: "Entered limit sets data will be lost to display their current values. Do you wish to continue ?",
288
+ disableOLGedition: "Entered limit sets data will be lost. Do you wish to continue ?",
288
289
  Edit: "Edit",
289
290
  View: "View",
290
291
  TemporaryCurrentLimitsText: "Temporary current limits",
@@ -289,6 +289,7 @@ export declare const networkModificationsFr: {
289
289
  unlimited: string;
290
290
  forbidden: string;
291
291
  Applicability: string;
292
+ disableOLGeditionByReplace: string;
292
293
  disableOLGedition: string;
293
294
  Edit: string;
294
295
  View: string;
@@ -284,7 +284,8 @@ const networkModificationsFr = {
284
284
  unlimited: "Illimité",
285
285
  forbidden: "Interdit",
286
286
  Applicability: "Applicable sur",
287
- disableOLGedition: "Les données saisies pour les jeux de limites ne seront pas conservées. Voulez-vous continuer ?",
287
+ disableOLGeditionByReplace: "Les données saisies pour les jeux de limites seront perdues pour afficher leurs valeurs courantes. Voulez-vous continuer ?",
288
+ disableOLGedition: "Les données saisies pour les jeux de limites seront perdues. Voulez-vous continuer ?",
288
289
  Edit: "Édition",
289
290
  View: "Visualisation",
290
291
  TemporaryCurrentLimitsText: "Limites d'intensité temporaires",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.274.0",
3
+ "version": "0.276.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",