@gridsuite/commons-ui 0.46.0 → 0.48.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 (271) hide show
  1. package/README.md +0 -17
  2. package/dist/components/AuthenticationRouter/AuthenticationRouter.d.ts +10 -0
  3. package/dist/components/AuthenticationRouter/AuthenticationRouter.js +147 -0
  4. package/dist/components/AuthenticationRouter/index.d.ts +1 -0
  5. package/dist/components/CardErrorBoundary/card-error-boundary.d.ts +18 -0
  6. package/dist/components/CardErrorBoundary/card-error-boundary.js +110 -0
  7. package/dist/components/CardErrorBoundary/index.d.ts +1 -0
  8. package/dist/components/DirectoryItemSelector/directory-item-selector.d.ts +22 -0
  9. package/dist/components/DirectoryItemSelector/directory-item-selector.js +254 -0
  10. package/dist/components/ElementSearchDialog/element-search-dialog.d.ts +16 -0
  11. package/dist/components/ElementSearchDialog/element-search-dialog.js +139 -0
  12. package/dist/components/ElementSearchDialog/equipment-item.d.ts +16 -0
  13. package/dist/components/ElementSearchDialog/equipment-item.js +77 -0
  14. package/dist/components/ElementSearchDialog/index.d.ts +2 -0
  15. package/dist/components/ElementSearchDialog/tag-renderer.d.ts +11 -0
  16. package/dist/components/ElementSearchDialog/tag-renderer.js +34 -0
  17. package/dist/components/FlatParameters/FlatParameters.d.ts +10 -0
  18. package/dist/components/FlatParameters/FlatParameters.js +411 -0
  19. package/dist/components/FlatParameters/index.d.ts +1 -0
  20. package/dist/components/Login/Login.d.ts +5 -0
  21. package/dist/components/Login/Login.js +78 -0
  22. package/dist/components/Login/Logout.d.ts +5 -0
  23. package/dist/components/Login/Logout.js +69 -0
  24. package/dist/components/Login/index.d.ts +1 -0
  25. package/dist/components/MuiVirtualizedTable/ColumnHeader.d.ts +4 -0
  26. package/dist/components/MuiVirtualizedTable/ColumnHeader.js +127 -0
  27. package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.d.ts +104 -0
  28. package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +548 -0
  29. package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.d.ts +131 -0
  30. package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.js +790 -0
  31. package/dist/components/MuiVirtualizedTable/index.d.ts +2 -0
  32. package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.d.ts +10 -0
  33. package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.js +87 -0
  34. package/dist/components/MultipleSelectionDialog/index.d.ts +1 -0
  35. package/dist/components/OverflowableText/index.d.ts +1 -0
  36. package/dist/components/OverflowableText/overflowable-text.d.ts +2 -0
  37. package/dist/components/OverflowableText/overflowable-text.js +87 -0
  38. package/dist/components/ReportViewer/filter-button.d.ts +1 -0
  39. package/dist/components/ReportViewer/filter-button.js +64 -0
  40. package/dist/components/ReportViewer/index.d.ts +1 -0
  41. package/dist/components/ReportViewer/log-report-item.d.ts +68 -0
  42. package/dist/components/ReportViewer/log-report-item.js +95 -0
  43. package/dist/components/ReportViewer/log-report.d.ts +21 -0
  44. package/dist/components/ReportViewer/log-report.js +49 -0
  45. package/dist/components/ReportViewer/log-table.d.ts +8 -0
  46. package/dist/components/ReportViewer/log-table.js +131 -0
  47. package/dist/components/ReportViewer/multi-select-list.d.ts +1 -0
  48. package/dist/components/ReportViewer/multi-select-list.js +40 -0
  49. package/dist/components/ReportViewer/report-item.d.ts +13 -0
  50. package/dist/components/ReportViewer/report-item.js +112 -0
  51. package/dist/components/ReportViewer/report-tree-view-context.d.ts +2 -0
  52. package/dist/components/ReportViewer/report-tree-view-context.js +8 -0
  53. package/dist/components/ReportViewer/report-viewer.d.ts +4 -0
  54. package/dist/components/ReportViewer/report-viewer.js +158 -0
  55. package/dist/components/ReportViewerDialog/index.d.ts +1 -0
  56. package/dist/components/ReportViewerDialog/report-viewer-dialog.d.ts +1 -0
  57. package/dist/components/ReportViewerDialog/report-viewer-dialog.js +61 -0
  58. package/dist/components/SignInCallbackHandler/SignInCallbackHandler.d.ts +5 -0
  59. package/dist/components/SignInCallbackHandler/SignInCallbackHandler.js +13 -0
  60. package/dist/components/SignInCallbackHandler/index.d.ts +1 -0
  61. package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.d.ts +5 -0
  62. package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.js +16 -0
  63. package/dist/components/SilentRenewCallbackHandler/index.d.ts +1 -0
  64. package/dist/components/SnackbarProvider/SnackbarProvider.d.ts +3 -0
  65. package/dist/components/SnackbarProvider/SnackbarProvider.js +28 -0
  66. package/dist/components/SnackbarProvider/index.d.ts +1 -0
  67. package/dist/components/TopBar/AboutDialog.d.ts +24 -0
  68. package/dist/components/TopBar/AboutDialog.js +467 -0
  69. package/dist/components/TopBar/GridLogo.d.ts +34 -0
  70. package/dist/components/TopBar/GridLogo.js +71 -0
  71. package/dist/components/TopBar/TopBar.d.ts +53 -0
  72. package/dist/components/TopBar/TopBar.js +679 -0
  73. package/dist/components/TopBar/index.d.ts +3 -0
  74. package/dist/components/TreeViewFinder/TreeViewFinder.d.ts +57 -0
  75. package/dist/components/TreeViewFinder/TreeViewFinder.js +288 -0
  76. package/dist/components/TreeViewFinder/index.d.ts +1 -0
  77. package/dist/components/react-hook-form/autocomplete-input.d.ts +30 -0
  78. package/dist/components/react-hook-form/autocomplete-input.js +96 -0
  79. package/dist/components/react-hook-form/booleans/boolean-input.d.ts +16 -0
  80. package/dist/components/react-hook-form/booleans/boolean-input.js +49 -0
  81. package/dist/components/react-hook-form/booleans/checkbox-input.d.ts +14 -0
  82. package/dist/components/react-hook-form/booleans/checkbox-input.js +24 -0
  83. package/dist/components/react-hook-form/booleans/switch-input.d.ts +14 -0
  84. package/dist/components/react-hook-form/booleans/switch-input.js +24 -0
  85. package/dist/components/react-hook-form/directory-items-input.d.ts +28 -0
  86. package/dist/components/react-hook-form/directory-items-input.js +185 -0
  87. package/dist/components/react-hook-form/error-management/error-input.d.ts +5 -0
  88. package/dist/components/react-hook-form/error-management/error-input.js +42 -0
  89. package/dist/components/react-hook-form/error-management/field-error-alert.d.ts +4 -0
  90. package/dist/components/react-hook-form/error-management/field-error-alert.js +9 -0
  91. package/dist/components/react-hook-form/error-management/mid-form-error.d.ts +4 -0
  92. package/dist/components/react-hook-form/error-management/mid-form-error.js +20 -0
  93. package/dist/components/react-hook-form/numbers/float-input.d.ts +18 -0
  94. package/dist/components/react-hook-form/numbers/float-input.js +51 -0
  95. package/dist/components/react-hook-form/numbers/integer-input.d.ts +18 -0
  96. package/dist/components/react-hook-form/numbers/integer-input.js +36 -0
  97. package/dist/components/react-hook-form/numbers/utils.d.ts +2 -0
  98. package/dist/components/react-hook-form/numbers/utils.js +10 -0
  99. package/dist/components/react-hook-form/radio-input.d.ts +18 -0
  100. package/dist/components/react-hook-form/radio-input.js +44 -0
  101. package/{es/components/MultipleSelectionDialog/index.js → dist/components/react-hook-form/raw-read-only-input.d.ts} +3 -2
  102. package/dist/components/react-hook-form/raw-read-only-input.js +10 -0
  103. package/dist/components/react-hook-form/select-input.d.ts +17 -0
  104. package/dist/components/react-hook-form/select-input.js +31 -0
  105. package/dist/components/react-hook-form/slider-input.d.ts +21 -0
  106. package/dist/components/react-hook-form/slider-input.js +43 -0
  107. package/dist/components/react-hook-form/text-input.d.ts +33 -0
  108. package/dist/components/react-hook-form/text-input.js +94 -0
  109. package/dist/components/react-hook-form/utils/cancel-button.d.ts +10 -0
  110. package/dist/components/react-hook-form/utils/cancel-button.js +16 -0
  111. package/dist/components/react-hook-form/utils/field-label.d.ts +6 -0
  112. package/dist/components/react-hook-form/utils/field-label.js +12 -0
  113. package/dist/components/react-hook-form/utils/functions.d.ts +11 -0
  114. package/dist/components/react-hook-form/utils/functions.js +41 -0
  115. package/dist/components/react-hook-form/utils/submit-button.d.ts +10 -0
  116. package/dist/components/react-hook-form/utils/submit-button.js +23 -0
  117. package/dist/components/react-hook-form/utils/text-field-with-adornment.d.ts +12 -0
  118. package/dist/components/react-hook-form/utils/text-field-with-adornment.js +96 -0
  119. package/{es/components/translations/report-viewer-fr.js → dist/components/translations/card-error-boundary-en.d.ts} +5 -6
  120. package/dist/components/translations/card-error-boundary-en.js +8 -0
  121. package/dist/components/translations/card-error-boundary-fr.d.ts +12 -0
  122. package/dist/components/translations/card-error-boundary-fr.js +8 -0
  123. package/dist/components/translations/common-button-en.d.ts +5 -0
  124. package/dist/components/translations/common-button-en.js +7 -0
  125. package/dist/components/translations/common-button-fr.d.ts +5 -0
  126. package/dist/components/translations/common-button-fr.js +7 -0
  127. package/{es/components/translations/element-search-en.js → dist/components/translations/element-search-en.d.ts} +4 -5
  128. package/dist/components/translations/element-search-en.js +7 -0
  129. package/dist/components/translations/element-search-fr.d.ts +11 -0
  130. package/dist/components/translations/element-search-fr.js +7 -0
  131. package/dist/components/translations/equipment-search-en.d.ts +25 -0
  132. package/dist/components/translations/equipment-search-en.js +21 -0
  133. package/dist/components/translations/equipment-search-fr.d.ts +25 -0
  134. package/dist/components/translations/equipment-search-fr.js +21 -0
  135. package/{es/components/translations/flat-parameters-en.js → dist/components/translations/flat-parameters-en.d.ts} +5 -6
  136. package/dist/components/translations/flat-parameters-en.js +8 -0
  137. package/{es/components/translations/common-button-en.js → dist/components/translations/flat-parameters-fr.d.ts} +5 -5
  138. package/dist/components/translations/flat-parameters-fr.js +8 -0
  139. package/dist/components/translations/login-en.d.ts +18 -0
  140. package/dist/components/translations/login-en.js +14 -0
  141. package/dist/components/translations/login-fr.d.ts +18 -0
  142. package/dist/components/translations/login-fr.js +14 -0
  143. package/{es/components/translations/flat-parameters-fr.js → dist/components/translations/multiple-selection-dialog-en.d.ts} +5 -6
  144. package/dist/components/translations/multiple-selection-dialog-en.js +8 -0
  145. package/{es/components/translations/common-button-fr.js → dist/components/translations/multiple-selection-dialog-fr.d.ts} +5 -5
  146. package/dist/components/translations/multiple-selection-dialog-fr.js +8 -0
  147. package/{es/components/translations/report-viewer-en.js → dist/components/translations/report-viewer-en.d.ts} +5 -6
  148. package/dist/components/translations/report-viewer-en.js +8 -0
  149. package/{es/components/translations/element-search-fr.js → dist/components/translations/report-viewer-fr.d.ts} +5 -5
  150. package/dist/components/translations/report-viewer-fr.js +8 -0
  151. package/{es/components/translations/table-en.js → dist/components/translations/table-en.d.ts} +3 -4
  152. package/dist/components/translations/table-en.js +6 -0
  153. package/{es/components/translations/table-fr.js → dist/components/translations/table-fr.d.ts} +3 -4
  154. package/dist/components/translations/table-fr.js +6 -0
  155. package/dist/components/translations/top-bar-en.d.ts +31 -0
  156. package/dist/components/translations/top-bar-en.js +27 -0
  157. package/dist/components/translations/top-bar-fr.d.ts +31 -0
  158. package/dist/components/translations/top-bar-fr.js +27 -0
  159. package/dist/components/translations/treeview-finder-en.d.ts +16 -0
  160. package/dist/components/translations/treeview-finder-en.js +12 -0
  161. package/dist/components/translations/treeview-finder-fr.d.ts +16 -0
  162. package/dist/components/translations/treeview-finder-fr.js +12 -0
  163. package/dist/hooks/useDebounce.d.ts +1 -0
  164. package/dist/hooks/useDebounce.js +17 -0
  165. package/{es/components/ElementSearchDialog/index.js → dist/hooks/useIntlRef.d.ts} +2 -2
  166. package/dist/hooks/useIntlRef.js +13 -0
  167. package/dist/hooks/useSnackMessage.d.ts +5 -0
  168. package/dist/hooks/useSnackMessage.js +81 -0
  169. package/dist/index.d.ts +234 -0
  170. package/dist/index.js +158 -0
  171. package/dist/utils/AuthService.d.ts +9 -0
  172. package/dist/utils/AuthService.js +336 -0
  173. package/dist/utils/ElementType.d.ts +13 -0
  174. package/dist/utils/ElementType.js +42 -0
  175. package/dist/utils/EquipmentType.d.ts +136 -0
  176. package/dist/utils/EquipmentType.js +132 -0
  177. package/dist/utils/UserManagerMock.d.ts +34 -0
  178. package/dist/utils/UserManagerMock.js +85 -0
  179. package/dist/utils/actions.d.ts +50 -0
  180. package/dist/utils/actions.js +71 -0
  181. package/{es/components/CardErrorBoundary/index.js → dist/utils/algos.d.ts} +1 -1
  182. package/dist/utils/algos.js +24 -0
  183. package/dist/utils/styles.d.ts +5 -0
  184. package/dist/utils/styles.js +13 -0
  185. package/package.json +36 -21
  186. package/es/components/AuthenticationRouter/AuthenticationRouter.js +0 -102
  187. package/es/components/AuthenticationRouter/index.js +0 -7
  188. package/es/components/CardErrorBoundary/card-error-boundary.js +0 -138
  189. package/es/components/ElementSearchDialog/element-search-dialog.js +0 -153
  190. package/es/components/ElementSearchDialog/equipment-item.js +0 -63
  191. package/es/components/ElementSearchDialog/tag-renderer.js +0 -29
  192. package/es/components/FlatParameters/FlatParameters.js +0 -448
  193. package/es/components/FlatParameters/index.js +0 -8
  194. package/es/components/Login/Login.js +0 -79
  195. package/es/components/Login/Logout.js +0 -78
  196. package/es/components/Login/index.js +0 -7
  197. package/es/components/MuiVirtualizedTable/ColumnHeader.js +0 -125
  198. package/es/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +0 -619
  199. package/es/components/MuiVirtualizedTable/MuiVirtualizedTable.js +0 -780
  200. package/es/components/MuiVirtualizedTable/index.js +0 -9
  201. package/es/components/MultipleSelectionDialog/MultipleSelectionDialog.js +0 -95
  202. package/es/components/OverflowableText/index.js +0 -7
  203. package/es/components/OverflowableText/overflowable-text.js +0 -81
  204. package/es/components/ReportViewer/filter-button.js +0 -77
  205. package/es/components/ReportViewer/index.js +0 -7
  206. package/es/components/ReportViewer/log-report-item.js +0 -97
  207. package/es/components/ReportViewer/log-report.js +0 -63
  208. package/es/components/ReportViewer/log-table.js +0 -130
  209. package/es/components/ReportViewer/multi-select-list.js +0 -56
  210. package/es/components/ReportViewer/report-item.js +0 -131
  211. package/es/components/ReportViewer/report-tree-view-context.js +0 -13
  212. package/es/components/ReportViewer/report-viewer.js +0 -167
  213. package/es/components/ReportViewerDialog/index.js +0 -7
  214. package/es/components/ReportViewerDialog/report-viewer-dialog.js +0 -67
  215. package/es/components/SignInCallbackHandler/SignInCallbackHandler.js +0 -19
  216. package/es/components/SignInCallbackHandler/index.js +0 -7
  217. package/es/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.js +0 -19
  218. package/es/components/SilentRenewCallbackHandler/index.js +0 -7
  219. package/es/components/SnackbarProvider/SnackbarProvider.js +0 -39
  220. package/es/components/SnackbarProvider/index.js +0 -7
  221. package/es/components/TopBar/AboutDialog.js +0 -456
  222. package/es/components/TopBar/GridLogo.js +0 -73
  223. package/es/components/TopBar/TopBar.js +0 -487
  224. package/es/components/TopBar/index.js +0 -9
  225. package/es/components/TreeViewFinder/TreeViewFinder.js +0 -341
  226. package/es/components/TreeViewFinder/index.js +0 -7
  227. package/es/components/images/powsybl_logo.svg +0 -35
  228. package/es/components/react-hook-form/autocomplete-input.js +0 -110
  229. package/es/components/react-hook-form/booleans/boolean-input.js +0 -56
  230. package/es/components/react-hook-form/booleans/checkbox-input.js +0 -28
  231. package/es/components/react-hook-form/booleans/switch-input.js +0 -28
  232. package/es/components/react-hook-form/error-management/error-input.js +0 -50
  233. package/es/components/react-hook-form/error-management/field-error-alert.js +0 -22
  234. package/es/components/react-hook-form/error-management/mid-form-error.js +0 -25
  235. package/es/components/react-hook-form/numbers/float-input.js +0 -105
  236. package/es/components/react-hook-form/numbers/integer-input.js +0 -35
  237. package/es/components/react-hook-form/numbers/utils.js +0 -6
  238. package/es/components/react-hook-form/radio-input.js +0 -55
  239. package/es/components/react-hook-form/select-input.js +0 -40
  240. package/es/components/react-hook-form/slider-input.js +0 -48
  241. package/es/components/react-hook-form/text-input.js +0 -100
  242. package/es/components/react-hook-form/utils/cancel-button.js +0 -28
  243. package/es/components/react-hook-form/utils/field-label.js +0 -15
  244. package/es/components/react-hook-form/utils/functions.js +0 -42
  245. package/es/components/react-hook-form/utils/submit-button.js +0 -29
  246. package/es/components/react-hook-form/utils/text-field-with-adornment.js +0 -92
  247. package/es/components/translations/card-error-boundary-en.js +0 -13
  248. package/es/components/translations/card-error-boundary-fr.js +0 -13
  249. package/es/components/translations/equipment-search-en.js +0 -26
  250. package/es/components/translations/equipment-search-fr.js +0 -26
  251. package/es/components/translations/inputs-en.js +0 -25
  252. package/es/components/translations/inputs-fr.js +0 -25
  253. package/es/components/translations/login-en.js +0 -19
  254. package/es/components/translations/login-fr.js +0 -19
  255. package/es/components/translations/multiple-selection-dialog-en.js +0 -13
  256. package/es/components/translations/multiple-selection-dialog-fr.js +0 -13
  257. package/es/components/translations/top-bar-en.js +0 -32
  258. package/es/components/translations/top-bar-fr.js +0 -32
  259. package/es/components/translations/treeview-finder-en.js +0 -17
  260. package/es/components/translations/treeview-finder-fr.js +0 -17
  261. package/es/hooks/useDebounce.js +0 -26
  262. package/es/hooks/useIntlRef.js +0 -22
  263. package/es/hooks/useSnackMessage.js +0 -81
  264. package/es/index.js +0 -71
  265. package/es/utils/AuthService.js +0 -312
  266. package/es/utils/ElementType.js +0 -53
  267. package/es/utils/EquipmentType.js +0 -133
  268. package/es/utils/UserManagerMock.js +0 -81
  269. package/es/utils/actions.js +0 -65
  270. package/es/utils/algos.js +0 -29
  271. package/es/utils/styles.js +0 -35
@@ -0,0 +1,94 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import "react";
3
+ import PropTypes from "prop-types";
4
+ import { InputAdornment, IconButton, TextField } from "@mui/material";
5
+ import { Clear } from "@mui/icons-material";
6
+ import { useFormContext, useController } from "react-hook-form";
7
+ import TextFieldWithAdornment from "./utils/text-field-with-adornment.js";
8
+ import FieldLabel from "./utils/field-label.js";
9
+ import { isFieldRequired, genHelperPreviousValue, genHelperError, identity } from "./utils/functions.js";
10
+ const TextInput = ({
11
+ name,
12
+ label,
13
+ labelValues,
14
+ // this prop is used to add a value to label. this value is displayed without being translated
15
+ id,
16
+ adornment,
17
+ customAdornment,
18
+ outputTransform = identity,
19
+ //transform materialUi input value before sending it to react hook form, mostly used to deal with number fields
20
+ inputTransform = identity,
21
+ //transform react hook form value before sending it to materialUi input, mostly used to deal with number fields
22
+ acceptValue = () => true,
23
+ //used to check user entry before committing the input change, used mostly to prevent user from typing a character in number field
24
+ previousValue,
25
+ clearable,
26
+ formProps
27
+ }) => {
28
+ const { validationSchema, getValues, removeOptional } = useFormContext();
29
+ const {
30
+ field: { onChange, value, ref },
31
+ fieldState: { error }
32
+ } = useController({ name });
33
+ const Field = adornment ? TextFieldWithAdornment : TextField;
34
+ const handleClearValue = () => {
35
+ onChange(outputTransform(""));
36
+ };
37
+ const handleValueChanged = (e) => {
38
+ if (acceptValue(e.target.value)) {
39
+ onChange(outputTransform(e.target.value));
40
+ }
41
+ };
42
+ const transformedValue = inputTransform(value);
43
+ const fieldLabel = !label ? null : FieldLabel({
44
+ label,
45
+ values: labelValues,
46
+ optional: !isFieldRequired(name, validationSchema, getValues()) && !(formProps == null ? void 0 : formProps.disabled) && !removeOptional
47
+ });
48
+ return /* @__PURE__ */ jsx(
49
+ Field,
50
+ {
51
+ size: "small",
52
+ fullWidth: true,
53
+ id: id ? id : label,
54
+ label: fieldLabel,
55
+ ...adornment && {
56
+ adornmentPosition: adornment.position,
57
+ adornmentText: adornment == null ? void 0 : adornment.text
58
+ },
59
+ value: transformedValue,
60
+ onChange: handleValueChanged,
61
+ InputProps: {
62
+ endAdornment: /* @__PURE__ */ jsxs(InputAdornment, { position: "end", children: [
63
+ clearable && transformedValue !== void 0 && transformedValue !== "" && /* @__PURE__ */ jsx(IconButton, { onClick: handleClearValue, children: /* @__PURE__ */ jsx(Clear, {}) }),
64
+ customAdornment && { ...customAdornment }
65
+ ] })
66
+ },
67
+ inputRef: ref,
68
+ ...clearable && adornment && {
69
+ handleClearValue
70
+ },
71
+ ...genHelperPreviousValue(previousValue, adornment),
72
+ ...genHelperError(error == null ? void 0 : error.message),
73
+ ...formProps
74
+ },
75
+ id ? id : label
76
+ );
77
+ };
78
+ TextInput.propTypes = {
79
+ name: PropTypes.string,
80
+ label: PropTypes.string,
81
+ labelValues: PropTypes.object,
82
+ id: PropTypes.string,
83
+ adornment: PropTypes.object,
84
+ customAdornment: PropTypes.object,
85
+ outputTransform: PropTypes.func,
86
+ inputTransform: PropTypes.func,
87
+ acceptValue: PropTypes.func,
88
+ previousValue: PropTypes.any,
89
+ clearable: PropTypes.bool,
90
+ formProps: PropTypes.object
91
+ };
92
+ export {
93
+ TextInput as default
94
+ };
@@ -0,0 +1,10 @@
1
+ export default CancelButton;
2
+ declare function CancelButton({ ...inProps }: {
3
+ [x: string]: any;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ declare namespace CancelButton {
6
+ namespace propTypes {
7
+ const buttonProps: PropTypes.Requireable<object>;
8
+ }
9
+ }
10
+ import PropTypes from 'prop-types';
@@ -0,0 +1,16 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import "react";
3
+ import { Button } from "@mui/material";
4
+ import { FormattedMessage } from "react-intl";
5
+ import PropTypes from "prop-types";
6
+ import { useThemeProps } from "@mui/material/styles";
7
+ const CancelButton = ({ ...inProps }) => {
8
+ const props = useThemeProps({ props: inProps, name: "CancelButton" });
9
+ return /* @__PURE__ */ jsx(Button, { ...props, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "cancel" }) });
10
+ };
11
+ CancelButton.propTypes = {
12
+ buttonProps: PropTypes.object
13
+ };
14
+ export {
15
+ CancelButton as default
16
+ };
@@ -0,0 +1,6 @@
1
+ export default FieldLabel;
2
+ declare function FieldLabel({ label, optional, values }: {
3
+ label: any;
4
+ optional: any;
5
+ values?: undefined;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import "react";
3
+ import { FormattedMessage } from "react-intl";
4
+ const FieldLabel = ({ label, optional, values = void 0 }) => {
5
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
6
+ /* @__PURE__ */ jsx(FormattedMessage, { id: label, values }),
7
+ optional && /* @__PURE__ */ jsx(FormattedMessage, { id: "Optional" })
8
+ ] });
9
+ };
10
+ export {
11
+ FieldLabel as default
12
+ };
@@ -0,0 +1,11 @@
1
+ export function genHelperPreviousValue(previousValue: any, adornment: any): any;
2
+ export function genHelperError(...errors: any[]): {
3
+ error: boolean;
4
+ helperText: import("react/jsx-runtime").JSX.Element;
5
+ } | {
6
+ error?: undefined;
7
+ helperText?: undefined;
8
+ };
9
+ export function identity(x: any): any;
10
+ export function isFieldFromContextRequired(fieldName: any, formContext: any, values: any): boolean;
11
+ export function isFieldRequired(fieldName: any, schema: any, values: any): boolean;
@@ -0,0 +1,41 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import "react";
3
+ import { FormattedMessage } from "react-intl";
4
+ import { getIn } from "yup";
5
+ function genHelperPreviousValue(previousValue, adornment) {
6
+ return {
7
+ ...(previousValue || previousValue === 0) && {
8
+ error: false,
9
+ helperText: previousValue + (adornment ? " " + (adornment == null ? void 0 : adornment.text) : "")
10
+ }
11
+ };
12
+ }
13
+ function genHelperError(...errors) {
14
+ const inError = errors.find((e) => e);
15
+ if (inError) {
16
+ return {
17
+ error: true,
18
+ helperText: /* @__PURE__ */ jsx(FormattedMessage, { id: inError })
19
+ };
20
+ }
21
+ return {};
22
+ }
23
+ function identity(x) {
24
+ return x;
25
+ }
26
+ const isFieldFromContextRequired = (fieldName, formContext, values) => {
27
+ const { validationSchema } = formContext;
28
+ return isFieldRequired(fieldName, validationSchema, values);
29
+ };
30
+ const isFieldRequired = (fieldName, schema, values) => {
31
+ var _a;
32
+ const { schema: fieldSchema, parent: parentValues } = getIn(schema, fieldName, values) || {};
33
+ return ((_a = fieldSchema.describe({ parent: parentValues })) == null ? void 0 : _a.optional) === false;
34
+ };
35
+ export {
36
+ genHelperError,
37
+ genHelperPreviousValue,
38
+ identity,
39
+ isFieldFromContextRequired,
40
+ isFieldRequired
41
+ };
@@ -0,0 +1,10 @@
1
+ export default SubmitButton;
2
+ declare function SubmitButton({ ...buttonProps }: {
3
+ [x: string]: any;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ declare namespace SubmitButton {
6
+ namespace propTypes {
7
+ const buttonProps: PropTypes.Requireable<object>;
8
+ }
9
+ }
10
+ import PropTypes from 'prop-types';
@@ -0,0 +1,23 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import "react";
3
+ import { Button } from "@mui/material";
4
+ import { useFormState } from "react-hook-form";
5
+ import { FormattedMessage } from "react-intl";
6
+ import PropTypes from "prop-types";
7
+ const SubmitButton = ({ ...buttonProps }) => {
8
+ const { isDirty } = useFormState();
9
+ return /* @__PURE__ */ jsx(
10
+ Button,
11
+ {
12
+ ...buttonProps,
13
+ disabled: !isDirty || ((buttonProps == null ? void 0 : buttonProps.disabled) ?? false),
14
+ children: /* @__PURE__ */ jsx(FormattedMessage, { id: "validate" })
15
+ }
16
+ );
17
+ };
18
+ SubmitButton.propTypes = {
19
+ buttonProps: PropTypes.object
20
+ };
21
+ export {
22
+ SubmitButton as default
23
+ };
@@ -0,0 +1,12 @@
1
+ export default TextFieldWithAdornment;
2
+ declare function TextFieldWithAdornment(props: any): import("react/jsx-runtime").JSX.Element;
3
+ declare namespace TextFieldWithAdornment {
4
+ namespace propTypes {
5
+ const adornmentPosition: PropTypes.Validator<string>;
6
+ const adornmentText: PropTypes.Validator<string>;
7
+ const value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
8
+ const variant: PropTypes.Requireable<string>;
9
+ const handleClearValue: PropTypes.Requireable<(...args: any[]) => any>;
10
+ }
11
+ }
12
+ import PropTypes from 'prop-types';
@@ -0,0 +1,96 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useState, useCallback } from "react";
3
+ import PropTypes from "prop-types";
4
+ import { Clear } from "@mui/icons-material";
5
+ import { InputAdornment, IconButton, TextField } from "@mui/material";
6
+ const TextFieldWithAdornment = (props) => {
7
+ const {
8
+ adornmentPosition,
9
+ adornmentText,
10
+ value,
11
+ variant,
12
+ handleClearValue,
13
+ ...otherProps
14
+ } = props;
15
+ const [isFocused, setIsFocused] = useState(false);
16
+ const getAdornmentStyle = useCallback((variant2) => {
17
+ if (variant2 === "filled") {
18
+ return {
19
+ alignItems: "start",
20
+ marginBottom: "0.4em"
21
+ };
22
+ }
23
+ if (variant2 === "standard") {
24
+ return {
25
+ marginBottom: "0.3em"
26
+ };
27
+ }
28
+ return void 0;
29
+ }, []);
30
+ const getClearAdornment = useCallback(
31
+ (position) => {
32
+ return /* @__PURE__ */ jsx(InputAdornment, { position, children: /* @__PURE__ */ jsx(IconButton, { onClick: handleClearValue, children: /* @__PURE__ */ jsx(Clear, {}) }) });
33
+ },
34
+ [handleClearValue]
35
+ );
36
+ const getTextAdornment = useCallback(
37
+ (position) => {
38
+ return /* @__PURE__ */ jsx(
39
+ InputAdornment,
40
+ {
41
+ position,
42
+ sx: getAdornmentStyle(variant),
43
+ children: adornmentText
44
+ }
45
+ );
46
+ },
47
+ [adornmentText, getAdornmentStyle, variant]
48
+ );
49
+ const withEndAdornmentText = useCallback(() => {
50
+ return value !== "" || isFocused ? {
51
+ startAdornment: value && handleClearValue ? getClearAdornment("start") : void 0,
52
+ endAdornment: getTextAdornment("end"),
53
+ sx: { textAlign: "end" }
54
+ } : void 0;
55
+ }, [
56
+ value,
57
+ handleClearValue,
58
+ getClearAdornment,
59
+ isFocused,
60
+ getTextAdornment
61
+ ]);
62
+ const withStartAdornmentText = useCallback(() => {
63
+ return value !== "" || isFocused ? {
64
+ startAdornment: getTextAdornment("start"),
65
+ endAdornment: value && handleClearValue && getClearAdornment("end"),
66
+ sx: { textAlign: "start" }
67
+ } : void 0;
68
+ }, [
69
+ value,
70
+ handleClearValue,
71
+ getClearAdornment,
72
+ isFocused,
73
+ getTextAdornment
74
+ ]);
75
+ return /* @__PURE__ */ jsx(
76
+ TextField,
77
+ {
78
+ ...otherProps,
79
+ variant,
80
+ value,
81
+ InputProps: adornmentPosition === "start" ? withStartAdornmentText() : withEndAdornmentText(),
82
+ onFocus: (e) => setIsFocused(true),
83
+ onBlur: (e) => setIsFocused(false)
84
+ }
85
+ );
86
+ };
87
+ TextFieldWithAdornment.propTypes = {
88
+ adornmentPosition: PropTypes.string.isRequired,
89
+ adornmentText: PropTypes.string.isRequired,
90
+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
91
+ variant: PropTypes.string,
92
+ handleClearValue: PropTypes.func
93
+ };
94
+ export {
95
+ TextFieldWithAdornment as default
96
+ };
@@ -1,13 +1,12 @@
1
+ export default card_error_boundary_en;
1
2
  /**
2
3
  * Copyright (c) 2022, RTE (http://www.rte-france.com)
3
4
  * This Source Code Form is subject to the terms of the Mozilla Public
4
5
  * License, v. 2.0. If a copy of the MPL was not distributed with this
5
6
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7
  */
7
-
8
- var report_viewer_fr = {
9
- 'report_viewer/close': 'Fermer',
10
- 'report_viewer/severity': 'Sévérité',
11
- 'report_viewer/message': 'Message'
8
+ declare const card_error_boundary_en: {
9
+ 'card_error_boundary/title': string;
10
+ 'card_error_boundary/content': string;
11
+ 'card_error_boundary/expandederrorheader': string;
12
12
  };
13
- export default report_viewer_fr;
@@ -0,0 +1,8 @@
1
+ const card_error_boundary_en = {
2
+ "card_error_boundary/title": "Sorry, unexpected error :(",
3
+ "card_error_boundary/content": "Please reload, or close and reopen this application, or contact support.",
4
+ "card_error_boundary/expandederrorheader": "Error message (and see more information in the developper console):"
5
+ };
6
+ export {
7
+ card_error_boundary_en as default
8
+ };
@@ -0,0 +1,12 @@
1
+ export default card_error_boundary_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 card_error_boundary_fr: {
9
+ 'card_error_boundary/title': string;
10
+ 'card_error_boundary/content': string;
11
+ 'card_error_boundary/expandederrorheader': string;
12
+ };
@@ -0,0 +1,8 @@
1
+ const card_error_boundary_fr = {
2
+ "card_error_boundary/title": "Désolé, erreur inattendue :(",
3
+ "card_error_boundary/content": "Veuillez recharger, ou fermer et réouvrir cette application, ou contacter le support.",
4
+ "card_error_boundary/expandederrorheader": "Message d'erreur (et voir plus d'informations dans la console developpeur):"
5
+ };
6
+ export {
7
+ card_error_boundary_fr as default
8
+ };
@@ -0,0 +1,5 @@
1
+ export default common_button_en;
2
+ declare namespace common_button_en {
3
+ const cancel: string;
4
+ const validate: string;
5
+ }
@@ -0,0 +1,7 @@
1
+ const common_button_en = {
2
+ cancel: "Cancel",
3
+ validate: "Validate"
4
+ };
5
+ export {
6
+ common_button_en as default
7
+ };
@@ -0,0 +1,5 @@
1
+ export default common_button_fr;
2
+ declare namespace common_button_fr {
3
+ const cancel: string;
4
+ const validate: string;
5
+ }
@@ -0,0 +1,7 @@
1
+ const common_button_fr = {
2
+ cancel: "Annuler",
3
+ validate: "Valider"
4
+ };
5
+ export {
6
+ common_button_fr as default
7
+ };
@@ -1,12 +1,11 @@
1
+ export default element_search_en;
1
2
  /**
2
3
  * Copyright (c) 2022, RTE (http://www.rte-france.com)
3
4
  * This Source Code Form is subject to the terms of the Mozilla Public
4
5
  * License, v. 2.0. If a copy of the MPL was not distributed with this
5
6
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7
  */
7
-
8
- var element_search_en = {
9
- 'element_search/label': 'Search for an element',
10
- 'element_search/noResult': 'No result'
8
+ declare const element_search_en: {
9
+ 'element_search/label': string;
10
+ 'element_search/noResult': string;
11
11
  };
12
- export default element_search_en;
@@ -0,0 +1,7 @@
1
+ const element_search_en = {
2
+ "element_search/label": "Search for an element",
3
+ "element_search/noResult": "No result"
4
+ };
5
+ export {
6
+ element_search_en as default
7
+ };
@@ -0,0 +1,11 @@
1
+ export default element_search_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 element_search_fr: {
9
+ 'element_search/label': string;
10
+ 'element_search/noResult': string;
11
+ };
@@ -0,0 +1,7 @@
1
+ const element_search_fr = {
2
+ "element_search/label": "Rechercher un élément",
3
+ "element_search/noResult": "Aucun résultat"
4
+ };
5
+ export {
6
+ element_search_fr as default
7
+ };
@@ -0,0 +1,25 @@
1
+ export default equipment_search_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 equipment_search_en: {
9
+ 'equipment_search/label': string;
10
+ 'equipment_search/switchTag': string;
11
+ 'equipment_search/busbarSectionTag': string;
12
+ 'equipment_search/lineTag': string;
13
+ 'equipment_search/2wtTag': string;
14
+ 'equipment_search/3wtTag': string;
15
+ 'equipment_search/generatorTag': string;
16
+ 'equipment_search/batteryTag': string;
17
+ 'equipment_search/loadTag': string;
18
+ 'equipment_search/shuntTag': string;
19
+ 'equipment_search/svcTag': string;
20
+ 'equipment_search/hvdcLineTag': string;
21
+ 'equipment_search/hvdcStationTag': string;
22
+ 'equipment_search/voltageLevelTag': string;
23
+ 'equipment_search/substationTag': string;
24
+ 'equipment_search/busTag': string;
25
+ };
@@ -0,0 +1,21 @@
1
+ const equipment_search_en = {
2
+ "equipment_search/label": "Search for an equipment",
3
+ "equipment_search/switchTag": "SWITCH",
4
+ "equipment_search/busbarSectionTag": "BBS",
5
+ "equipment_search/lineTag": "LINE",
6
+ "equipment_search/2wtTag": "2W TRANSFO",
7
+ "equipment_search/3wtTag": "3W TRANSFO",
8
+ "equipment_search/generatorTag": "GENERATOR",
9
+ "equipment_search/batteryTag": "BATTERY",
10
+ "equipment_search/loadTag": "LOAD",
11
+ "equipment_search/shuntTag": "SHUNT",
12
+ "equipment_search/svcTag": "SVC",
13
+ "equipment_search/hvdcLineTag": "HVDC LINE",
14
+ "equipment_search/hvdcStationTag": "HVDC STATION",
15
+ "equipment_search/voltageLevelTag": "VOLTAGE LEVEL",
16
+ "equipment_search/substationTag": "SUBSTATION",
17
+ "equipment_search/busTag": "BUS"
18
+ };
19
+ export {
20
+ equipment_search_en as default
21
+ };
@@ -0,0 +1,25 @@
1
+ export default equipment_search_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 equipment_search_fr: {
9
+ 'equipment_search/label': string;
10
+ 'equipment_search/switchTag': string;
11
+ 'equipment_search/busbarSectionTag': string;
12
+ 'equipment_search/lineTag': string;
13
+ 'equipment_search/2wtTag': string;
14
+ 'equipment_search/3wtTag': string;
15
+ 'equipment_search/generatorTag': string;
16
+ 'equipment_search/batteryTag': string;
17
+ 'equipment_search/loadTag': string;
18
+ 'equipment_search/shuntTag': string;
19
+ 'equipment_search/svcTag': string;
20
+ 'equipment_search/hvdcLineTag': string;
21
+ 'equipment_search/hvdcStationTag': string;
22
+ 'equipment_search/voltageLevelTag': string;
23
+ 'equipment_search/substationTag': string;
24
+ 'equipment_search/busTag': string;
25
+ };
@@ -0,0 +1,21 @@
1
+ const equipment_search_fr = {
2
+ "equipment_search/label": "Rechercher un ouvrage",
3
+ "equipment_search/switchTag": "SWITCH",
4
+ "equipment_search/busbarSectionTag": "SJB",
5
+ "equipment_search/lineTag": "LIGNE",
6
+ "equipment_search/2wtTag": "TRANSFO 2E",
7
+ "equipment_search/3wtTag": "TRANSFO 3E",
8
+ "equipment_search/generatorTag": "GROUPE",
9
+ "equipment_search/batteryTag": "BATTERIE",
10
+ "equipment_search/loadTag": "CONSO",
11
+ "equipment_search/shuntTag": "MCS",
12
+ "equipment_search/svcTag": "CSPR",
13
+ "equipment_search/hvdcLineTag": "LIGNE HVDC",
14
+ "equipment_search/hvdcStationTag": "STATION HVDC",
15
+ "equipment_search/voltageLevelTag": "POSTE",
16
+ "equipment_search/substationTag": "SITE",
17
+ "equipment_search/busTag": "NOEUD"
18
+ };
19
+ export {
20
+ equipment_search_fr as default
21
+ };
@@ -1,13 +1,12 @@
1
+ export default flat_parameters_en;
1
2
  /**
2
3
  * Copyright (c) 2023, RTE (http://www.rte-france.com)
3
4
  * This Source Code Form is subject to the terms of the Mozilla Public
4
5
  * License, v. 2.0. If a copy of the MPL was not distributed with this
5
6
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7
  */
7
-
8
- var flat_parameters_en = {
9
- 'flat_parameters/none': 'None',
10
- 'flat_parameters/some': 'Some',
11
- 'flat_parameters/all': 'All'
8
+ declare const flat_parameters_en: {
9
+ 'flat_parameters/none': string;
10
+ 'flat_parameters/some': string;
11
+ 'flat_parameters/all': string;
12
12
  };
13
- export default flat_parameters_en;
@@ -0,0 +1,8 @@
1
+ const flat_parameters_en = {
2
+ "flat_parameters/none": "None",
3
+ "flat_parameters/some": "Some",
4
+ "flat_parameters/all": "All"
5
+ };
6
+ export {
7
+ flat_parameters_en as default
8
+ };
@@ -1,12 +1,12 @@
1
+ export default flat_parameters_fr;
1
2
  /**
2
3
  * Copyright (c) 2023, RTE (http://www.rte-france.com)
3
4
  * This Source Code Form is subject to the terms of the Mozilla Public
4
5
  * License, v. 2.0. If a copy of the MPL was not distributed with this
5
6
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7
  */
7
-
8
- var common_button_en = {
9
- cancel: 'Cancel',
10
- validate: 'Validate'
8
+ declare const flat_parameters_fr: {
9
+ 'flat_parameters/none': string;
10
+ 'flat_parameters/some': string;
11
+ 'flat_parameters/all': string;
11
12
  };
12
- export default common_button_en;
@@ -0,0 +1,8 @@
1
+ const flat_parameters_fr = {
2
+ "flat_parameters/none": "Aucune",
3
+ "flat_parameters/some": "Quelques-unes",
4
+ "flat_parameters/all": "Toutes"
5
+ };
6
+ export {
7
+ flat_parameters_fr as default
8
+ };
@@ -0,0 +1,18 @@
1
+ export default login_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 login_en: {
9
+ 'login/login': string;
10
+ 'login/connection': string;
11
+ 'login/unauthorizedAccess': string;
12
+ 'login/unauthorizedAccessMessage': string;
13
+ 'login/errorInUserValidation': string;
14
+ 'login/errorInUserValidationMessage': string;
15
+ 'login/errorInLogout': string;
16
+ 'login/errorInLogoutMessage': string;
17
+ 'login/logout': string;
18
+ };