@gridsuite/commons-ui 0.94.0 → 0.96.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/checkBoxList/CheckBoxList.d.ts +1 -1
- package/dist/components/checkBoxList/CheckBoxList.js +3 -11
- package/dist/components/checkBoxList/CheckBoxListItem.d.ts +1 -1
- package/dist/components/checkBoxList/CheckBoxListItem.js +47 -14
- package/dist/components/checkBoxList/CheckBoxListItemContent.d.ts +2 -0
- package/dist/components/checkBoxList/CheckBoxListItemContent.js +45 -0
- package/dist/components/checkBoxList/CheckBoxListItems.d.ts +1 -1
- package/dist/components/checkBoxList/CheckBoxListItems.js +24 -20
- package/dist/components/checkBoxList/DraggableCheckBoxListItem.d.ts +1 -1
- package/dist/components/checkBoxList/DraggableCheckBoxListItem.js +46 -17
- package/dist/components/checkBoxList/DraggableCheckBoxListItemContent.d.ts +2 -0
- package/dist/components/checkBoxList/DraggableCheckBoxListItemContent.js +38 -0
- package/dist/components/checkBoxList/checkBoxList.type.d.ts +9 -11
- package/dist/components/customAGGrid/customAggrid.d.ts +11 -8
- package/dist/components/customAGGrid/customAggrid.js +51 -48
- package/dist/components/customAGGrid/customAggrid.style.d.ts +0 -5
- package/dist/components/customAGGrid/customAggrid.style.js +1 -7
- package/dist/components/dialogs/elementSaveDialog/ElementSaveDialog.js +0 -2
- package/dist/components/filter/HeaderFilterForm.js +0 -2
- package/dist/components/icons/LeftPanelCloseIcon.d.ts +7 -0
- package/dist/components/icons/LeftPanelCloseIcon.js +19 -0
- package/dist/components/icons/LeftPanelOpenIcon.d.ts +7 -0
- package/dist/components/icons/LeftPanelOpenIcon.js +19 -0
- package/dist/components/icons/index.d.ts +8 -0
- package/dist/components/icons/index.js +6 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +4 -0
- package/dist/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.d.ts +4 -11
- package/dist/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.js +0 -23
- package/dist/components/topBar/TopBar.d.ts +3 -5
- package/dist/components/topBar/TopBar.js +2 -1
- package/dist/hooks/useLocalizedCountries.js +1 -1
- package/dist/index.js +6 -2
- package/dist/utils/constants/index.d.ts +0 -1
- package/dist/utils/constants/index.js +0 -6
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +2 -2
- package/dist/utils/langs.d.ts +5 -0
- package/dist/utils/{constants/browserConstants.js → langs.js} +1 -5
- package/dist/utils/styles.d.ts +3 -0
- package/dist/utils/styles.js +4 -0
- package/dist/utils/types/equipmentType.js +1 -1
- package/package.json +3 -1
- package/dist/components/checkBoxList/ClickableCheckBoxItem.d.ts +0 -2
- package/dist/components/checkBoxList/ClickableCheckBoxItem.js +0 -12
- package/dist/components/checkBoxList/ClickableRowItem.d.ts +0 -2
- package/dist/components/checkBoxList/ClickableRowItem.js +0 -51
- package/dist/components/checkBoxList/DraggableClickableCheckBoxItem.d.ts +0 -2
- package/dist/components/checkBoxList/DraggableClickableCheckBoxItem.js +0 -50
- package/dist/components/checkBoxList/DraggableClickableRowItem.d.ts +0 -2
- package/dist/components/checkBoxList/DraggableClickableRowItem.js +0 -77
- package/dist/utils/constants/browserConstants.d.ts +0 -11
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, 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 declare function LeftPanelCloseIcon(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import LeftPanelClose from "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
3
|
+
import { useTheme } from "@mui/material";
|
|
4
|
+
function LeftPanelCloseIcon() {
|
|
5
|
+
const theme = useTheme();
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
LeftPanelClose,
|
|
8
|
+
{
|
|
9
|
+
style: {
|
|
10
|
+
width: 24,
|
|
11
|
+
height: 24,
|
|
12
|
+
fill: theme.palette.text.primary
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
LeftPanelCloseIcon
|
|
19
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, 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 declare function LeftPanelOpenIcon(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import LeftPanelOpen from "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
3
|
+
import { useTheme } from "@mui/material";
|
|
4
|
+
function LeftPanelOpenIcon() {
|
|
5
|
+
const theme = useTheme();
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
LeftPanelOpen,
|
|
8
|
+
{
|
|
9
|
+
style: {
|
|
10
|
+
width: 24,
|
|
11
|
+
height: 24,
|
|
12
|
+
fill: theme.palette.text.primary
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
LeftPanelOpenIcon
|
|
19
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, 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 { LeftPanelOpenIcon } from './LeftPanelOpenIcon';
|
|
8
|
+
export { LeftPanelCloseIcon } from './LeftPanelCloseIcon';
|
package/dist/components/index.js
CHANGED
|
@@ -105,6 +105,8 @@ import { NotificationsProvider } from "./notifications/NotificationsProvider.js"
|
|
|
105
105
|
import { NotificationsContext } from "./notifications/contexts/NotificationsContext.js";
|
|
106
106
|
import { useNotificationsListener } from "./notifications/hooks/useNotificationsListener.js";
|
|
107
107
|
import { useListenerManager } from "./notifications/hooks/useListenerManager.js";
|
|
108
|
+
import { LeftPanelOpenIcon } from "./icons/LeftPanelOpenIcon.js";
|
|
109
|
+
import { LeftPanelCloseIcon } from "./icons/LeftPanelCloseIcon.js";
|
|
108
110
|
export {
|
|
109
111
|
AboutDialog,
|
|
110
112
|
ActivableChip,
|
|
@@ -175,6 +177,8 @@ export {
|
|
|
175
177
|
InputWithPopupConfirmation,
|
|
176
178
|
IntegerInput,
|
|
177
179
|
LOAD_TYPE_OPTIONS,
|
|
180
|
+
LeftPanelCloseIcon,
|
|
181
|
+
LeftPanelOpenIcon,
|
|
178
182
|
Login,
|
|
179
183
|
LogoText,
|
|
180
184
|
Logout,
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
1
|
+
import { CustomAGGridProps } from '../../../customAGGrid';
|
|
2
|
+
export type CustomAgGridTableProps = Required<Pick<CustomAGGridProps, 'columnDefs' | 'defaultColDef' | 'pagination' | 'paginationPageSize' | 'alwaysShowVerticalScroll' | 'stopEditingWhenCellsLoseFocus'>> & Pick<CustomAGGridProps, 'rowSelection' | 'overrideLocales'> & {
|
|
3
3
|
name: string;
|
|
4
|
-
columnDefs: any;
|
|
5
4
|
makeDefaultRowData: any;
|
|
6
5
|
csvProps: unknown;
|
|
7
6
|
cssProps: unknown;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
paginationPageSize: number;
|
|
11
|
-
rowSelection?: AgGridReactProps['rowSelection'];
|
|
12
|
-
alwaysShowVerticalScroll: boolean;
|
|
13
|
-
stopEditingWhenCellsLoseFocus: boolean;
|
|
14
|
-
}
|
|
15
|
-
export declare function CustomAgGridTable({ name, columnDefs, makeDefaultRowData, csvProps, cssProps, defaultColDef, pagination, paginationPageSize, rowSelection, alwaysShowVerticalScroll, stopEditingWhenCellsLoseFocus, ...props }: Readonly<CustomAgGridTableProps>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
};
|
|
8
|
+
export declare function CustomAgGridTable({ name, makeDefaultRowData, csvProps, cssProps, rowSelection, ...props }: Readonly<CustomAgGridTableProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useCallback, useEffect } from "react";
|
|
3
3
|
import { useFormContext, useFieldArray } from "react-hook-form";
|
|
4
|
-
import "ag-grid-community/styles/ag-grid.css";
|
|
5
|
-
import "ag-grid-community/styles/ag-theme-alpine.css";
|
|
6
4
|
import { useTheme, Box } from "@mui/material";
|
|
7
|
-
import { useIntl } from "react-intl";
|
|
8
5
|
import { BottomRightButtons } from "./BottomRightButtons.js";
|
|
9
6
|
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
10
7
|
import { CustomAGGrid } from "../../../customAGGrid/customAggrid.js";
|
|
@@ -65,16 +62,10 @@ const style = (customProps) => ({
|
|
|
65
62
|
});
|
|
66
63
|
function CustomAgGridTable({
|
|
67
64
|
name,
|
|
68
|
-
columnDefs,
|
|
69
65
|
makeDefaultRowData,
|
|
70
66
|
csvProps,
|
|
71
67
|
cssProps,
|
|
72
|
-
defaultColDef,
|
|
73
|
-
pagination,
|
|
74
|
-
paginationPageSize,
|
|
75
68
|
rowSelection,
|
|
76
|
-
alwaysShowVerticalScroll,
|
|
77
|
-
stopEditingWhenCellsLoseFocus,
|
|
78
69
|
...props
|
|
79
70
|
}) {
|
|
80
71
|
var _a, _b;
|
|
@@ -136,14 +127,6 @@ function CustomAgGridTable({
|
|
|
136
127
|
append(makeDefaultRowData());
|
|
137
128
|
setNewRowAdded(true);
|
|
138
129
|
};
|
|
139
|
-
const intl = useIntl();
|
|
140
|
-
const getLocaleText = useCallback(
|
|
141
|
-
(params) => {
|
|
142
|
-
const key = `agGrid.${params.key}`;
|
|
143
|
-
return intl.messages[key] || params.defaultValue;
|
|
144
|
-
},
|
|
145
|
-
[intl]
|
|
146
|
-
);
|
|
147
130
|
const onGridReady = (params) => {
|
|
148
131
|
setGridApi(params);
|
|
149
132
|
};
|
|
@@ -175,13 +158,11 @@ function CustomAgGridTable({
|
|
|
175
158
|
{
|
|
176
159
|
rowData,
|
|
177
160
|
onGridReady,
|
|
178
|
-
getLocaleText,
|
|
179
161
|
cacheOverflowSize: 10,
|
|
180
162
|
rowSelection: rowSelection ?? "multiple",
|
|
181
163
|
rowDragEntireRow: true,
|
|
182
164
|
rowDragManaged: true,
|
|
183
165
|
onRowDragEnd: (e) => move(getIndex(e.node.data), e.overIndex),
|
|
184
|
-
columnDefs,
|
|
185
166
|
detailRowAutoHeight: true,
|
|
186
167
|
onSelectionChanged: () => {
|
|
187
168
|
setSelectedRows(gridApi.api.getSelectedRows());
|
|
@@ -190,10 +171,6 @@ function CustomAgGridTable({
|
|
|
190
171
|
onCellEditingStopped,
|
|
191
172
|
onSortChanged,
|
|
192
173
|
getRowId: (row) => row.data[FieldConstants.AG_GRID_ROW_UUID],
|
|
193
|
-
pagination,
|
|
194
|
-
paginationPageSize,
|
|
195
|
-
alwaysShowVerticalScroll,
|
|
196
|
-
stopEditingWhenCellsLoseFocus,
|
|
197
174
|
theme: "legacy",
|
|
198
175
|
...props
|
|
199
176
|
}
|
|
@@ -3,11 +3,9 @@ import { User } from 'oidc-client';
|
|
|
3
3
|
import { GridLogoProps } from './GridLogo';
|
|
4
4
|
import { AboutDialogProps } from './AboutDialog';
|
|
5
5
|
import { LogoutProps } from '../authentication/Logout';
|
|
6
|
-
import { Metadata } from '../../utils';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
export type GsLang = GsLangUser | typeof LANG_SYSTEM;
|
|
10
|
-
export type GsTheme = typeof LIGHT_THEME | typeof DARK_THEME;
|
|
6
|
+
import { Metadata } from '../../utils/types/metadata';
|
|
7
|
+
import { GsTheme } from '../../utils/styles';
|
|
8
|
+
import { GsLang } from '../../utils/langs';
|
|
11
9
|
export type TopBarProps = Omit<GridLogoProps, 'onClick'> & Omit<LogoutProps, 'disabled'> & Omit<AboutDialogProps, 'open' | 'onClose'> & {
|
|
12
10
|
onLogoClick: GridLogoProps['onClick'];
|
|
13
11
|
user?: User;
|
|
@@ -8,7 +8,8 @@ import { AboutDialog } from "./AboutDialog.js";
|
|
|
8
8
|
import { useStateBoolean } from "../../hooks/customStates/useStateBoolean.js";
|
|
9
9
|
import UserInformationDialog from "./UserInformationDialog.js";
|
|
10
10
|
import UserSettingsDialog from "./UserSettingsDialog.js";
|
|
11
|
-
import { LIGHT_THEME, DARK_THEME
|
|
11
|
+
import { LIGHT_THEME, DARK_THEME } from "../../utils/styles.js";
|
|
12
|
+
import { LANG_SYSTEM, LANG_ENGLISH, LANG_FRENCH } from "../../utils/langs.js";
|
|
12
13
|
import MessageBanner from "./MessageBanner.js";
|
|
13
14
|
const styles = {
|
|
14
15
|
grow: {
|
|
@@ -2,7 +2,7 @@ import { useState, useEffect, useMemo, useCallback } from "react";
|
|
|
2
2
|
import localizedCountries from "localized-countries";
|
|
3
3
|
import countriesFr from "localized-countries/data/fr";
|
|
4
4
|
import countriesEn from "localized-countries/data/en";
|
|
5
|
-
import { LANG_ENGLISH, LANG_FRENCH, LANG_SYSTEM } from "../utils/
|
|
5
|
+
import { LANG_ENGLISH, LANG_FRENCH, LANG_SYSTEM } from "../utils/langs.js";
|
|
6
6
|
const supportedLanguages = [LANG_FRENCH, LANG_ENGLISH];
|
|
7
7
|
const getSystemLanguage = () => {
|
|
8
8
|
const systemLanguage = navigator.language.split(/[-_]/)[0];
|
package/dist/index.js
CHANGED
|
@@ -106,6 +106,8 @@ import { NotificationsProvider } from "./components/notifications/NotificationsP
|
|
|
106
106
|
import { NotificationsContext } from "./components/notifications/contexts/NotificationsContext.js";
|
|
107
107
|
import { useNotificationsListener } from "./components/notifications/hooks/useNotificationsListener.js";
|
|
108
108
|
import { useListenerManager } from "./components/notifications/hooks/useListenerManager.js";
|
|
109
|
+
import { LeftPanelOpenIcon } from "./components/icons/LeftPanelOpenIcon.js";
|
|
110
|
+
import { LeftPanelCloseIcon } from "./components/icons/LeftPanelCloseIcon.js";
|
|
109
111
|
import { useStateBoolean } from "./hooks/customStates/useStateBoolean.js";
|
|
110
112
|
import { useStateNumber } from "./hooks/customStates/useStateNumber.js";
|
|
111
113
|
import { useModificationLabelComputer } from "./hooks/useModificationLabelComputer.js";
|
|
@@ -126,16 +128,16 @@ import { fetchAppsMetadata, fetchDefaultCountry, fetchEnv, fetchFavoriteAndDefau
|
|
|
126
128
|
import { elementAlreadyExists, fetchDirectoryContent, fetchDirectoryElementPath, fetchRootFolders } from "./services/directory.js";
|
|
127
129
|
import { exportFilter } from "./services/study.js";
|
|
128
130
|
import { equalsArray } from "./utils/algos.js";
|
|
129
|
-
import { DARK_THEME, LANG_ENGLISH, LANG_FRENCH, LANG_SYSTEM, LIGHT_THEME } from "./utils/constants/browserConstants.js";
|
|
130
131
|
import { FetchStatus } from "./utils/constants/fetchStatus.js";
|
|
131
132
|
import { FieldConstants } from "./utils/constants/fieldConstants.js";
|
|
132
133
|
import { MAX_CHAR_DESCRIPTION } from "./utils/constants/uiConstants.js";
|
|
133
134
|
import { AMPERE, DEGREE, KILO_AMPERE, KILO_METER, KILO_VOLT, MEGA_VAR, MEGA_VOLT_AMPERE, MEGA_WATT, MICRO_SIEMENS, OHM, PERCENTAGE, SIEMENS } from "./utils/constants/unitsConstants.js";
|
|
134
135
|
import { GRIDSUITE_DEFAULT_PRECISION, convertInputValue, convertOutputValue, isBlankOrEmpty, kiloUnitToUnit, microUnitToUnit, roundToDefaultPrecision, roundToPrecision, unitToKiloUnit, unitToMicroUnit } from "./utils/conversionUtils.js";
|
|
135
136
|
import { areArrayElementsUnique, isObjectEmpty, keyGenerator } from "./utils/functions.js";
|
|
137
|
+
import { LANG_ENGLISH, LANG_FRENCH, LANG_SYSTEM } from "./utils/langs.js";
|
|
136
138
|
import { getFileIcon } from "./utils/mapper/getFileIcon.js";
|
|
137
139
|
import { equipmentTypesForPredefinedPropertiesMapper } from "./utils/mapper/equipmentTypesForPredefinedPropertiesMapper.js";
|
|
138
|
-
import { makeComposeClasses, mergeSx, toNestedGlobalSelectors } from "./utils/styles.js";
|
|
140
|
+
import { DARK_THEME, LIGHT_THEME, makeComposeClasses, mergeSx, toNestedGlobalSelectors } from "./utils/styles.js";
|
|
139
141
|
import { ElementType } from "./utils/types/elementType.js";
|
|
140
142
|
import { BASE_EQUIPMENTS, EQUIPMENT_TYPE, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./utils/types/equipmentType.js";
|
|
141
143
|
import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel } from "./utils/types/equipmentTypes.js";
|
|
@@ -284,6 +286,8 @@ export {
|
|
|
284
286
|
LIGHT_THEME,
|
|
285
287
|
LOAD_TYPE_OPTIONS,
|
|
286
288
|
LOGOUT_ERROR,
|
|
289
|
+
LeftPanelCloseIcon,
|
|
290
|
+
LeftPanelOpenIcon,
|
|
287
291
|
Line,
|
|
288
292
|
Load,
|
|
289
293
|
Login,
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
5
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
6
|
*/
|
|
7
|
-
export * from './browserConstants';
|
|
8
7
|
export * from './fetchStatus';
|
|
9
8
|
export * from './fieldConstants';
|
|
10
9
|
export * from './uiConstants';
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
import { DARK_THEME, LANG_ENGLISH, LANG_FRENCH, LANG_SYSTEM, LIGHT_THEME } from "./browserConstants.js";
|
|
2
1
|
import { FetchStatus } from "./fetchStatus.js";
|
|
3
2
|
import { FieldConstants } from "./fieldConstants.js";
|
|
4
3
|
import { MAX_CHAR_DESCRIPTION } from "./uiConstants.js";
|
|
5
4
|
import { AMPERE, DEGREE, KILO_AMPERE, KILO_METER, KILO_VOLT, MEGA_VAR, MEGA_VOLT_AMPERE, MEGA_WATT, MICRO_SIEMENS, OHM, PERCENTAGE, SIEMENS } from "./unitsConstants.js";
|
|
6
5
|
export {
|
|
7
6
|
AMPERE,
|
|
8
|
-
DARK_THEME,
|
|
9
7
|
DEGREE,
|
|
10
8
|
FetchStatus,
|
|
11
9
|
FieldConstants,
|
|
12
10
|
KILO_AMPERE,
|
|
13
11
|
KILO_METER,
|
|
14
12
|
KILO_VOLT,
|
|
15
|
-
LANG_ENGLISH,
|
|
16
|
-
LANG_FRENCH,
|
|
17
|
-
LANG_SYSTEM,
|
|
18
|
-
LIGHT_THEME,
|
|
19
13
|
MAX_CHAR_DESCRIPTION,
|
|
20
14
|
MEGA_VAR,
|
|
21
15
|
MEGA_VOLT_AMPERE,
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { equalsArray } from "./algos.js";
|
|
2
|
-
import { DARK_THEME, LANG_ENGLISH, LANG_FRENCH, LANG_SYSTEM, LIGHT_THEME } from "./constants/browserConstants.js";
|
|
3
2
|
import { FetchStatus } from "./constants/fetchStatus.js";
|
|
4
3
|
import { FieldConstants } from "./constants/fieldConstants.js";
|
|
5
4
|
import { MAX_CHAR_DESCRIPTION } from "./constants/uiConstants.js";
|
|
6
5
|
import { AMPERE, DEGREE, KILO_AMPERE, KILO_METER, KILO_VOLT, MEGA_VAR, MEGA_VOLT_AMPERE, MEGA_WATT, MICRO_SIEMENS, OHM, PERCENTAGE, SIEMENS } from "./constants/unitsConstants.js";
|
|
7
6
|
import { GRIDSUITE_DEFAULT_PRECISION, convertInputValue, convertOutputValue, isBlankOrEmpty, kiloUnitToUnit, microUnitToUnit, roundToDefaultPrecision, roundToPrecision, unitToKiloUnit, unitToMicroUnit } from "./conversionUtils.js";
|
|
8
7
|
import { areArrayElementsUnique, isObjectEmpty, keyGenerator } from "./functions.js";
|
|
8
|
+
import { LANG_ENGLISH, LANG_FRENCH, LANG_SYSTEM } from "./langs.js";
|
|
9
9
|
import { getFileIcon } from "./mapper/getFileIcon.js";
|
|
10
10
|
import { equipmentTypesForPredefinedPropertiesMapper } from "./mapper/equipmentTypesForPredefinedPropertiesMapper.js";
|
|
11
|
-
import { makeComposeClasses, mergeSx, toNestedGlobalSelectors } from "./styles.js";
|
|
11
|
+
import { DARK_THEME, LIGHT_THEME, makeComposeClasses, mergeSx, toNestedGlobalSelectors } from "./styles.js";
|
|
12
12
|
import { ElementType } from "./types/elementType.js";
|
|
13
13
|
import { BASE_EQUIPMENTS, EQUIPMENT_TYPE, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./types/equipmentType.js";
|
|
14
14
|
import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel } from "./types/equipmentTypes.js";
|
package/dist/utils/styles.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { SxProps, Theme } from '@mui/material';
|
|
2
|
+
export declare const DARK_THEME = "Dark";
|
|
3
|
+
export declare const LIGHT_THEME = "Light";
|
|
4
|
+
export type GsTheme = typeof LIGHT_THEME | typeof DARK_THEME;
|
|
2
5
|
export declare const makeComposeClasses: (generateGlobalClass: (className: string) => string) => (classes: Record<string, string>, ruleName: string) => string;
|
|
3
6
|
export declare const toNestedGlobalSelectors: (styles: object, generateGlobalClass: (className: string) => string) => {
|
|
4
7
|
[k: string]: any;
|
package/dist/utils/styles.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const DARK_THEME = "Dark";
|
|
2
|
+
const LIGHT_THEME = "Light";
|
|
1
3
|
const makeComposeClasses = (generateGlobalClass) => (classes, ruleName) => [generateGlobalClass(ruleName), classes[ruleName]].filter((x) => x).join(" ");
|
|
2
4
|
const toNestedGlobalSelectors = (styles, generateGlobalClass) => Object.fromEntries(Object.entries(styles).map(([k, v]) => [`& .${generateGlobalClass(k)}`, v]));
|
|
3
5
|
const isSxProps = (sx) => {
|
|
@@ -5,6 +7,8 @@ const isSxProps = (sx) => {
|
|
|
5
7
|
};
|
|
6
8
|
const mergeSx = (...allSx) => allSx.filter(isSxProps).flat();
|
|
7
9
|
export {
|
|
10
|
+
DARK_THEME,
|
|
11
|
+
LIGHT_THEME,
|
|
8
12
|
makeComposeClasses,
|
|
9
13
|
mergeSx,
|
|
10
14
|
toNestedGlobalSelectors
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridsuite/commons-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.96.0",
|
|
4
4
|
"description": "common react components for gridsuite applications",
|
|
5
5
|
"author": "gridsuite team",
|
|
6
6
|
"homepage": "https://github.com/gridsuite",
|
|
@@ -34,7 +34,9 @@
|
|
|
34
34
|
"licenses-check": "license-checker --summary --excludePrivatePackages --production --onlyAllow \"$( jq -r .onlyAllow[] license-checker-config.json | tr '\n' ';')\" --excludePackages \"$( jq -r .excludePackages[] license-checker-config.json | tr '\n' ';')\""
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
+
"@ag-grid-community/locale": "^33.1.0",
|
|
37
38
|
"@hello-pangea/dnd": "^18.0.1",
|
|
39
|
+
"@material-symbols/svg-400": "^0.31.2",
|
|
38
40
|
"@react-querybuilder/dnd": "^8.2.0",
|
|
39
41
|
"@react-querybuilder/material": "^8.2.0",
|
|
40
42
|
"autosuggest-highlight": "^3.3.4",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ListItemIcon, Checkbox, ListItemText } from "@mui/material";
|
|
3
|
-
import { OverflowableText } from "../overflowableText/OverflowableText.js";
|
|
4
|
-
function ClickableCheckBoxItem({ sx, label, ...props }) {
|
|
5
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6
|
-
/* @__PURE__ */ jsx(ListItemIcon, { sx: { minWidth: 0, ...sx == null ? void 0 : sx.checkBoxIcon }, children: /* @__PURE__ */ jsx(Checkbox, { disableRipple: true, sx: { paddingLeft: 0, ...sx == null ? void 0 : sx.checkbox }, ...props }) }),
|
|
7
|
-
/* @__PURE__ */ jsx(ListItemText, { sx: { display: "flex" }, disableTypography: true, children: /* @__PURE__ */ jsx(OverflowableText, { sx: sx == null ? void 0 : sx.label, text: label }) })
|
|
8
|
-
] });
|
|
9
|
-
}
|
|
10
|
-
export {
|
|
11
|
-
ClickableCheckBoxItem
|
|
12
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ListItemButton, ListItemIcon, Checkbox, ListItemText } from "@mui/material";
|
|
3
|
-
import { OverflowableText } from "../overflowableText/OverflowableText.js";
|
|
4
|
-
const styles = {
|
|
5
|
-
unclickableItem: {
|
|
6
|
-
"&:hover": {
|
|
7
|
-
backgroundColor: "transparent"
|
|
8
|
-
},
|
|
9
|
-
cursor: "inherit"
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
function ClickableRowItem({
|
|
13
|
-
sx,
|
|
14
|
-
disabled,
|
|
15
|
-
label,
|
|
16
|
-
onClick,
|
|
17
|
-
onItemClick,
|
|
18
|
-
isItemClickable = true,
|
|
19
|
-
...props
|
|
20
|
-
}) {
|
|
21
|
-
const onCheckboxClick = (event) => {
|
|
22
|
-
event.stopPropagation();
|
|
23
|
-
onClick();
|
|
24
|
-
};
|
|
25
|
-
const handleItemClick = () => isItemClickable && onItemClick();
|
|
26
|
-
return /* @__PURE__ */ jsxs(
|
|
27
|
-
ListItemButton,
|
|
28
|
-
{
|
|
29
|
-
disableTouchRipple: !isItemClickable,
|
|
30
|
-
sx: { paddingLeft: 0, ...sx == null ? void 0 : sx.checkboxButton, ...!isItemClickable && styles.unclickableItem },
|
|
31
|
-
disabled,
|
|
32
|
-
onClick: handleItemClick,
|
|
33
|
-
children: [
|
|
34
|
-
/* @__PURE__ */ jsx(ListItemIcon, { sx: { minWidth: 0, ...sx == null ? void 0 : sx.checkBoxIcon }, children: /* @__PURE__ */ jsx(Checkbox, { disableRipple: true, sx: { paddingLeft: 0, ...sx == null ? void 0 : sx.checkbox }, onClick: onCheckboxClick, ...props }) }),
|
|
35
|
-
/* @__PURE__ */ jsx(
|
|
36
|
-
ListItemText,
|
|
37
|
-
{
|
|
38
|
-
sx: {
|
|
39
|
-
display: "flex"
|
|
40
|
-
},
|
|
41
|
-
disableTypography: true,
|
|
42
|
-
children: /* @__PURE__ */ jsx(OverflowableText, { sx: sx == null ? void 0 : sx.label, text: label })
|
|
43
|
-
}
|
|
44
|
-
)
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
export {
|
|
50
|
-
ClickableRowItem
|
|
51
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { DraggableClickableCheckBoxItemProps } from './checkBoxList.type';
|
|
2
|
-
export declare function DraggableClickableCheckBoxItem({ sx, disabled, provided, isHighlighted, label, ...props }: Readonly<DraggableClickableCheckBoxItemProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { DragIndicator } from "@mui/icons-material";
|
|
3
|
-
import { IconButton, ListItemIcon, Checkbox, ListItemText } from "@mui/material";
|
|
4
|
-
import { OverflowableText } from "../overflowableText/OverflowableText.js";
|
|
5
|
-
const styles = {
|
|
6
|
-
dragIcon: (theme) => ({
|
|
7
|
-
padding: "unset",
|
|
8
|
-
border: theme.spacing(0),
|
|
9
|
-
borderRadius: theme.spacing(0),
|
|
10
|
-
zIndex: 90
|
|
11
|
-
})
|
|
12
|
-
};
|
|
13
|
-
function DraggableClickableCheckBoxItem({
|
|
14
|
-
sx,
|
|
15
|
-
disabled,
|
|
16
|
-
provided,
|
|
17
|
-
isHighlighted,
|
|
18
|
-
label,
|
|
19
|
-
...props
|
|
20
|
-
}) {
|
|
21
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22
|
-
/* @__PURE__ */ jsx(
|
|
23
|
-
IconButton,
|
|
24
|
-
{
|
|
25
|
-
...provided.dragHandleProps,
|
|
26
|
-
size: "small",
|
|
27
|
-
sx: {
|
|
28
|
-
opacity: isHighlighted ? "1" : "0",
|
|
29
|
-
padding: "unset",
|
|
30
|
-
...styles.dragIcon
|
|
31
|
-
},
|
|
32
|
-
children: /* @__PURE__ */ jsx(DragIndicator, { spacing: 0 })
|
|
33
|
-
}
|
|
34
|
-
),
|
|
35
|
-
/* @__PURE__ */ jsx(ListItemIcon, { sx: { minWidth: 0, ...sx == null ? void 0 : sx.checkBoxIcon }, children: /* @__PURE__ */ jsx(Checkbox, { disableRipple: true, sx: { paddingLeft: 0, ...sx == null ? void 0 : sx.checkbox }, ...props }) }),
|
|
36
|
-
/* @__PURE__ */ jsx(
|
|
37
|
-
ListItemText,
|
|
38
|
-
{
|
|
39
|
-
sx: {
|
|
40
|
-
display: "flex"
|
|
41
|
-
},
|
|
42
|
-
disableTypography: true,
|
|
43
|
-
children: /* @__PURE__ */ jsx(OverflowableText, { sx: sx == null ? void 0 : sx.label, text: label })
|
|
44
|
-
}
|
|
45
|
-
)
|
|
46
|
-
] });
|
|
47
|
-
}
|
|
48
|
-
export {
|
|
49
|
-
DraggableClickableCheckBoxItem
|
|
50
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { DraggableClickableRowItemProps } from './checkBoxList.type';
|
|
2
|
-
export declare function DraggableClickableRowItem({ sx, disabled, onClick, provided, isHighlighted, label, onItemClick, isItemClickable, ...props }: Readonly<DraggableClickableRowItemProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { DragIndicator } from "@mui/icons-material";
|
|
3
|
-
import { ListItemButton, IconButton, ListItemIcon, Checkbox, ListItemText } from "@mui/material";
|
|
4
|
-
import { OverflowableText } from "../overflowableText/OverflowableText.js";
|
|
5
|
-
import "../../utils/conversionUtils.js";
|
|
6
|
-
import { mergeSx } from "../../utils/styles.js";
|
|
7
|
-
import "../../utils/types/equipmentType.js";
|
|
8
|
-
import "../../utils/yupConfig.js";
|
|
9
|
-
const styles = {
|
|
10
|
-
dragIcon: (theme) => ({
|
|
11
|
-
padding: "unset",
|
|
12
|
-
border: theme.spacing(0),
|
|
13
|
-
borderRadius: theme.spacing(0),
|
|
14
|
-
zIndex: 90
|
|
15
|
-
}),
|
|
16
|
-
unclickableItem: {
|
|
17
|
-
"&:hover": {
|
|
18
|
-
backgroundColor: "transparent"
|
|
19
|
-
},
|
|
20
|
-
cursor: "inherit"
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
function DraggableClickableRowItem({
|
|
24
|
-
sx,
|
|
25
|
-
disabled,
|
|
26
|
-
onClick,
|
|
27
|
-
provided,
|
|
28
|
-
isHighlighted,
|
|
29
|
-
label,
|
|
30
|
-
onItemClick,
|
|
31
|
-
isItemClickable = true,
|
|
32
|
-
...props
|
|
33
|
-
}) {
|
|
34
|
-
const onCheckboxClick = (event) => {
|
|
35
|
-
event.stopPropagation();
|
|
36
|
-
onClick();
|
|
37
|
-
};
|
|
38
|
-
const handleItemClick = () => isItemClickable && onItemClick();
|
|
39
|
-
return /* @__PURE__ */ jsxs(
|
|
40
|
-
ListItemButton,
|
|
41
|
-
{
|
|
42
|
-
disableTouchRipple: !isItemClickable,
|
|
43
|
-
sx: mergeSx({ paddingLeft: 0 }, sx == null ? void 0 : sx.checkboxButton, !isItemClickable ? styles.unclickableItem : void 0),
|
|
44
|
-
disabled,
|
|
45
|
-
onClick: handleItemClick,
|
|
46
|
-
children: [
|
|
47
|
-
/* @__PURE__ */ jsx(
|
|
48
|
-
IconButton,
|
|
49
|
-
{
|
|
50
|
-
...provided.dragHandleProps,
|
|
51
|
-
size: "small",
|
|
52
|
-
sx: {
|
|
53
|
-
opacity: isHighlighted ? "1" : "0",
|
|
54
|
-
padding: "unset",
|
|
55
|
-
...styles.dragIcon
|
|
56
|
-
},
|
|
57
|
-
children: /* @__PURE__ */ jsx(DragIndicator, { spacing: 0 })
|
|
58
|
-
}
|
|
59
|
-
),
|
|
60
|
-
/* @__PURE__ */ jsx(ListItemIcon, { sx: { minWidth: 0, ...sx == null ? void 0 : sx.checkBoxIcon }, children: /* @__PURE__ */ jsx(Checkbox, { disableRipple: true, sx: { paddingLeft: 0, ...sx == null ? void 0 : sx.checkbox }, onClick: onCheckboxClick, ...props }) }),
|
|
61
|
-
/* @__PURE__ */ jsx(
|
|
62
|
-
ListItemText,
|
|
63
|
-
{
|
|
64
|
-
sx: {
|
|
65
|
-
display: "flex"
|
|
66
|
-
},
|
|
67
|
-
disableTypography: true,
|
|
68
|
-
children: /* @__PURE__ */ jsx(OverflowableText, { sx: sx == null ? void 0 : sx.label, text: label })
|
|
69
|
-
}
|
|
70
|
-
)
|
|
71
|
-
]
|
|
72
|
-
}
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
export {
|
|
76
|
-
DraggableClickableRowItem
|
|
77
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2024, 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 declare const DARK_THEME = "Dark";
|
|
8
|
-
export declare const LIGHT_THEME = "Light";
|
|
9
|
-
export declare const LANG_SYSTEM = "sys";
|
|
10
|
-
export declare const LANG_ENGLISH = "en";
|
|
11
|
-
export declare const LANG_FRENCH = "fr";
|