@gridsuite/commons-ui 0.49.0 → 0.50.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.
Files changed (62) hide show
  1. package/dist/components/AuthenticationRouter/AuthenticationRouter.js +5 -11
  2. package/dist/components/AuthenticationRouter/index.js +4 -0
  3. package/dist/components/CardErrorBoundary/card-error-boundary.d.ts +2 -2
  4. package/dist/components/CardErrorBoundary/card-error-boundary.js +2 -2
  5. package/dist/components/CardErrorBoundary/index.js +4 -0
  6. package/dist/components/ElementSearchDialog/element-search-dialog.js +3 -3
  7. package/dist/components/ElementSearchDialog/equipment-item.js +0 -1
  8. package/dist/components/ElementSearchDialog/index.js +6 -0
  9. package/dist/components/ElementSearchDialog/tag-renderer.js +0 -1
  10. package/dist/components/FlatParameters/FlatParameters.js +5 -5
  11. package/dist/components/FlatParameters/index.js +4 -0
  12. package/dist/components/Login/Login.js +0 -1
  13. package/dist/components/Login/Logout.js +0 -1
  14. package/dist/components/Login/index.js +4 -0
  15. package/dist/components/MuiVirtualizedTable/ColumnHeader.d.ts +2 -3
  16. package/dist/components/MuiVirtualizedTable/ColumnHeader.js +5 -5
  17. package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +5 -0
  18. package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.d.ts +4 -4
  19. package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.js +3 -3
  20. package/dist/components/MuiVirtualizedTable/index.js +8 -0
  21. package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.js +3 -3
  22. package/dist/components/MultipleSelectionDialog/index.js +4 -0
  23. package/dist/components/OverflowableText/index.js +4 -0
  24. package/dist/components/ReportViewer/index.js +4 -0
  25. package/dist/components/ReportViewer/log-table.d.ts +1 -2
  26. package/dist/components/ReportViewer/multi-select-list.js +0 -1
  27. package/dist/components/ReportViewerDialog/index.js +4 -0
  28. package/dist/components/SignInCallbackHandler/index.js +4 -0
  29. package/dist/components/SilentRenewCallbackHandler/index.js +4 -0
  30. package/dist/components/SnackbarProvider/SnackbarProvider.d.ts +1 -2
  31. package/dist/components/SnackbarProvider/SnackbarProvider.js +2 -2
  32. package/dist/components/SnackbarProvider/index.js +4 -0
  33. package/dist/components/TopBar/GridLogo.js +0 -1
  34. package/dist/components/TopBar/TopBar.js +3 -3
  35. package/dist/components/TopBar/index.js +8 -0
  36. package/dist/components/TreeViewFinder/index.js +5 -0
  37. package/dist/components/react-hook-form/ExpandingTextField.d.ts +20 -0
  38. package/dist/components/react-hook-form/ExpandingTextField.js +106 -0
  39. package/dist/components/react-hook-form/autocomplete-input.js +0 -1
  40. package/dist/components/react-hook-form/booleans/checkbox-input.js +0 -1
  41. package/dist/components/react-hook-form/booleans/switch-input.js +0 -1
  42. package/dist/components/react-hook-form/error-management/field-error-alert.js +0 -1
  43. package/dist/components/react-hook-form/error-management/mid-form-error.js +0 -1
  44. package/dist/components/react-hook-form/numbers/float-input.js +0 -1
  45. package/dist/components/react-hook-form/numbers/integer-input.js +0 -1
  46. package/dist/components/react-hook-form/radio-input.js +0 -1
  47. package/dist/components/react-hook-form/select-input.js +0 -1
  48. package/dist/components/react-hook-form/slider-input.js +0 -1
  49. package/dist/components/react-hook-form/text-input.js +0 -1
  50. package/dist/components/react-hook-form/utils/cancel-button.js +0 -1
  51. package/dist/components/react-hook-form/utils/field-label.js +0 -1
  52. package/dist/components/react-hook-form/utils/functions.js +0 -1
  53. package/dist/components/react-hook-form/utils/submit-button.js +0 -1
  54. package/dist/components/translations/inputs-en.d.ts +25 -0
  55. package/dist/components/translations/inputs-en.js +21 -0
  56. package/dist/components/translations/inputs-fr.d.ts +25 -0
  57. package/dist/components/translations/inputs-fr.js +21 -0
  58. package/dist/index.d.ts +106 -12
  59. package/dist/index.js +36 -32
  60. package/dist/utils/AuthService.js +1 -1
  61. package/dist/utils/ElementType.js +0 -1
  62. package/package.json +7 -16
@@ -1,5 +1,5 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import React, { useCallback } from "react";
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import { useCallback } from "react";
3
3
  import { Routes, Route, Navigate } from "react-router-dom";
4
4
  import SignInCallbackHandler from "../SignInCallbackHandler/SignInCallbackHandler.js";
5
5
  import { handleSigninCallback, handleSilentRenewCallback, login, logout } from "../../utils/AuthService.js";
@@ -25,7 +25,7 @@ const AuthenticationRouter = ({
25
25
  () => handleSilentRenewCallback(userManager.instance),
26
26
  [userManager.instance]
27
27
  );
28
- return /* @__PURE__ */ jsx(React.Fragment, { children: /* @__PURE__ */ jsxs(
28
+ return /* @__PURE__ */ jsxs(
29
29
  Grid,
30
30
  {
31
31
  container: true,
@@ -68,13 +68,7 @@ const AuthenticationRouter = ({
68
68
  )
69
69
  }
70
70
  ),
71
- /* @__PURE__ */ jsx(
72
- Route,
73
- {
74
- path: "logout-callback",
75
- element: /* @__PURE__ */ jsx(Navigate, { to: "/" })
76
- }
77
- ),
71
+ /* @__PURE__ */ jsx(Route, { path: "logout-callback", element: /* @__PURE__ */ jsx(Navigate, { to: "/" }) }),
78
72
  /* @__PURE__ */ jsx(
79
73
  Route,
80
74
  {
@@ -140,7 +134,7 @@ const AuthenticationRouter = ({
140
134
  ] })
141
135
  ]
142
136
  }
143
- ) });
137
+ );
144
138
  };
145
139
  export {
146
140
  AuthenticationRouter as default
@@ -0,0 +1,4 @@
1
+ import { default as default2 } from "./AuthenticationRouter.js";
2
+ export {
3
+ default2 as default
4
+ };
@@ -1,5 +1,5 @@
1
1
  export default CardErrorBoundary;
2
- declare class CardErrorBoundary extends React.Component<any, any, any> {
2
+ declare class CardErrorBoundary extends Component<any, any, any> {
3
3
  static getDerivedStateFromError(error: any): {
4
4
  hasError: boolean;
5
5
  error: any;
@@ -15,4 +15,4 @@ declare class CardErrorBoundary extends React.Component<any, any, any> {
15
15
  componentDidCatch(error: any, errorInfo: any): void;
16
16
  render(): any;
17
17
  }
18
- import React from 'react';
18
+ import { Component } from 'react';
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import React from "react";
2
+ import { Component } from "react";
3
3
  import { styled, IconButton, Box, Card, CardHeader, CardContent, Typography, CardActions, Collapse } from "@mui/material";
4
4
  import { Replay, ExpandMore as ExpandMore$1 } from "@mui/icons-material";
5
5
  import { FormattedMessage } from "react-intl";
@@ -13,7 +13,7 @@ const ExpandMore = styled((props) => {
13
13
  duration: theme.transitions.duration.shortest
14
14
  })
15
15
  }));
16
- class CardErrorBoundary extends React.Component {
16
+ class CardErrorBoundary extends Component {
17
17
  constructor(props) {
18
18
  super(props);
19
19
  this.state = {
@@ -0,0 +1,4 @@
1
+ import { default as default2 } from "./card-error-boundary.js";
2
+ export {
3
+ default2 as default
4
+ };
@@ -1,5 +1,5 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import React, { useState, useEffect, useCallback } from "react";
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { useState, useEffect, useCallback } from "react";
3
3
  import { Dialog, DialogContent, Autocomplete, TextField } from "@mui/material";
4
4
  import PropTypes from "prop-types";
5
5
  import { SearchOff, Search } from "@mui/icons-material";
@@ -109,7 +109,7 @@ const ElementSearchDialog = (props) => {
109
109
  }),
110
110
  InputProps: {
111
111
  ...params.InputProps,
112
- startAdornment: /* @__PURE__ */ jsxs(React.Fragment, { children: [
112
+ startAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
113
113
  searchTermDisabled ? /* @__PURE__ */ jsx(SearchOff, { color: "disabled" }) : /* @__PURE__ */ jsx(Search, { color: "disabled" }),
114
114
  params.InputProps.startAdornment
115
115
  ] })
@@ -6,7 +6,6 @@ import parse from "autosuggest-highlight/parse";
6
6
  import clsx from "clsx";
7
7
  import { FormattedMessage } from "react-intl";
8
8
  import { OverflowableText } from "../OverflowableText/overflowable-text.js";
9
- import "react";
10
9
  import { EQUIPMENT_TYPE } from "../../utils/EquipmentType.js";
11
10
  import { Box } from "@mui/material";
12
11
  import { mergeSx } from "../../utils/styles.js";
@@ -0,0 +1,6 @@
1
+ import { default as default2 } from "./element-search-dialog.js";
2
+ import { TagRenderer } from "./tag-renderer.js";
3
+ export {
4
+ TagRenderer,
5
+ default2 as default
6
+ };
@@ -1,7 +1,6 @@
1
1
  import { jsx, Fragment } from "react/jsx-runtime";
2
2
  import { OverflowableText } from "../OverflowableText/overflowable-text.js";
3
3
  import clsx from "clsx";
4
- import "react";
5
4
  import { EQUIPMENT_TYPE } from "../../utils/EquipmentType.js";
6
5
  import PropTypes from "prop-types";
7
6
  import { mergeSx } from "../../utils/styles.js";
@@ -1,5 +1,5 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import React, { useState, useCallback } from "react";
1
+ import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
2
+ import { useState, useCallback, Fragment } from "react";
3
3
  import { List, ListItem, Tooltip, Typography, Divider, TextField, Select, MenuItem, IconButton, Autocomplete, Chip, Switch } from "@mui/material";
4
4
  import { Tune } from "@mui/icons-material";
5
5
  import { useIntl, FormattedMessage } from "react-intl";
@@ -245,7 +245,7 @@ const FlatParameters = ({
245
245
  ).map(({ id }) => id);
246
246
  const withDialog = selectionWithDialog(param);
247
247
  if (withDialog) {
248
- return /* @__PURE__ */ jsxs(Fragment, { children: [
248
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
249
249
  /* @__PURE__ */ jsx(
250
250
  TextField,
251
251
  {
@@ -341,7 +341,7 @@ const FlatParameters = ({
341
341
  }
342
342
  case "STRING":
343
343
  if (param.possibleValues) {
344
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
344
+ return /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(
345
345
  Select,
346
346
  {
347
347
  labelId: param.name,
@@ -374,7 +374,7 @@ const FlatParameters = ({
374
374
  );
375
375
  }
376
376
  };
377
- return /* @__PURE__ */ jsx(List, { sx: styles.paramList, children: paramsAsArray.map((param, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
377
+ return /* @__PURE__ */ jsx(List, { sx: styles.paramList, children: paramsAsArray.map((param, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
378
378
  /* @__PURE__ */ jsxs(ListItem, { sx: styles.paramListItem, children: [
379
379
  /* @__PURE__ */ jsx(
380
380
  Tooltip,
@@ -0,0 +1,4 @@
1
+ import { FlatParameters } from "./FlatParameters.js";
2
+ export {
3
+ FlatParameters as default
4
+ };
@@ -1,5 +1,4 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import { Container, Box, Avatar, Typography, Button, Link } from "@mui/material";
4
3
  import { LockOutlined } from "@mui/icons-material";
5
4
  import { FormattedMessage } from "react-intl";
@@ -1,5 +1,4 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import { Container, Box, Avatar, Typography, Button, Link } from "@mui/material";
4
3
  import { LogoutOutlined } from "@mui/icons-material";
5
4
  import { FormattedMessage } from "react-intl";
@@ -0,0 +1,4 @@
1
+ import { default as default2 } from "./Login.js";
2
+ export {
3
+ default2 as default
4
+ };
@@ -1,4 +1,3 @@
1
- export const ColumnHeader: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
2
- declare const _default: import("@emotion/styled").StyledComponent<React.RefAttributes<any> & import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>, {}, {}>;
1
+ export const ColumnHeader: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
2
+ declare const _default: import("@emotion/styled").StyledComponent<import("react").RefAttributes<any> & import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>, {}, {}>;
3
3
  export default _default;
4
- import React from 'react';
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import React, { useRef } from "react";
2
+ import { forwardRef, useState, useCallback, useRef, useMemo } from "react";
3
3
  import { ArrowUpward, ArrowDownward, FilterAltOutlined } from "@mui/icons-material";
4
4
  import { styled } from "@mui/system";
5
5
  import { Box } from "@mui/material";
@@ -63,7 +63,7 @@ const FilterButton = (props) => {
63
63
  }
64
64
  );
65
65
  };
66
- const ColumnHeader = React.forwardRef((props, ref) => {
66
+ const ColumnHeader = forwardRef((props, ref) => {
67
67
  const {
68
68
  className,
69
69
  label,
@@ -75,12 +75,12 @@ const ColumnHeader = React.forwardRef((props, ref) => {
75
75
  onContextMenu,
76
76
  style
77
77
  } = props;
78
- const [hovered, setHovered] = React.useState();
79
- const onHover = React.useCallback((evt) => {
78
+ const [hovered, setHovered] = useState();
79
+ const onHover = useCallback((evt) => {
80
80
  setHovered(evt.type === "mouseenter");
81
81
  }, []);
82
82
  const topmostDiv = useRef();
83
- const handleFilterClick = React.useMemo(() => {
83
+ const handleFilterClick = useMemo(() => {
84
84
  if (!onFilterClick) {
85
85
  return void 0;
86
86
  }
@@ -539,10 +539,15 @@ const groupAndSort = (preFilteredRowPairs, codedColumns, groupingColumnsCount, c
539
539
  }
540
540
  return indexedArray;
541
541
  };
542
+ const forTesting = {
543
+ codedColumnsFromKeyAndDirection,
544
+ makeCompositeComparatorFromCodedColumns
545
+ };
542
546
  export {
543
547
  CHANGE_WAYS,
544
548
  KeyedColumnsRowIndexer,
545
549
  collectibleHelper,
550
+ forTesting,
546
551
  getHelper,
547
552
  noOpHelper
548
553
  };
@@ -34,11 +34,11 @@ declare const _default: import("@emotion/styled").StyledComponent<Pick<PropTypes
34
34
  enableExportCSV?: boolean | null | undefined;
35
35
  rowHeight?: number | null | undefined;
36
36
  } & {} & import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>, {}, {
37
- ref?: React.Ref<MuiVirtualizedTable> | undefined;
37
+ ref?: import("react").Ref<MuiVirtualizedTable> | undefined;
38
38
  }>;
39
39
  export default _default;
40
40
  import PropTypes from 'prop-types';
41
- declare class MuiVirtualizedTable extends React.PureComponent<any, any, any> {
41
+ declare class MuiVirtualizedTable extends PureComponent<any, any, any> {
42
42
  static defaultProps: {
43
43
  headerHeight: number;
44
44
  rowHeight: number;
@@ -49,7 +49,7 @@ declare class MuiVirtualizedTable extends React.PureComponent<any, any, any> {
49
49
  _computeHeaderSize(): void;
50
50
  _registerHeader(label: any, header: any): void;
51
51
  _registerObserver(element: any): void;
52
- headers: React.RefObject<any>;
52
+ headers: import("react").RefObject<any>;
53
53
  observer: IntersectionObserver;
54
54
  state: {
55
55
  headerHeight: any;
@@ -128,4 +128,4 @@ declare namespace MuiVirtualizedTable {
128
128
  const tooltipSx: PropTypes.Requireable<object>;
129
129
  }
130
130
  }
131
- import React from 'react';
131
+ import { PureComponent } from 'react';
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
- import React, { createRef } from "react";
8
+ import { PureComponent, createRef } from "react";
9
9
  import { FormattedMessage } from "react-intl";
10
10
  import PropTypes from "prop-types";
11
11
  import clsx from "clsx";
@@ -17,7 +17,7 @@ import { Table, Column, AutoSizer } from "react-virtualized";
17
17
  import CsvDownloader from "react-csv-downloader";
18
18
  import { OverflowableText } from "../OverflowableText/overflowable-text.js";
19
19
  import { toNestedGlobalSelectors, makeComposeClasses } from "../../utils/styles.js";
20
- import { getHelper, collectibleHelper, KeyedColumnsRowIndexer, CHANGE_WAYS } from "./KeyedColumnsRowIndexer.js";
20
+ import { getHelper, collectibleHelper, CHANGE_WAYS, KeyedColumnsRowIndexer } from "./KeyedColumnsRowIndexer.js";
21
21
  import ColumnHeader from "./ColumnHeader.js";
22
22
  function getTextWidth(text) {
23
23
  let canvas = getTextWidth.canvas || (getTextWidth.canvas = document.createElement("canvas"));
@@ -182,7 +182,7 @@ const reorderIndex = memoize(
182
182
  return makeIndexRecord(null, rows);
183
183
  }
184
184
  );
185
- class MuiVirtualizedTable extends React.PureComponent {
185
+ class MuiVirtualizedTable extends PureComponent {
186
186
  constructor(props, context) {
187
187
  super(props, context);
188
188
  __publicField(this, "setVersion", (v) => {
@@ -0,0 +1,8 @@
1
+ import { default as default2, generateMuiVirtualizedTableClass } from "./MuiVirtualizedTable.js";
2
+ import { CHANGE_WAYS, KeyedColumnsRowIndexer } from "./KeyedColumnsRowIndexer.js";
3
+ export {
4
+ CHANGE_WAYS,
5
+ KeyedColumnsRowIndexer,
6
+ default2 as default,
7
+ generateMuiVirtualizedTableClass
8
+ };
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { Dialog, DialogTitle, DialogContent, Grid, FormControlLabel, Checkbox, List, DialogActions, Button } from "@mui/material";
3
3
  import { FormattedMessage } from "react-intl";
4
- import React, { useState } from "react";
4
+ import { useState } from "react";
5
5
  const MultipleSelectionDialog = ({
6
6
  options,
7
7
  selectedOptions,
@@ -52,7 +52,7 @@ const MultipleSelectionDialog = ({
52
52
  /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(List, { children: options.map((option) => {
53
53
  const optionId = (option == null ? void 0 : option.id) ?? option;
54
54
  const label = getOptionLabel(option);
55
- return /* @__PURE__ */ jsx(React.Fragment, { children: /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
55
+ return /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
56
56
  FormControlLabel,
57
57
  {
58
58
  label,
@@ -68,7 +68,7 @@ const MultipleSelectionDialog = ({
68
68
  }
69
69
  )
70
70
  }
71
- ) }) }, optionId);
71
+ ) }, optionId);
72
72
  }) }) })
73
73
  ] }) }),
74
74
  /* @__PURE__ */ jsxs(DialogActions, { children: [
@@ -0,0 +1,4 @@
1
+ import { default as default2 } from "./MultipleSelectionDialog.js";
2
+ export {
3
+ default2 as default
4
+ };
@@ -0,0 +1,4 @@
1
+ import { OverflowableText } from "./overflowable-text.js";
2
+ export {
3
+ OverflowableText as default
4
+ };
@@ -0,0 +1,4 @@
1
+ import { default as default2 } from "./report-viewer.js";
2
+ export {
3
+ default2 as default
4
+ };
@@ -1,8 +1,7 @@
1
- declare const _default: React.MemoExoticComponent<({ logs, onRowClick, selectedSeverity, setSelectedSeverity, }: {
1
+ declare const _default: import("react").MemoExoticComponent<({ logs, onRowClick, selectedSeverity, setSelectedSeverity, }: {
2
2
  logs: any;
3
3
  onRowClick: any;
4
4
  selectedSeverity: any;
5
5
  setSelectedSeverity: any;
6
6
  }) => import("react/jsx-runtime").JSX.Element>;
7
7
  export default _default;
8
- import React from 'react';
@@ -1,5 +1,4 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import { Menu, MenuItem, FormControlLabel, Checkbox } from "@mui/material";
4
3
  const styles = {
5
4
  label: {
@@ -0,0 +1,4 @@
1
+ import { default as default2 } from "./report-viewer-dialog.js";
2
+ export {
3
+ default2 as default
4
+ };
@@ -0,0 +1,4 @@
1
+ import { default as default2 } from "./SignInCallbackHandler.js";
2
+ export {
3
+ default2 as default
4
+ };
@@ -0,0 +1,4 @@
1
+ import { default as default2 } from "./SilentRenewCallbackHandler.js";
2
+ export {
3
+ default2 as default
4
+ };
@@ -1,3 +1,2 @@
1
1
  export default SnackbarProvider;
2
- declare const SnackbarProvider: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
3
- import React from 'react';
2
+ declare const SnackbarProvider: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
@@ -1,8 +1,8 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import React, { useRef } from "react";
2
+ import { forwardRef, useRef } from "react";
3
3
  import { Button } from "@mui/material";
4
4
  import { SnackbarProvider as SnackbarProvider$1 } from "notistack";
5
- const SnackbarProvider = React.forwardRef((props, ref) => {
5
+ const SnackbarProvider = forwardRef((props, ref) => {
6
6
  const innerRef = useRef();
7
7
  const notistackRef = ref || innerRef;
8
8
  return /* @__PURE__ */ jsx(
@@ -0,0 +1,4 @@
1
+ import { default as default2 } from "./SnackbarProvider.js";
2
+ export {
3
+ default2 as default
4
+ };
@@ -1,5 +1,4 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import { Box, Typography } from "@mui/material";
4
3
  import { BrokenImage } from "@mui/icons-material";
5
4
  import { mergeSx } from "../../utils/styles.js";
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import React, { useRef, useState, useMemo } from "react";
2
+ import { useState, useRef, useMemo } from "react";
3
3
  import { FormattedMessage } from "react-intl";
4
4
  import { Menu, MenuItem, ListItemIcon, AppBar, Toolbar, Box, IconButton, ListItemText, Button, Popper, Paper, ClickAwayListener, MenuList, Typography, ToggleButtonGroup, ToggleButton, darken } from "@mui/material";
5
5
  import { Apps, ArrowDropUp, ArrowDropDown, Person, WbSunny, Brightness3, Computer, Settings, HelpOutline, FullscreenExit, Fullscreen, ExitToApp } from "@mui/icons-material";
@@ -130,8 +130,8 @@ const TopBar = ({
130
130
  onLanguageClick,
131
131
  language
132
132
  }) => {
133
- const [anchorElSettingsMenu, setAnchorElSettingsMenu] = React.useState(null);
134
- const [anchorElAppsMenu, setAnchorElAppsMenu] = React.useState(null);
133
+ const [anchorElSettingsMenu, setAnchorElSettingsMenu] = useState(null);
134
+ const [anchorElAppsMenu, setAnchorElAppsMenu] = useState(null);
135
135
  const fullScreenRef = useRef(null);
136
136
  const [isFullScreen, setIsFullScreen] = useState(false);
137
137
  const handleToggleSettingsMenu = (event) => {
@@ -0,0 +1,8 @@
1
+ import { default as default2 } from "./TopBar.js";
2
+ import { LogoText } from "./GridLogo.js";
3
+ import { default as default3 } from "./AboutDialog.js";
4
+ export {
5
+ default3 as AboutDialog,
6
+ LogoText,
7
+ default2 as default
8
+ };
@@ -0,0 +1,5 @@
1
+ import { default as default2, generateTreeViewFinderClass } from "./TreeViewFinder.js";
2
+ export {
3
+ default2 as default,
4
+ generateTreeViewFinderClass
5
+ };
@@ -0,0 +1,20 @@
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
+ import { TextFieldProps } from '@mui/material';
8
+ import { FunctionComponent } from 'react';
9
+ import { TextInputProps } from '../..';
10
+ interface ExpandingTextFieldProps extends TextInputProps {
11
+ name: string;
12
+ maxCharactersNumber?: number;
13
+ rows?: number;
14
+ minRows?: number;
15
+ sx?: any;
16
+ label?: string;
17
+ textFieldFormProps?: TextFieldProps;
18
+ }
19
+ declare const ExpandingTextField: FunctionComponent<ExpandingTextFieldProps>;
20
+ export default ExpandingTextField;
@@ -0,0 +1,106 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { Typography } from "@mui/material";
4
+ import { useFormContext, useWatch } from "react-hook-form";
5
+ import "../TreeViewFinder/TreeViewFinder.js";
6
+ import "../TopBar/TopBar.js";
7
+ import "../TopBar/GridLogo.js";
8
+ import "../TopBar/AboutDialog.js";
9
+ import "../SnackbarProvider/SnackbarProvider.js";
10
+ import "react-router-dom";
11
+ import "../../utils/AuthService.js";
12
+ import "@mui/icons-material";
13
+ import "react-intl";
14
+ import "../MuiVirtualizedTable/MuiVirtualizedTable.js";
15
+ import "@mui/lab";
16
+ import "../ReportViewer/report-item.js";
17
+ import "uuid";
18
+ import "../ReportViewer/log-table.js";
19
+ import "../ReportViewer/report-tree-view-context.js";
20
+ import "../OverflowableText/overflowable-text.js";
21
+ import "../ElementSearchDialog/element-search-dialog.js";
22
+ import "../ElementSearchDialog/tag-renderer.js";
23
+ import "autosuggest-highlight/match";
24
+ import "autosuggest-highlight/parse";
25
+ import "clsx";
26
+ import "../CardErrorBoundary/card-error-boundary.js";
27
+ import "notistack";
28
+ import "./autocomplete-input.js";
29
+ import TextInput from "./text-input.js";
30
+ import "./radio-input.js";
31
+ import "./slider-input.js";
32
+ import "./numbers/float-input.js";
33
+ import "./numbers/integer-input.js";
34
+ import "./select-input.js";
35
+ import "./booleans/checkbox-input.js";
36
+ import "./booleans/switch-input.js";
37
+ import "./utils/text-field-with-adornment.js";
38
+ import "./utils/submit-button.js";
39
+ import "./utils/cancel-button.js";
40
+ import "yup";
41
+ import "@mui/icons-material/Folder";
42
+ const ExpandingTextField = ({
43
+ name,
44
+ maxCharactersNumber = 500,
45
+ rows,
46
+ minRows = 1,
47
+ sx,
48
+ label,
49
+ textFieldFormProps,
50
+ ...otherTexFieldProps
51
+ }) => {
52
+ const [isFocused, setIsFocused] = useState(false);
53
+ const { control } = useFormContext();
54
+ const descriptionWatch = useWatch({
55
+ name,
56
+ control
57
+ });
58
+ const handleFocus = () => {
59
+ setIsFocused(true);
60
+ };
61
+ const handleBlur = () => {
62
+ setIsFocused(false);
63
+ };
64
+ const isOverTheLimit = (descriptionWatch == null ? void 0 : descriptionWatch.length) > maxCharactersNumber;
65
+ const descriptionLength = (descriptionWatch == null ? void 0 : descriptionWatch.length) ?? 0;
66
+ const descriptionCounter = descriptionLength + "/" + maxCharactersNumber;
67
+ const rowsToDisplay = isFocused ? rows : minRows;
68
+ const formProps = {
69
+ size: "medium",
70
+ multiline: true,
71
+ onFocus: handleFocus,
72
+ onBlur: handleBlur,
73
+ InputProps: {
74
+ style: {
75
+ textOverflow: "ellipsis",
76
+ overflow: "hidden",
77
+ // disable scrolling
78
+ whiteSpace: "pre",
79
+ resize: "none"
80
+ // or 'horizontal' for horizontal resizing
81
+ }
82
+ },
83
+ helperText: /* @__PURE__ */ jsx(Typography, { variant: "caption", children: descriptionCounter }),
84
+ FormHelperTextProps: {
85
+ sx: {
86
+ ml: "auto",
87
+ color: (theme) => isOverTheLimit ? theme.palette.error.main : theme.palette.text.secondary
88
+ }
89
+ },
90
+ ...rowsToDisplay && { rows: rowsToDisplay },
91
+ ...sx && { sx },
92
+ ...textFieldFormProps
93
+ };
94
+ return /* @__PURE__ */ jsx(
95
+ TextInput,
96
+ {
97
+ name,
98
+ label,
99
+ formProps,
100
+ ...otherTexFieldProps
101
+ }
102
+ );
103
+ };
104
+ export {
105
+ ExpandingTextField as default
106
+ };
@@ -1,5 +1,4 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import PropTypes from "prop-types";
4
3
  import { Autocomplete, TextField } from "@mui/material";
5
4
  import { useFormContext, useController } from "react-hook-form";
@@ -1,5 +1,4 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import PropTypes from "prop-types";
4
3
  import BooleanInput from "./boolean-input.js";
5
4
  import { Checkbox } from "@mui/material";
@@ -1,5 +1,4 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import PropTypes from "prop-types";
4
3
  import BooleanInput from "./boolean-input.js";
5
4
  import { Switch } from "@mui/material";
@@ -1,5 +1,4 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import { Grid, Alert } from "@mui/material";
4
3
  const FieldErrorAlert = ({ message }) => {
5
4
  return /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(Alert, { severity: "error", children: message }) });
@@ -1,5 +1,4 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import { Box } from "@mui/material";
4
3
  const MidFormError = ({ message }) => {
5
4
  return /* @__PURE__ */ jsx(
@@ -1,5 +1,4 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import TextInput from "../text-input.js";
4
3
  import { isFloatNumber } from "./utils.js";
5
4
  const normalizeFixed = (number) => {
@@ -1,5 +1,4 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import TextInput from "../text-input.js";
4
3
  import { isIntegerNumber } from "./utils.js";
5
4
  const IntegerInput = (props) => {
@@ -1,5 +1,4 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import PropTypes from "prop-types";
4
3
  import { FormControl, FormLabel, RadioGroup, FormControlLabel, Radio } from "@mui/material";
5
4
  import { FormattedMessage } from "react-intl";
@@ -1,5 +1,4 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import PropTypes from "prop-types";
4
3
  import AutocompleteInput from "./autocomplete-input.js";
5
4
  import { useIntl } from "react-intl";
@@ -1,5 +1,4 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import PropTypes from "prop-types";
4
3
  import { Slider } from "@mui/material";
5
4
  import { useController } from "react-hook-form";
@@ -1,5 +1,4 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import "react";
3
2
  import PropTypes from "prop-types";
4
3
  import { InputAdornment, IconButton, TextField } from "@mui/material";
5
4
  import { Clear } from "@mui/icons-material";
@@ -1,5 +1,4 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import { Button } from "@mui/material";
4
3
  import { FormattedMessage } from "react-intl";
5
4
  import PropTypes from "prop-types";
@@ -1,5 +1,4 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import { FormattedMessage } from "react-intl";
4
3
  const FieldLabel = ({ label, optional, values = void 0 }) => {
5
4
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1,5 +1,4 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import { FormattedMessage } from "react-intl";
4
3
  import { getIn } from "yup";
5
4
  function genHelperPreviousValue(previousValue, adornment) {
@@ -1,5 +1,4 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import { Button } from "@mui/material";
4
3
  import { useFormState } from "react-hook-form";
5
4
  import { FormattedMessage } from "react-intl";
@@ -0,0 +1,25 @@
1
+ export default inputs_en;
2
+ /**
3
+ * Copyright (c) 2022, RTE (http://www.rte-france.com)
4
+ * This Source Code Form is subject to the terms of the Mozilla Public
5
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
+ */
8
+ declare const inputs_en: {
9
+ 'inputs/kiki': string;
10
+ 'inputs/ney': string;
11
+ 'inputs/lapulga': string;
12
+ 'inputs/ibra': string;
13
+ 'inputs/float': string;
14
+ 'inputs/integer': string;
15
+ 'inputs/radio': string;
16
+ 'inputs/select': string;
17
+ 'inputs/slider': string;
18
+ 'inputs/text': string;
19
+ 'inputs/description': string;
20
+ 'inputs/autocomplete': string;
21
+ 'inputs/boolean': string;
22
+ 'inputs/checkbox': string;
23
+ 'inputs/switch': string;
24
+ Optional: string;
25
+ };
@@ -0,0 +1,21 @@
1
+ const inputs_en = {
2
+ "inputs/kiki": "Kylian Mbappe",
3
+ "inputs/ney": "Neymar",
4
+ "inputs/lapulga": "Lionel Messi",
5
+ "inputs/ibra": "Zlatan Ibrahimovic",
6
+ "inputs/float": "Float",
7
+ "inputs/integer": "Integer",
8
+ "inputs/radio": "Radio",
9
+ "inputs/select": "Select",
10
+ "inputs/slider": "Slider",
11
+ "inputs/text": "Text",
12
+ "inputs/description": "Description",
13
+ "inputs/autocomplete": "Autocomplete",
14
+ "inputs/boolean": "Boolean",
15
+ "inputs/checkbox": "Checkbox",
16
+ "inputs/switch": "Switch",
17
+ Optional: "Optional"
18
+ };
19
+ export {
20
+ inputs_en as default
21
+ };
@@ -0,0 +1,25 @@
1
+ export default inputs_fr;
2
+ /**
3
+ * Copyright (c) 2022, RTE (http://www.rte-france.com)
4
+ * This Source Code Form is subject to the terms of the Mozilla Public
5
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
+ */
8
+ declare const inputs_fr: {
9
+ 'inputs/kiki': string;
10
+ 'inputs/ney': string;
11
+ 'inputs/lapulga': string;
12
+ 'inputs/ibra': string;
13
+ 'inputs/float': string;
14
+ 'inputs/integer': string;
15
+ 'inputs/radio': string;
16
+ 'inputs/select': string;
17
+ 'inputs/slider': string;
18
+ 'inputs/text': string;
19
+ 'inputs/description': string;
20
+ 'inputs/autocomplete': string;
21
+ 'inputs/boolean': string;
22
+ 'inputs/checkbox': string;
23
+ 'inputs/switch': string;
24
+ Optional: string;
25
+ };
@@ -0,0 +1,21 @@
1
+ const inputs_fr = {
2
+ "inputs/kiki": "Kylian Mbappe",
3
+ "inputs/ney": "Neymar",
4
+ "inputs/lapulga": "Lionel Messi",
5
+ "inputs/ibra": "Zlatan Ibrahimovic",
6
+ "inputs/float": "Float",
7
+ "inputs/integer": "Integer",
8
+ "inputs/radio": "Radio",
9
+ "inputs/select": "Select",
10
+ "inputs/slider": "Slider",
11
+ "inputs/text": "Text",
12
+ "inputs/description": "Description",
13
+ "inputs/autocomplete": "Autocomplete",
14
+ "inputs/boolean": "Boolean",
15
+ "inputs/checkbox": "Checkbox",
16
+ "inputs/switch": "Switch",
17
+ Optional: "Optional"
18
+ };
19
+ export {
20
+ inputs_fr as default
21
+ };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,10 @@
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
+
1
8
  import type { FunctionComponent, ReactElement } from 'react';
2
9
  import type { AutocompleteProps } from '@mui/material/Autocomplete/Autocomplete';
3
10
  import type {
@@ -10,24 +17,113 @@ import type {
10
17
  } from '@mui/material';
11
18
 
12
19
  /**
13
- * Section to export generated type declarations of .ts or .tsx files
20
+ * Section to export generated type declarations
14
21
  */
15
22
 
16
- export { useIntlRef } from './hooks/useIntlRef';
17
- export { RawReadOnlyInput } from './components/react-hook-form/raw-read-only-input';
23
+ export { default as TreeViewFinder } from './components/TreeViewFinder';
24
+ export { default as AboutDialog } from './components/TopBar/AboutDialog';
25
+ export { default as SnackbarProvider } from './components/SnackbarProvider';
26
+ export { default as AuthenticationRouter } from './components/AuthenticationRouter';
27
+ export { default as MuiVirtualizedTable } from './components/MuiVirtualizedTable';
28
+ export {
29
+ KeyedColumnsRowIndexer,
30
+ CHANGE_WAYS,
31
+ } from './components/MuiVirtualizedTable';
32
+ export { default as ReportViewer } from './components/ReportViewer';
33
+ export { default as ReportViewerDialog } from './components/ReportViewerDialog';
34
+ export { default as ElementSearchDialog } from './components/ElementSearchDialog';
35
+ export { default as MultipleSelectionDialog } from './components/MultipleSelectionDialog';
36
+
37
+ export {
38
+ EQUIPMENT_TYPE,
39
+ getEquipmentsInfosForSearchBar,
40
+ equipmentStyles,
41
+ } from './utils/EquipmentType';
42
+
43
+ export {
44
+ initializeAuthenticationDev,
45
+ initializeAuthenticationProd,
46
+ dispatchUser,
47
+ getPreLoginPath,
48
+ } from './utils/AuthService';
49
+
50
+ export { getFileIcon } from './utils/ElementType';
51
+
52
+ export {
53
+ DEFAULT_CELL_PADDING,
54
+ DEFAULT_HEADER_HEIGHT,
55
+ DEFAULT_ROW_HEIGHT,
56
+ } from './components/MuiVirtualizedTable/MuiVirtualizedTable';
57
+
58
+ export {
59
+ DARK_THEME,
60
+ LIGHT_THEME,
61
+ LANG_SYSTEM,
62
+ LANG_ENGLISH,
63
+ LANG_FRENCH,
64
+ } from './components/TopBar/TopBar';
18
65
  export {
19
- DirectoryItemsInputProps,
20
- DirectoryItemsInput,
21
- } from './components/react-hook-form/directory-items-input';
66
+ USER,
67
+ setLoggedUser,
68
+ SIGNIN_CALLBACK_ERROR,
69
+ setSignInCallbackError,
70
+ UNAUTHORIZED_USER_INFO,
71
+ LOGOUT_ERROR,
72
+ USER_VALIDATION_ERROR,
73
+ RESET_AUTHENTICATION_ROUTER_ERROR,
74
+ SHOW_AUTH_INFO_LOGIN,
75
+ } from './utils/actions';
76
+ export { default as report_viewer_en } from './components/translations/report-viewer-en';
77
+ export { default as report_viewer_fr } from './components/translations/report-viewer-fr';
78
+ export { default as login_en } from './components/translations/login-en';
79
+ export { default as login_fr } from './components/translations/login-fr';
80
+ export { default as top_bar_en } from './components/translations/top-bar-en';
81
+ export { default as top_bar_fr } from './components/translations/top-bar-fr';
82
+ export { default as table_en } from './components/translations/table-en';
83
+ export { default as table_fr } from './components/translations/table-fr';
84
+ export { default as treeview_finder_en } from './components/translations/treeview-finder-en';
85
+ export { default as treeview_finder_fr } from './components/translations/treeview-finder-fr';
86
+ export { default as element_search_en } from './components/translations/element-search-en';
87
+ export { default as element_search_fr } from './components/translations/element-search-fr';
88
+ export { default as equipment_search_en } from './components/translations/equipment-search-en';
89
+ export { default as equipment_search_fr } from './components/translations/equipment-search-fr';
90
+ export { default as card_error_boundary_en } from './components/translations/card-error-boundary-en';
91
+ export { default as card_error_boundary_fr } from './components/translations/card-error-boundary-fr';
92
+ export { default as flat_parameters_en } from './components/translations/flat-parameters-en';
93
+ export { default as flat_parameters_fr } from './components/translations/flat-parameters-fr';
94
+ export { default as multiple_selection_dialog_en } from './components/translations/multiple-selection-dialog-en';
95
+ export { default as multiple_selection_dialog_fr } from './components/translations/multiple-selection-dialog-fr';
96
+ export { default as common_button_en } from './components/translations/common-button-en';
97
+ export { default as common_button_fr } from './components/translations/common-button-fr';
98
+ export { default as directory_items_input_en } from './components/translations/directory-items-input-en';
99
+ export { default as directory_items_input_fr } from './components/translations/directory-items-input-fr';
100
+
101
+ export { TagRenderer } from './components/ElementSearchDialog';
102
+ export { EquipmentItem } from './components/ElementSearchDialog/equipment-item';
103
+ export { useIntlRef } from './hooks/useIntlRef';
104
+ export { default as SliderInput } from './components/react-hook-form/slider-input';
105
+ export { default as TextFieldWithAdornment } from './components/react-hook-form/utils/text-field-with-adornment';
22
106
  export {
23
- DirectoryItemSelectorProps,
24
- DirectoryItemSelector,
25
- } from './components/DirectoryItemSelector/directory-item-selector';
107
+ genHelperPreviousValue,
108
+ genHelperError,
109
+ identity,
110
+ isFieldRequired,
111
+ } from './components/react-hook-form/utils/functions';
112
+ export { default as DirectoryItemsInput } from './components/react-hook-form/directory-items-input';
113
+ export { default as DirectoryItemSelector } from './components/DirectoryItemSelector/directory-item-selector';
114
+ export { RawReadOnlyInput } from './components/react-hook-form/raw-read-only-input';
115
+ export { UserManagerMock } from './utils/UserManagerMock';
26
116
 
117
+ export {
118
+ ExpandingTextFieldProps,
119
+ ExpandingTextField,
120
+ } from './components/react-hook-form/expanding-text-field';
27
121
  /**
28
122
  * Section to export manual type declarations of .js and .jsx files
29
123
  */
30
124
 
125
+ export const CardErrorBoundary: FunctionComponent;
126
+
31
127
  export const TopBar: FunctionComponent;
32
128
 
33
129
  export function logout(
@@ -35,8 +131,6 @@ export function logout(
35
131
  userManagerInstance: any
36
132
  ): Promise<any | undefined>;
37
133
 
38
- export const DARK_THEME: string, LIGHT_THEME: string;
39
-
40
134
  interface SnackInputs {
41
135
  messageTxt?: string;
42
136
  messageId?: string;
@@ -111,7 +205,7 @@ type TextFieldWithAdornmentProps = TextFieldProps & {
111
205
  handleClearValue?: () => void;
112
206
  };
113
207
 
114
- interface TextInputProps {
208
+ export interface TextInputProps {
115
209
  name: string;
116
210
  label?: string;
117
211
  labelValues?: any; // it's for values from https://formatjs.io/docs/react-intl/components/#formattedmessage
package/dist/index.js CHANGED
@@ -48,77 +48,81 @@ import { useSnackMessage } from "./hooks/useSnackMessage.js";
48
48
  import { useDebounce } from "./hooks/useDebounce.js";
49
49
  import { default as default37 } from "./components/react-hook-form/autocomplete-input.js";
50
50
  import { default as default38 } from "./components/react-hook-form/text-input.js";
51
- import { default as default39 } from "./components/react-hook-form/radio-input.js";
52
- import { default as default40 } from "./components/react-hook-form/slider-input.js";
53
- import { default as default41 } from "./components/react-hook-form/numbers/float-input.js";
54
- import { default as default42 } from "./components/react-hook-form/numbers/integer-input.js";
55
- import { default as default43 } from "./components/react-hook-form/select-input.js";
56
- import { default as default44 } from "./components/react-hook-form/booleans/checkbox-input.js";
57
- import { default as default45 } from "./components/react-hook-form/booleans/switch-input.js";
58
- import { default as default46 } from "./components/react-hook-form/error-management/error-input.js";
59
- import { default as default47 } from "./components/react-hook-form/error-management/field-error-alert.js";
60
- import { default as default48 } from "./components/react-hook-form/error-management/mid-form-error.js";
61
- import { default as default49 } from "./components/react-hook-form/utils/text-field-with-adornment.js";
62
- import { default as default50 } from "./components/react-hook-form/utils/field-label.js";
63
- import { default as default51 } from "./components/react-hook-form/utils/submit-button.js";
64
- import { default as default52 } from "./components/react-hook-form/utils/cancel-button.js";
51
+ import { default as default39 } from "./components/react-hook-form/ExpandingTextField.js";
52
+ import { default as default40 } from "./components/react-hook-form/radio-input.js";
53
+ import { default as default41 } from "./components/react-hook-form/slider-input.js";
54
+ import { default as default42 } from "./components/react-hook-form/numbers/float-input.js";
55
+ import { default as default43 } from "./components/react-hook-form/numbers/integer-input.js";
56
+ import { default as default44 } from "./components/react-hook-form/select-input.js";
57
+ import { default as default45 } from "./components/react-hook-form/booleans/checkbox-input.js";
58
+ import { default as default46 } from "./components/react-hook-form/booleans/switch-input.js";
59
+ import { default as default47 } from "./components/react-hook-form/error-management/error-input.js";
60
+ import { default as default48 } from "./components/react-hook-form/error-management/field-error-alert.js";
61
+ import { default as default49 } from "./components/react-hook-form/error-management/mid-form-error.js";
62
+ import { default as default50 } from "./components/react-hook-form/utils/text-field-with-adornment.js";
63
+ import { default as default51 } from "./components/react-hook-form/utils/field-label.js";
64
+ import { default as default52 } from "./components/react-hook-form/utils/submit-button.js";
65
+ import { default as default53 } from "./components/react-hook-form/utils/cancel-button.js";
65
66
  import { genHelperError, genHelperPreviousValue, identity, isFieldRequired } from "./components/react-hook-form/utils/functions.js";
66
- import { default as default53 } from "./components/react-hook-form/directory-items-input.js";
67
- import { default as default54 } from "./components/DirectoryItemSelector/directory-item-selector.js";
67
+ import { default as default54 } from "./components/react-hook-form/directory-items-input.js";
68
+ import { default as default55 } from "./components/DirectoryItemSelector/directory-item-selector.js";
68
69
  import { RawReadOnlyInput } from "./components/react-hook-form/raw-read-only-input.js";
70
+ import { UserManagerMock } from "./utils/UserManagerMock.js";
69
71
  export {
70
72
  default4 as AboutDialog,
71
73
  default6 as AuthenticationRouter,
72
74
  default37 as AutocompleteInput,
73
75
  CHANGE_WAYS,
74
- default52 as CancelButton,
76
+ default53 as CancelButton,
75
77
  default36 as CardErrorBoundary,
76
- default44 as CheckboxInput,
78
+ default45 as CheckboxInput,
77
79
  DARK_THEME,
78
80
  DEFAULT_CELL_PADDING,
79
81
  DEFAULT_HEADER_HEIGHT,
80
82
  DEFAULT_ROW_HEIGHT,
81
- default54 as DirectoryItemSelector,
82
- default53 as DirectoryItemsInput,
83
+ default55 as DirectoryItemSelector,
84
+ default54 as DirectoryItemsInput,
83
85
  EQUIPMENT_TYPE,
84
86
  default10 as ElementSearchDialog,
85
87
  EquipmentItem,
86
- default46 as ErrorInput,
87
- default47 as FieldErrorAlert,
88
- default50 as FieldLabel,
88
+ default47 as ErrorInput,
89
+ default39 as ExpandingTextField,
90
+ default48 as FieldErrorAlert,
91
+ default51 as FieldLabel,
89
92
  FlatParameters,
90
- default41 as FloatInput,
91
- default42 as IntegerInput,
93
+ default42 as FloatInput,
94
+ default43 as IntegerInput,
92
95
  KeyedColumnsRowIndexer,
93
96
  LANG_ENGLISH,
94
97
  LANG_FRENCH,
95
98
  LANG_SYSTEM,
96
99
  LIGHT_THEME,
97
100
  LOGOUT_ERROR,
98
- default48 as MidFormError,
101
+ default49 as MidFormError,
99
102
  default7 as MuiVirtualizedTable,
100
103
  default11 as MultipleSelectionDialog,
101
104
  OverflowableText,
102
105
  RESET_AUTHENTICATION_ROUTER_ERROR,
103
- default39 as RadioInput,
106
+ default40 as RadioInput,
104
107
  RawReadOnlyInput,
105
108
  default8 as ReportViewer,
106
109
  default9 as ReportViewerDialog,
107
110
  SHOW_AUTH_INFO_LOGIN,
108
111
  SIGNIN_CALLBACK_ERROR,
109
- default43 as SelectInput,
110
- default40 as SliderInput,
112
+ default44 as SelectInput,
113
+ default41 as SliderInput,
111
114
  default5 as SnackbarProvider,
112
- default51 as SubmitButton,
113
- default45 as SwitchInput,
115
+ default52 as SubmitButton,
116
+ default46 as SwitchInput,
114
117
  TagRenderer,
115
- default49 as TextFieldWithAdornment,
118
+ default50 as TextFieldWithAdornment,
116
119
  default38 as TextInput,
117
120
  default3 as TopBar,
118
121
  default2 as TreeViewFinder,
119
122
  UNAUTHORIZED_USER_INFO,
120
123
  USER,
121
124
  USER_VALIDATION_ERROR,
125
+ UserManagerMock,
122
126
  default26 as card_error_boundary_en,
123
127
  default27 as card_error_boundary_fr,
124
128
  default32 as common_button_en,
@@ -1,6 +1,6 @@
1
1
  import { Log, UserManager } from "oidc-client";
2
2
  import { UserManagerMock } from "./UserManagerMock.js";
3
- import { setShowAuthenticationRouterLogin, setLoggedUser, setLogoutError, setUnauthorizedUserInfo, setUserValidationError, resetAuthenticationRouterError, setSignInCallbackError } from "./actions.js";
3
+ import { setShowAuthenticationRouterLogin, setLoggedUser, setLogoutError, setUnauthorizedUserInfo, setUserValidationError, setSignInCallbackError, resetAuthenticationRouterError } from "./actions.js";
4
4
  import jwtDecode from "jwt-decode";
5
5
  window.OIDCLog = Log;
6
6
  const hackAuthorityKey = "oidc.hack.authority";
@@ -1,5 +1,4 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import { Settings, Article, NoteAlt, OfflineBolt, Photo, PhotoLibrary } from "@mui/icons-material";
4
3
  const elementType = {
5
4
  DIRECTORY: "DIRECTORY",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.49.0",
3
+ "version": "0.50.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "engines": {
6
6
  "npm": ">=9",
@@ -12,6 +12,9 @@
12
12
  "files": [
13
13
  "dist"
14
14
  ],
15
+ "sideEffects": [
16
+ "**/*.css"
17
+ ],
15
18
  "scripts": {
16
19
  "start": "vite demo/ --config vite.config.mts",
17
20
  "start:open": "vite demo/ --config vite.config.mts --open",
@@ -78,6 +81,7 @@
78
81
  "eslint-plugin-prettier": "^4.0.0",
79
82
  "eslint-plugin-react": "^7.21.0",
80
83
  "eslint-plugin-react-hooks": "^4.1.2",
84
+ "glob": "^10.3.10",
81
85
  "jest": "^29.7.0",
82
86
  "jest-environment-jsdom": "^29.7.0",
83
87
  "jest-svg-transformer": "^1.0.0",
@@ -96,26 +100,13 @@
96
100
  "react-resizable": "^3.0.4",
97
101
  "vite": "^5.0.11",
98
102
  "vite-plugin-eslint": "^1.8.1",
99
- "vite-plugin-externalize-deps": "^0.8.0",
100
103
  "vite-plugin-svgr": "^4.2.0",
101
104
  "vite-plugin-dts": "^2.3.0",
105
+ "vite-plugin-lib-inject-css": "^2.0.0",
102
106
  "yup": "^1.0.0"
103
107
  },
104
- "eslintConfig": {
105
- "extends": [
106
- "react-app",
107
- "plugin:prettier/recommended"
108
- ],
109
- "ignorePatterns": [
110
- "dist"
111
- ],
112
- "rules": {
113
- "prettier/prettier": "warn",
114
- "curly": "error"
115
- }
116
- },
117
108
  "author": "gridsuite team",
118
109
  "homepage": "https://github.com/gridsuite",
119
- "license": "MPL",
110
+ "license": "MPL-2.0",
120
111
  "repository": "git://github.com/gridsuite/commons-ui.git"
121
112
  }