@gridsuite/commons-ui 0.88.2 → 0.89.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,7 +9,7 @@ function HelperPreviousValue({
9
9
  adornmentText
10
10
  }) {
11
11
  const intl = useIntl();
12
- if (previousValue === void 0) {
12
+ if (!previousValue && previousValue !== 0) {
13
13
  return void 0;
14
14
  }
15
15
  return /* @__PURE__ */ jsx(FormHelperText, { error: false, sx: { marginLeft: 0 }, children: !disabledTooltip ? /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, sx: { alignItems: "center" }, children: [
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { TableView, Calculate, Settings, Article, NoteAlt, OfflineBolt, Photo, PhotoLibrary } from "@mui/icons-material";
2
+ import { Hub, TableView, Calculate, Settings, Article, NoteAlt, OfflineBolt, Photo, PhotoLibrary } from "@mui/icons-material";
3
3
  import { ElementType } from "../types/elementType.js";
4
4
  function getFileIcon(type, style) {
5
5
  switch (type) {
@@ -24,6 +24,8 @@ function getFileIcon(type, style) {
24
24
  return /* @__PURE__ */ jsx(Calculate, { sx: style });
25
25
  case ElementType.SPREADSHEET_CONFIG_COLLECTION:
26
26
  return /* @__PURE__ */ jsx(TableView, { sx: style });
27
+ case ElementType.DIAGRAM_CONFIG:
28
+ return /* @__PURE__ */ jsx(Hub, { sx: style });
27
29
  case ElementType.DIRECTORY:
28
30
  return void 0;
29
31
  default:
@@ -21,5 +21,6 @@ export declare enum ElementType {
21
21
  SHORT_CIRCUIT_PARAMETERS = "SHORT_CIRCUIT_PARAMETERS",
22
22
  NETWORK_VISUALIZATIONS_PARAMETERS = "NETWORK_VISUALIZATIONS_PARAMETERS",
23
23
  SPREADSHEET_CONFIG = "SPREADSHEET_CONFIG",
24
- SPREADSHEET_CONFIG_COLLECTION = "SPREADSHEET_CONFIG_COLLECTION"
24
+ SPREADSHEET_CONFIG_COLLECTION = "SPREADSHEET_CONFIG_COLLECTION",
25
+ DIAGRAM_CONFIG = "DIAGRAM_CONFIG"
25
26
  }
@@ -13,6 +13,7 @@ var ElementType = /* @__PURE__ */ ((ElementType2) => {
13
13
  ElementType2["NETWORK_VISUALIZATIONS_PARAMETERS"] = "NETWORK_VISUALIZATIONS_PARAMETERS";
14
14
  ElementType2["SPREADSHEET_CONFIG"] = "SPREADSHEET_CONFIG";
15
15
  ElementType2["SPREADSHEET_CONFIG_COLLECTION"] = "SPREADSHEET_CONFIG_COLLECTION";
16
+ ElementType2["DIAGRAM_CONFIG"] = "DIAGRAM_CONFIG";
16
17
  return ElementType2;
17
18
  })(ElementType || {});
18
19
  export {
@@ -1,9 +1,5 @@
1
- /**
2
- * Copyright (c) 2021, 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
- */
1
+ import { Theme } from '@mui/material';
2
+
7
3
  export declare const TYPE_TAG_MAX_SIZE = "90px";
8
4
  export declare const VL_TAG_MAX_SIZE = "100px";
9
5
  export declare const equipmentStyles: {
@@ -16,6 +12,13 @@ export declare const equipmentStyles: {
16
12
  alignItems: string;
17
13
  justifyContent: string;
18
14
  };
15
+ equipmentTag: (theme: string | Theme) => {
16
+ borderRadius: string;
17
+ padding: string;
18
+ fontSize: string;
19
+ textAlign: string;
20
+ color: string;
21
+ };
19
22
  equipmentTypeTag: {
20
23
  minWidth: string;
21
24
  maxWidth: string;
@@ -1,3 +1,4 @@
1
+ import { LIGHT_THEME } from "../constants/browserConstants.js";
1
2
  const TYPE_TAG_MAX_SIZE = "90px";
2
3
  const VL_TAG_MAX_SIZE = "100px";
3
4
  const equipmentStyles = {
@@ -10,6 +11,19 @@ const equipmentStyles = {
10
11
  alignItems: "center",
11
12
  justifyContent: "space-between"
12
13
  },
14
+ equipmentTag: (theme) => {
15
+ var _a;
16
+ return {
17
+ borderRadius: "10px",
18
+ padding: "4px",
19
+ fontSize: "x-small",
20
+ textAlign: "center",
21
+ color: (
22
+ // TODO remove first condition when gridstudy is updated
23
+ theme === LIGHT_THEME || typeof theme !== "string" && ((_a = theme == null ? void 0 : theme.palette) == null ? void 0 : _a.mode) === "light" ? "inherit" : "black"
24
+ )
25
+ };
26
+ },
13
27
  equipmentTypeTag: {
14
28
  minWidth: TYPE_TAG_MAX_SIZE,
15
29
  maxWidth: TYPE_TAG_MAX_SIZE,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.88.2",
3
+ "version": "0.89.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "engines": {
6
6
  "node": ">=22",