@gridsuite/commons-ui 0.149.0 → 0.150.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.
@@ -122,6 +122,7 @@ import { GridLogo, LogoText } from "./topBar/GridLogo.js";
122
122
  import { DevModeBanner } from "./topBar/DevModeBanner.js";
123
123
  import { TopBar } from "./topBar/TopBar.js";
124
124
  import { TreeViewFinder, generateTreeViewFinderClass } from "./treeViewFinder/TreeViewFinder.js";
125
+ import { doesNodeHasChildren } from "./treeViewFinder/TreeViewUtils.js";
125
126
  import { NotificationsProvider } from "./notifications/NotificationsProvider.js";
126
127
  import { NotificationsContext } from "./notifications/contexts/NotificationsContext.js";
127
128
  import { useNotificationsListener } from "./notifications/hooks/useNotificationsListener.js";
@@ -498,6 +499,7 @@ export {
498
499
  alertThresholdMarks,
499
500
  countRules,
500
501
  dispatchUser,
502
+ doesNodeHasChildren,
501
503
  expertFilterSchema,
502
504
  explicitNamingFilterSchema,
503
505
  exportExpertRules,
@@ -6,6 +6,7 @@ import { SimpleTreeView, TreeItem } from "@mui/x-tree-view";
6
6
  import { ExpandMore, ChevronRight, Check } from "@mui/icons-material";
7
7
  import { toNestedGlobalSelectors, makeComposeClasses } from "../../utils/styles.js";
8
8
  import { CancelButton } from "../inputs/reactHookForm/utils/CancelButton.js";
9
+ import { doesNodeHasChildren } from "./TreeViewUtils.js";
9
10
  const cssDialogPaper = "dialogPaper";
10
11
  const cssLabelRoot = "labelRoot";
11
12
  const cssLabelText = "labelText";
@@ -224,7 +225,7 @@ function TreeViewFinderComponant(props) {
224
225
  }
225
226
  let childrenNodes = null;
226
227
  const showExpandIcon = showChevron(node);
227
- if (Array.isArray(node.children) && node.children.length > 0) {
228
+ if (doesNodeHasChildren(node)) {
228
229
  childrenNodes = node.children.toSorted(sortMethod).map(renderTree);
229
230
  } else if (showExpandIcon) {
230
231
  childrenNodes = [/* @__PURE__ */ jsx("span", { style: { display: "none" } }, "placeholder")];
@@ -0,0 +1,2 @@
1
+ import { ElementAttributes } from '../../utils';
2
+ export declare function doesNodeHasChildren(node: ElementAttributes): boolean;
@@ -0,0 +1,6 @@
1
+ function doesNodeHasChildren(node) {
2
+ return Array.isArray(node.children) && node.children.length > 0;
3
+ }
4
+ export {
5
+ doesNodeHasChildren
6
+ };
@@ -5,3 +5,4 @@
5
5
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
6
  */
7
7
  export * from './TreeViewFinder';
8
+ export * from './TreeViewUtils';
@@ -1,5 +1,7 @@
1
1
  import { TreeViewFinder, generateTreeViewFinderClass } from "./TreeViewFinder.js";
2
+ import { doesNodeHasChildren } from "./TreeViewUtils.js";
2
3
  export {
3
4
  TreeViewFinder,
5
+ doesNodeHasChildren,
4
6
  generateTreeViewFinderClass
5
7
  };
package/dist/index.js CHANGED
@@ -123,6 +123,7 @@ import { GridLogo, LogoText } from "./components/topBar/GridLogo.js";
123
123
  import { DevModeBanner } from "./components/topBar/DevModeBanner.js";
124
124
  import { TopBar } from "./components/topBar/TopBar.js";
125
125
  import { TreeViewFinder, generateTreeViewFinderClass } from "./components/treeViewFinder/TreeViewFinder.js";
126
+ import { doesNodeHasChildren } from "./components/treeViewFinder/TreeViewUtils.js";
126
127
  import { NotificationsProvider } from "./components/notifications/NotificationsProvider.js";
127
128
  import { NotificationsContext } from "./components/notifications/contexts/NotificationsContext.js";
128
129
  import { useNotificationsListener } from "./components/notifications/hooks/useNotificationsListener.js";
@@ -728,6 +729,7 @@ export {
728
729
  dispatchUser,
729
730
  dndTableEn,
730
731
  dndTableFr,
732
+ doesNodeHasChildren,
731
733
  elementAlreadyExists,
732
734
  elementSearchEn,
733
735
  elementSearchFr,
@@ -157,7 +157,7 @@ const parametersEn = {
157
157
  ReactiveSlacksThresholdMustBeGreaterOrEqualToZero: "The threshold must be greater or equal to 0",
158
158
  ShuntCompensatorActivationThreshold: "Alert threshold on shunt compensator activation",
159
159
  ShuntCompensatorActivationThresholdMustBeGreaterOrEqualToZero: "The threshold must be greater or equal to 0",
160
- ShuntCompensatorActivationThresholdDescription: "Threshold (in MVar) above which the difference between discretized and optimal value for shunt compensator activation is considered significant (and will thus be recorded in the functional logs)",
160
+ ShuntCompensatorActivationThresholdDescription: "Threshold (in Mvar) above which the difference between discretized and optimal value for shunt compensator activation is considered significant (and will thus be recorded in the functional logs)",
161
161
  VoltageInitParametersError: "An error occurred while updating the voltage profile initialization parameters",
162
162
  AdjustExistingLimits: "Adjust existing limits",
163
163
  AdjustExistingLimitsInfo: "Please enter a positive number in order to increase an existing voltage limit and a negative number in order to decrease an existing voltage limit (new limit = existing limit + user input).",
@@ -157,7 +157,7 @@ const parametersFr = {
157
157
  ReactiveSlacksThresholdMustBeGreaterOrEqualToZero: "Le seuil doit être supérieur ou égal à 0",
158
158
  ShuntCompensatorActivationThreshold: "Seuil d'alerte sur l'enclenchement des MCS",
159
159
  ShuntCompensatorActivationThresholdMustBeGreaterOrEqualToZero: "Le seuil doit être supérieur ou égal à 0",
160
- ShuntCompensatorActivationThresholdDescription: "Seuil (en MVar) au-dessus duquel on considère qu'il y a un écart significatif (et donc tracé dans les logs fonctionnels) entre valeur arrondie et valeur théorique pour l'enclenchement d'un MCS",
160
+ ShuntCompensatorActivationThresholdDescription: "Seuil (en Mvar) au-dessus duquel on considère qu'il y a un écart significatif (et donc tracé dans les logs fonctionnels) entre valeur arrondie et valeur théorique pour l'enclenchement d'un MCS",
161
161
  VoltageInitParametersError: "Erreur lors de la mise à jour des paramètres d'initialisation du plan de tension",
162
162
  voltageInitCancelError: "L'initialisation du plan de tension n'a pas pu être annulée",
163
163
  AdjustExistingLimits: "Modifier les limites existantes",
@@ -8,7 +8,7 @@ export declare const MICRO_SIEMENS = "\u00B5S";
8
8
  export declare const SIEMENS = "S";
9
9
  export declare const AMPERE = "A";
10
10
  export declare const KILO_AMPERE = "kA";
11
- export declare const MEGA_VAR = "MVar";
11
+ export declare const MEGA_VAR = "Mvar";
12
12
  export declare const MEGA_VOLT_AMPERE = "MVA";
13
13
  export declare const OHM = "\u03A9";
14
14
  export declare const MEGA_WATT = "MW";
@@ -2,7 +2,7 @@ const MICRO_SIEMENS = "µS";
2
2
  const SIEMENS = "S";
3
3
  const AMPERE = "A";
4
4
  const KILO_AMPERE = "kA";
5
- const MEGA_VAR = "MVar";
5
+ const MEGA_VAR = "Mvar";
6
6
  const MEGA_VOLT_AMPERE = "MVA";
7
7
  const OHM = "Ω";
8
8
  const MEGA_WATT = "MW";
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.149.0",
3
+ "version": "0.150.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",
7
7
  "license": "MPL-2.0",
8
8
  "repository": "git://github.com/gridsuite/commons-ui.git",
9
9
  "engines": {
10
- "node": ">=22",
11
- "npm": "^10.9.2"
10
+ "node": ">=24",
11
+ "npm": "^11.6.2"
12
12
  },
13
13
  "type": "module",
14
14
  "exports": "./dist/index.js",
@@ -65,7 +65,7 @@
65
65
  "@mui/icons-material": "^5.16.14",
66
66
  "@mui/lab": "5.0.0-alpha.175",
67
67
  "@mui/material": "^5.16.14",
68
- "@mui/x-tree-view": "^7.29.1",
68
+ "@mui/x-tree-view": "^8.21.0",
69
69
  "ag-grid-community": "^33.0.3",
70
70
  "ag-grid-react": "^33.0.4",
71
71
  "notistack": "^3.0.2",