@gridsuite/commons-ui 0.57.0 → 0.59.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 (299) hide show
  1. package/dist/_mocks_/svg.d.ts +4 -0
  2. package/dist/_mocks_/svg.js +8 -0
  3. package/dist/chunks/{criteria-based-filter-edition-dialog.BEXoNmzz.js → criteria-based-filter-edition-dialog.p2pUWzxc.js} +142 -158
  4. package/dist/chunks/{filter-properties.GRon8-ML.js → filter-properties.B7-q_yPf.js} +4 -4
  5. package/dist/components/AuthenticationRouter/AuthenticationRouter.d.ts +28 -9
  6. package/dist/components/AuthenticationRouter/AuthenticationRouter.js +1 -1
  7. package/dist/components/AuthenticationRouter/index.d.ts +6 -0
  8. package/dist/components/CardErrorBoundary/card-error-boundary.d.ts +27 -13
  9. package/dist/components/CardErrorBoundary/card-error-boundary.js +7 -6
  10. package/dist/components/CardErrorBoundary/index.d.ts +6 -0
  11. package/dist/components/DirectoryItemSelector/directory-item-selector.d.ts +0 -4
  12. package/dist/components/DirectoryItemSelector/directory-item-selector.js +14 -26
  13. package/dist/components/ElementSearchDialog/element-search-dialog.d.ts +18 -15
  14. package/dist/components/ElementSearchDialog/element-search-dialog.js +28 -65
  15. package/dist/components/ElementSearchDialog/equipment-item.d.ts +25 -16
  16. package/dist/components/ElementSearchDialog/equipment-item.js +9 -8
  17. package/dist/components/ElementSearchDialog/index.d.ts +6 -0
  18. package/dist/components/ElementSearchDialog/tag-renderer.d.ts +20 -10
  19. package/dist/components/ElementSearchDialog/tag-renderer.js +6 -11
  20. package/dist/components/FlatParameters/FlatParameters.d.ts +29 -9
  21. package/dist/components/FlatParameters/FlatParameters.js +3 -3
  22. package/dist/components/FlatParameters/index.d.ts +6 -0
  23. package/dist/components/Login/Login.d.ts +11 -4
  24. package/dist/components/Login/Logout.d.ts +11 -4
  25. package/dist/components/Login/index.d.ts +6 -0
  26. package/dist/components/MuiVirtualizedTable/ColumnHeader.d.ts +25 -2
  27. package/dist/components/MuiVirtualizedTable/ColumnHeader.js +68 -59
  28. package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.d.ts +72 -61
  29. package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +69 -83
  30. package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.d.ts +93 -113
  31. package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.js +84 -106
  32. package/dist/components/MuiVirtualizedTable/index.d.ts +7 -1
  33. package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.d.ts +16 -9
  34. package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.js +1 -1
  35. package/dist/components/MultipleSelectionDialog/index.d.ts +6 -0
  36. package/dist/components/OverflowableText/index.d.ts +6 -0
  37. package/dist/components/OverflowableText/overflowable-text.d.ts +11 -1
  38. package/dist/components/OverflowableText/overflowable-text.js +39 -26
  39. package/dist/components/ReportViewer/filter-button.d.ts +11 -1
  40. package/dist/components/ReportViewer/filter-button.js +5 -2
  41. package/dist/components/ReportViewer/index.d.ts +6 -0
  42. package/dist/components/ReportViewer/log-report-item.d.ts +14 -64
  43. package/dist/components/ReportViewer/log-report-item.js +13 -47
  44. package/dist/components/ReportViewer/log-report.d.ts +16 -17
  45. package/dist/components/ReportViewer/log-report.js +2 -1
  46. package/dist/components/ReportViewer/log-severity.d.ts +13 -0
  47. package/dist/components/ReportViewer/log-severity.js +35 -0
  48. package/dist/components/ReportViewer/log-table.d.ts +9 -6
  49. package/dist/components/ReportViewer/log-table.js +6 -4
  50. package/dist/components/ReportViewer/multi-select-list.d.ts +17 -1
  51. package/dist/components/ReportViewer/report-item.d.ts +12 -12
  52. package/dist/components/ReportViewer/report-item.js +0 -7
  53. package/dist/components/ReportViewer/report-tree-view-context.d.ts +11 -1
  54. package/dist/components/ReportViewer/report-viewer.d.ts +7 -4
  55. package/dist/components/ReportViewer/report-viewer.js +8 -6
  56. package/dist/components/ReportViewer/report.type.d.ts +22 -0
  57. package/dist/components/ReportViewer/report.type.js +1 -0
  58. package/dist/components/ReportViewerDialog/index.d.ts +6 -0
  59. package/dist/components/ReportViewerDialog/report-viewer-dialog.d.ts +9 -1
  60. package/dist/components/SignInCallbackHandler/SignInCallbackHandler.d.ts +7 -4
  61. package/dist/components/SignInCallbackHandler/SignInCallbackHandler.js +4 -1
  62. package/dist/components/SignInCallbackHandler/index.d.ts +6 -0
  63. package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.d.ts +7 -4
  64. package/dist/components/SilentRenewCallbackHandler/index.d.ts +6 -0
  65. package/dist/components/SnackbarProvider/SnackbarProvider.d.ts +3 -1
  66. package/dist/components/SnackbarProvider/SnackbarProvider.js +9 -7
  67. package/dist/components/SnackbarProvider/index.d.ts +6 -0
  68. package/dist/components/TopBar/AboutDialog.d.ts +30 -23
  69. package/dist/components/TopBar/AboutDialog.js +4 -22
  70. package/dist/components/TopBar/GridLogo.d.ts +13 -32
  71. package/dist/components/TopBar/GridLogo.js +12 -15
  72. package/dist/components/TopBar/TopBar.d.ts +52 -51
  73. package/dist/components/TopBar/TopBar.js +389 -380
  74. package/dist/components/TopBar/TopBar.test.d.ts +6 -0
  75. package/dist/components/TopBar/index.d.ts +6 -0
  76. package/dist/components/TreeViewFinder/TreeViewFinder.js +1 -1
  77. package/dist/components/TreeViewFinder/index.d.ts +7 -0
  78. package/dist/components/dialogs/custom-mui-dialog.d.ts +2 -1
  79. package/dist/components/dialogs/custom-mui-dialog.js +6 -4
  80. package/dist/components/dialogs/description-modification-dialog.js +2 -2
  81. package/dist/components/dialogs/modify-element-selection.d.ts +14 -0
  82. package/dist/components/dialogs/modify-element-selection.js +99 -0
  83. package/dist/components/dialogs/popup-confirmation-dialog.js +1 -1
  84. package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.d.ts +2 -3
  85. package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.js +4 -4
  86. package/dist/components/filter/criteria-based/criteria-based-filter-form.js +5 -3
  87. package/dist/components/filter/criteria-based/criteria-based-filter-utils.d.ts +12 -6
  88. package/dist/components/filter/criteria-based/criteria-based-filter-utils.js +44 -4
  89. package/dist/components/filter/criteria-based/criteria-based-form.d.ts +2 -0
  90. package/dist/components/filter/criteria-based/criteria-based-form.js +6 -6
  91. package/dist/components/filter/criteria-based/filter-free-properties.d.ts +1 -1
  92. package/dist/components/filter/criteria-based/filter-free-properties.js +5 -5
  93. package/dist/components/filter/criteria-based/filter-properties.js +3 -3
  94. package/dist/components/filter/criteria-based/filter-property.d.ts +1 -1
  95. package/dist/components/filter/criteria-based/filter-property.js +3 -3
  96. package/dist/components/filter/{constants → expert}/expert-filter-constants.d.ts +22 -1
  97. package/dist/components/filter/{constants → expert}/expert-filter-constants.js +46 -16
  98. package/dist/components/filter/expert/expert-filter-edition-dialog.d.ts +1 -7
  99. package/dist/components/filter/expert/expert-filter-edition-dialog.js +5 -7
  100. package/dist/components/filter/expert/expert-filter-form.js +5 -5
  101. package/dist/components/filter/expert/expert-filter-utils.js +1 -1
  102. package/dist/components/filter/expert/expert-filter.type.d.ts +4 -1
  103. package/dist/components/filter/expert/expert-filter.type.js +3 -0
  104. package/dist/components/filter/explicit-naming/explicit-naming-filter-edition-dialog.d.ts +0 -2
  105. package/dist/components/filter/explicit-naming/explicit-naming-filter-edition-dialog.js +4 -4
  106. package/dist/components/filter/explicit-naming/explicit-naming-filter-form.d.ts +10 -2
  107. package/dist/components/filter/explicit-naming/explicit-naming-filter-form.js +12 -8
  108. package/dist/components/filter/filter-creation-dialog.d.ts +4 -8
  109. package/dist/components/filter/filter-creation-dialog.js +3 -4
  110. package/dist/components/filter/filter-form.d.ts +4 -0
  111. package/dist/components/filter/filter-form.js +6 -5
  112. package/dist/components/filter/utils/filter-api.d.ts +5 -0
  113. package/dist/components/filter/utils/{filters-utils.js → filter-api.js} +16 -10
  114. package/dist/components/filter/utils/filter-form-utils.d.ts +17 -0
  115. package/dist/components/filter/utils/{criteria-based-utils.js → filter-form-utils.js} +16 -63
  116. package/dist/components/{react-hook-form/ag-grid-table-rhf → inputs/react-hook-form/ag-grid-table}/bottom-right-buttons.js +1 -1
  117. package/dist/components/inputs/react-hook-form/ag-grid-table/csv-uploader/csv-uploader.js +61 -0
  118. package/dist/components/{react-hook-form/ag-grid-table-rhf → inputs/react-hook-form/ag-grid-table}/custom-ag-grid-table.js +2 -2
  119. package/dist/components/{react-hook-form → inputs/react-hook-form/autocomplete-inputs}/autocomplete-input.d.ts +3 -3
  120. package/dist/components/{react-hook-form → inputs/react-hook-form/autocomplete-inputs}/autocomplete-input.js +4 -4
  121. package/dist/components/{react-hook-form → inputs/react-hook-form}/autocomplete-inputs/multiple-autocomplete-input.js +1 -1
  122. package/dist/components/inputs/react-hook-form/booleans/boolean-input.d.ts +10 -0
  123. package/dist/components/{react-hook-form → inputs/react-hook-form}/booleans/boolean-input.js +0 -7
  124. package/dist/components/inputs/react-hook-form/booleans/checkbox-input.d.ts +9 -0
  125. package/dist/components/{react-hook-form → inputs/react-hook-form}/booleans/checkbox-input.js +0 -6
  126. package/dist/components/inputs/react-hook-form/booleans/switch-input.d.ts +9 -0
  127. package/dist/components/{react-hook-form → inputs/react-hook-form}/booleans/switch-input.js +0 -6
  128. package/dist/components/{react-hook-form → inputs/react-hook-form}/directory-items-input.d.ts +0 -2
  129. package/dist/components/{react-hook-form → inputs/react-hook-form}/directory-items-input.js +11 -15
  130. package/dist/components/inputs/react-hook-form/error-management/mid-form-error.d.ts +6 -0
  131. package/dist/components/inputs/react-hook-form/numbers/integer-input.d.ts +4 -0
  132. package/dist/components/{react-hook-form → inputs/react-hook-form}/numbers/integer-input.js +1 -4
  133. package/dist/components/{react-hook-form → inputs/react-hook-form}/provider/custom-form-provider.js +1 -1
  134. package/dist/components/{react-hook-form → inputs/react-hook-form}/range-input.d.ts +1 -1
  135. package/dist/components/{react-hook-form → inputs/react-hook-form}/range-input.js +2 -2
  136. package/dist/components/{react-hook-form → inputs/react-hook-form}/select-inputs/countries-input.d.ts +1 -1
  137. package/dist/components/{react-hook-form → inputs/react-hook-form}/select-inputs/countries-input.js +14 -4
  138. package/dist/components/{react-hook-form → inputs/react-hook-form}/select-inputs/input-with-popup-confirmation.js +1 -1
  139. package/dist/components/{react-hook-form → inputs/react-hook-form}/select-inputs/select-input.d.ts +2 -2
  140. package/dist/components/{react-hook-form → inputs/react-hook-form}/select-inputs/select-input.js +4 -1
  141. package/dist/components/inputs/react-hook-form/slider-input.d.ts +8 -0
  142. package/dist/components/{react-hook-form → inputs/react-hook-form}/slider-input.js +4 -12
  143. package/dist/components/{react-hook-form → inputs/react-hook-form}/text-input.d.ts +1 -1
  144. package/dist/components/{react-hook-form → inputs/react-hook-form}/unique-name-input.d.ts +2 -2
  145. package/dist/components/{react-hook-form → inputs/react-hook-form}/unique-name-input.js +2 -2
  146. package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/text-field-with-adornment.d.ts +1 -1
  147. package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/combinator-selector.js +1 -1
  148. package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/country-value-editor.js +1 -1
  149. package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/custom-react-query-builder.js +3 -3
  150. package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/element-value-editor.js +21 -28
  151. package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/property-value-editor.js +3 -3
  152. package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/remove-button.js +2 -2
  153. package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/use-convert-value.js +1 -1
  154. package/dist/components/inputs/react-query-builder/value-editor.js +18 -0
  155. package/dist/components/inputs/select-clearable.js +1 -1
  156. package/dist/components/translations/card-error-boundary-en.d.ts +1 -1
  157. package/dist/components/translations/card-error-boundary-fr.d.ts +1 -1
  158. package/dist/components/translations/common-button-en.d.ts +10 -4
  159. package/dist/components/translations/common-button-fr.d.ts +10 -4
  160. package/dist/components/translations/directory-items-input-en.d.ts +1 -1
  161. package/dist/components/translations/directory-items-input-fr.d.ts +1 -1
  162. package/dist/components/translations/element-search-en.d.ts +1 -1
  163. package/dist/components/translations/element-search-fr.d.ts +1 -1
  164. package/dist/components/translations/equipment-search-en.d.ts +1 -1
  165. package/dist/components/translations/equipment-search-fr.d.ts +1 -1
  166. package/dist/components/translations/filter-en.d.ts +27 -21
  167. package/dist/components/translations/filter-en.js +2 -1
  168. package/dist/components/translations/filter-expert-en.d.ts +73 -0
  169. package/dist/components/translations/filter-expert-en.js +69 -0
  170. package/dist/components/translations/filter-expert-fr.d.ts +73 -0
  171. package/dist/components/translations/filter-expert-fr.js +69 -0
  172. package/dist/components/translations/filter-fr.d.ts +27 -21
  173. package/dist/components/translations/filter-fr.js +2 -1
  174. package/dist/components/translations/flat-parameters-en.d.ts +1 -1
  175. package/dist/components/translations/flat-parameters-fr.d.ts +1 -1
  176. package/dist/components/translations/inputs-en.d.ts +1 -1
  177. package/dist/components/translations/inputs-fr.d.ts +1 -1
  178. package/dist/components/translations/login-en.d.ts +1 -1
  179. package/dist/components/translations/login-fr.d.ts +1 -1
  180. package/dist/components/translations/multiple-selection-dialog-en.d.ts +1 -1
  181. package/dist/components/translations/multiple-selection-dialog-fr.d.ts +1 -1
  182. package/dist/components/translations/report-viewer-en.d.ts +1 -1
  183. package/dist/components/translations/report-viewer-fr.d.ts +1 -1
  184. package/dist/components/translations/table-en.d.ts +1 -1
  185. package/dist/components/translations/table-fr.d.ts +1 -1
  186. package/dist/components/translations/top-bar-en.d.ts +1 -1
  187. package/dist/components/translations/top-bar-fr.d.ts +1 -1
  188. package/dist/components/translations/treeview-finder-en.d.ts +1 -1
  189. package/dist/components/translations/treeview-finder-fr.d.ts +1 -1
  190. package/dist/hooks/localized-countries-hook.d.ts +10 -4
  191. package/dist/hooks/localized-countries-hook.js +1 -1
  192. package/dist/hooks/predefined-properties-hook.d.ts +1 -15
  193. package/dist/hooks/predefined-properties-hook.js +8 -16
  194. package/dist/hooks/useDebounce.d.ts +1 -1
  195. package/dist/hooks/useSnackMessage.d.ts +4 -7
  196. package/dist/hooks/useSnackMessage.js +36 -43
  197. package/dist/index.d.ts +76 -218
  198. package/dist/index.js +156 -122
  199. package/dist/redux/actions.d.ts +54 -0
  200. package/dist/redux/commonStore.d.ts +15 -0
  201. package/dist/redux/commonStore.js +11 -0
  202. package/dist/services/apps-metadata.d.ts +32 -0
  203. package/dist/services/apps-metadata.js +26 -0
  204. package/dist/services/directory.d.ts +6 -0
  205. package/dist/services/directory.js +42 -0
  206. package/dist/services/explore.d.ts +6 -0
  207. package/dist/services/explore.js +62 -0
  208. package/dist/services/index.d.ts +16 -0
  209. package/dist/services/index.js +20 -0
  210. package/dist/services/study.d.ts +3 -0
  211. package/dist/services/study.js +16 -0
  212. package/dist/services/utils.d.ts +9 -0
  213. package/dist/services/utils.js +62 -0
  214. package/dist/utils/AuthService.d.ts +20 -9
  215. package/dist/utils/AuthService.js +30 -14
  216. package/dist/utils/ElementIcon.d.ts +4 -1
  217. package/dist/utils/UserManagerMock.d.ts +14 -14
  218. package/dist/utils/UserManagerMock.js +9 -15
  219. package/dist/utils/algos.d.ts +1 -1
  220. package/dist/utils/equipment-types-for-predefined-properties-mapper.d.ts +1 -1
  221. package/dist/utils/functions.d.ts +0 -1
  222. package/dist/utils/functions.js +1 -3
  223. package/dist/utils/styles.d.ts +5 -3
  224. package/dist/utils/styles.js +4 -1
  225. package/dist/utils/types.d.ts +13 -3
  226. package/package.json +9 -7
  227. package/dist/components/filter/filter-context.d.ts +0 -12
  228. package/dist/components/filter/filter-context.js +0 -10
  229. package/dist/components/filter/utils/criteria-based-utils.d.ts +0 -28
  230. package/dist/components/filter/utils/filters-utils.d.ts +0 -5
  231. package/dist/components/react-hook-form/ag-grid-table-rhf/csv-uploader/csv-uploader.js +0 -69
  232. package/dist/components/react-hook-form/booleans/boolean-input.d.ts +0 -16
  233. package/dist/components/react-hook-form/booleans/checkbox-input.d.ts +0 -14
  234. package/dist/components/react-hook-form/booleans/switch-input.d.ts +0 -14
  235. package/dist/components/react-hook-form/error-management/mid-form-error.d.ts +0 -4
  236. package/dist/components/react-hook-form/numbers/integer-input.d.ts +0 -21
  237. package/dist/components/react-hook-form/slider-input.d.ts +0 -21
  238. package/dist/components/react-query-builder-inputs/value-editor.js +0 -18
  239. package/dist/utils/actions.d.ts +0 -50
  240. /package/dist/components/{react-hook-form → inputs/react-hook-form}/ExpandingTextField.d.ts +0 -0
  241. /package/dist/components/{react-hook-form → inputs/react-hook-form}/ExpandingTextField.js +0 -0
  242. /package/dist/components/{react-hook-form/ag-grid-table-rhf → inputs/react-hook-form/ag-grid-table}/bottom-right-buttons.d.ts +0 -0
  243. /package/dist/components/{react-hook-form/ag-grid-table-rhf → inputs/react-hook-form/ag-grid-table}/cell-editors/numericEditor.d.ts +0 -0
  244. /package/dist/components/{react-hook-form/ag-grid-table-rhf → inputs/react-hook-form/ag-grid-table}/cell-editors/numericEditor.js +0 -0
  245. /package/dist/components/{react-hook-form/ag-grid-table-rhf → inputs/react-hook-form/ag-grid-table}/csv-uploader/csv-uploader.d.ts +0 -0
  246. /package/dist/components/{react-hook-form/ag-grid-table-rhf → inputs/react-hook-form/ag-grid-table}/custom-ag-grid-table.d.ts +0 -0
  247. /package/dist/components/{react-hook-form → inputs/react-hook-form}/autocomplete-inputs/multiple-autocomplete-input.d.ts +0 -0
  248. /package/dist/components/{react-hook-form → inputs/react-hook-form}/error-management/error-input.d.ts +0 -0
  249. /package/dist/components/{react-hook-form → inputs/react-hook-form}/error-management/error-input.js +0 -0
  250. /package/dist/components/{react-hook-form → inputs/react-hook-form}/error-management/field-error-alert.d.ts +0 -0
  251. /package/dist/components/{react-hook-form → inputs/react-hook-form}/error-management/field-error-alert.js +0 -0
  252. /package/dist/components/{react-hook-form → inputs/react-hook-form}/error-management/mid-form-error.js +0 -0
  253. /package/dist/components/{react-hook-form → inputs/react-hook-form}/numbers/float-input.d.ts +0 -0
  254. /package/dist/components/{react-hook-form → inputs/react-hook-form}/numbers/float-input.js +0 -0
  255. /package/dist/components/{react-hook-form → inputs/react-hook-form}/numbers/utils.d.ts +0 -0
  256. /package/dist/components/{react-hook-form → inputs/react-hook-form}/numbers/utils.js +0 -0
  257. /package/dist/components/{react-hook-form → inputs/react-hook-form}/provider/custom-form-provider.d.ts +0 -0
  258. /package/dist/components/{react-hook-form → inputs/react-hook-form}/provider/use-custom-form-context.d.ts +0 -0
  259. /package/dist/components/{react-hook-form → inputs/react-hook-form}/provider/use-custom-form-context.js +0 -0
  260. /package/dist/components/{react-hook-form → inputs/react-hook-form}/radio-input.d.ts +0 -0
  261. /package/dist/components/{react-hook-form → inputs/react-hook-form}/radio-input.js +0 -0
  262. /package/dist/components/{react-hook-form → inputs/react-hook-form}/raw-read-only-input.d.ts +0 -0
  263. /package/dist/components/{react-hook-form → inputs/react-hook-form}/raw-read-only-input.js +0 -0
  264. /package/dist/components/{react-hook-form → inputs/react-hook-form}/select-inputs/input-with-popup-confirmation.d.ts +0 -0
  265. /package/dist/components/{react-hook-form → inputs/react-hook-form}/select-inputs/mui-select-input.d.ts +0 -0
  266. /package/dist/components/{react-hook-form → inputs/react-hook-form}/select-inputs/mui-select-input.js +0 -0
  267. /package/dist/components/{react-hook-form → inputs/react-hook-form}/text-input.js +0 -0
  268. /package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/cancel-button.d.ts +0 -0
  269. /package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/cancel-button.js +0 -0
  270. /package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/field-label.d.ts +0 -0
  271. /package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/field-label.js +0 -0
  272. /package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/functions.d.ts +0 -0
  273. /package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/functions.js +0 -0
  274. /package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/submit-button.d.ts +0 -0
  275. /package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/submit-button.js +0 -0
  276. /package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/text-field-with-adornment.js +0 -0
  277. /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/add-button.d.ts +0 -0
  278. /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/add-button.js +0 -0
  279. /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/combinator-selector.d.ts +0 -0
  280. /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/country-value-editor.d.ts +0 -0
  281. /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/custom-react-query-builder.d.ts +0 -0
  282. /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/element-value-editor.d.ts +0 -0
  283. /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/property-value-editor.d.ts +0 -0
  284. /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/remove-button.d.ts +0 -0
  285. /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/text-value-editor.d.ts +0 -0
  286. /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/text-value-editor.js +0 -0
  287. /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/translated-value-editor.d.ts +0 -0
  288. /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/translated-value-editor.js +0 -0
  289. /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/use-convert-value.d.ts +0 -0
  290. /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/use-valid.d.ts +0 -0
  291. /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/use-valid.js +0 -0
  292. /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/value-editor.d.ts +0 -0
  293. /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/value-selector.d.ts +0 -0
  294. /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/value-selector.js +0 -0
  295. /package/dist/{utils → redux}/actions.js +0 -0
  296. /package/dist/{components/filter/constants → utils}/equipment-types.d.ts +0 -0
  297. /package/dist/{components/filter/constants → utils}/equipment-types.js +0 -0
  298. /package/dist/{components/filter/constants → utils}/field-constants.d.ts +0 -0
  299. /package/dist/{components/filter/constants → utils}/field-constants.js +0 -0
@@ -1,18 +1,32 @@
1
- import { Component } from 'react';
2
- export default CardErrorBoundary;
3
- declare class CardErrorBoundary extends Component<any, any, any> {
4
- static getDerivedStateFromError(error: any): {
5
- hasError: boolean;
6
- error: any;
7
- };
8
- constructor(props: any);
9
- state: {
1
+ import { Component, ErrorInfo, ReactNode } from 'react';
2
+ import { IconButtonProps } from '@mui/material';
3
+
4
+ export interface ExpandMoreProps extends IconButtonProps {
5
+ expand: boolean;
6
+ }
7
+ interface Props {
8
+ children?: ReactNode;
9
+ }
10
+ type CardErrorBoundaryStateError = {
11
+ hasError: true;
12
+ error: Error;
13
+ };
14
+ type CardErrorBoundaryStateSuccess = {
15
+ hasError: false;
16
+ };
17
+ type CardErrorBoundaryState = (CardErrorBoundaryStateError | CardErrorBoundaryStateSuccess) & {
18
+ expanded: boolean;
19
+ };
20
+ declare class CardErrorBoundary extends Component<Props, CardErrorBoundaryState> {
21
+ state: CardErrorBoundaryState;
22
+ constructor(props: Props);
23
+ static getDerivedStateFromError(error: Error): {
10
24
  hasError: boolean;
11
- expanded: boolean;
12
- error: undefined;
25
+ error: Error;
13
26
  };
27
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
14
28
  handleExpandClick(): void;
15
29
  handleReloadClick(): void;
16
- componentDidCatch(error: any, errorInfo: any): void;
17
- render(): any;
30
+ render(): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | null | undefined;
18
31
  }
32
+ export default CardErrorBoundary;
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Component } from "react";
3
- import { styled, IconButton, Box, Card, CardHeader, CardContent, Typography, CardActions, Collapse } from "@mui/material";
4
2
  import { Replay, ExpandMore as ExpandMore$1 } from "@mui/icons-material";
3
+ import { styled, IconButton, Box, Card, CardHeader, CardContent, Typography, CardActions, Collapse } from "@mui/material";
4
+ import { Component } from "react";
5
5
  import { FormattedMessage } from "react-intl";
6
6
  const ExpandMore = styled((props) => {
7
7
  const { expand, ...other } = props;
@@ -18,8 +18,7 @@ class CardErrorBoundary extends Component {
18
18
  super(props);
19
19
  this.state = {
20
20
  hasError: false,
21
- expanded: false,
22
- error: void 0
21
+ expanded: false
23
22
  };
24
23
  this.handleExpandClick = this.handleExpandClick.bind(this);
25
24
  this.handleReloadClick = this.handleReloadClick.bind(this);
@@ -31,10 +30,12 @@ class CardErrorBoundary extends Component {
31
30
  console.error("CardErrorBoundary caught: ", error, errorInfo);
32
31
  }
33
32
  handleExpandClick() {
34
- this.setState((state) => ({ expanded: !state.expanded }));
33
+ this.setState((state) => ({
34
+ expanded: !state.expanded
35
+ }));
35
36
  }
36
37
  handleReloadClick() {
37
- this.setState((state) => ({
38
+ this.setState((_) => ({
38
39
  hasError: false,
39
40
  expanded: false,
40
41
  error: void 0
@@ -1 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2022, RTE (http://www.rte-france.com)
3
+ * This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
+ */
1
7
  export { default } from './card-error-boundary';
@@ -1,4 +1,3 @@
1
- import { ElementAttributes } from '../../utils/types.ts';
2
1
  import { UUID } from 'crypto';
3
2
  import { TreeViewFinderProps } from '../TreeViewFinder/TreeViewFinder';
4
3
  import { FunctionComponent } from 'react';
@@ -8,9 +7,6 @@ interface DirectoryItemSelectorProps extends TreeViewFinderProps {
8
7
  types: string[];
9
8
  equipmentTypes?: string[];
10
9
  itemFilter?: any;
11
- fetchDirectoryContent?: (directoryUuid: UUID, elementTypes: string[]) => Promise<ElementAttributes[]>;
12
- fetchRootFolders?: (types: string[]) => Promise<ElementAttributes[]>;
13
- fetchElementsInfos?: (ids: UUID[], elementTypes: string[], equipmentTypes: string[]) => Promise<ElementAttributes[]>;
14
10
  classes?: any;
15
11
  contentText?: string;
16
12
  defaultExpanded?: string[];
@@ -4,6 +4,8 @@ import { getFileIcon } from "../../utils/ElementIcon.js";
4
4
  import { ElementType } from "../../utils/ElementType.js";
5
5
  import TreeViewFinder from "../TreeViewFinder/TreeViewFinder.js";
6
6
  import { useSnackMessage } from "../../hooks/useSnackMessage.js";
7
+ import { fetchElementsInfos } from "../../services/explore.js";
8
+ import { fetchRootFolders, fetchDirectoryContent } from "../../services/directory.js";
7
9
  const styles = {
8
10
  icon: (theme) => ({
9
11
  marginRight: theme.spacing(1),
@@ -16,9 +18,6 @@ const DirectoryItemSelector = ({
16
18
  types,
17
19
  equipmentTypes,
18
20
  itemFilter,
19
- fetchDirectoryContent,
20
- fetchRootFolders,
21
- fetchElementsInfos,
22
21
  expanded,
23
22
  ...otherTreeViewFinderProps
24
23
  }) => {
@@ -77,7 +76,7 @@ const DirectoryItemSelector = ({
77
76
  [convertRoots]
78
77
  );
79
78
  const updateRootDirectories = useCallback(() => {
80
- fetchRootFolders && fetchRootFolders(types).then((data2) => {
79
+ fetchRootFolders(types).then((data2) => {
81
80
  let [nrs, mdr] = updatedTree(
82
81
  rootsRef.current,
83
82
  nodeMap.current,
@@ -93,29 +92,26 @@ const DirectoryItemSelector = ({
93
92
  headerId: "DirectoryItemSelector"
94
93
  });
95
94
  });
96
- }, [convertRoots, types, snackError, fetchRootFolders]);
95
+ }, [convertRoots, types, snackError]);
97
96
  const fetchDirectory = useCallback(
98
97
  (nodeId) => {
99
- fetchDirectoryContent && fetchDirectoryContent(nodeId, types).then((children) => {
98
+ const typeList = types.includes(ElementType.DIRECTORY) ? [] : types;
99
+ fetchDirectoryContent(nodeId, typeList).then((children) => {
100
100
  const childrenMatchedTypes = children.filter(
101
101
  (item) => contentFilter().has(item.type)
102
102
  );
103
103
  if (childrenMatchedTypes.length > 0 && equipmentTypes && equipmentTypes.length > 0) {
104
- fetchElementsInfos && fetchElementsInfos(
105
- childrenMatchedTypes.map(
106
- (e) => e.elementUuid
107
- ),
104
+ fetchElementsInfos(
105
+ childrenMatchedTypes.map((e) => e.elementUuid),
108
106
  types,
109
107
  equipmentTypes
110
108
  ).then((childrenWithMetadata) => {
111
- const children2 = itemFilter ? childrenWithMetadata.filter(
112
- (val) => {
113
- if (val.type === ElementType.DIRECTORY) {
114
- return true;
115
- }
116
- return itemFilter(val);
109
+ const children2 = itemFilter ? childrenWithMetadata.filter((val) => {
110
+ if (val.type === ElementType.DIRECTORY) {
111
+ return true;
117
112
  }
118
- ) : childrenWithMetadata;
113
+ return itemFilter(val);
114
+ }) : childrenWithMetadata;
119
115
  addToDirectory(nodeId, children2);
120
116
  });
121
117
  } else {
@@ -127,15 +123,7 @@ const DirectoryItemSelector = ({
127
123
  );
128
124
  });
129
125
  },
130
- [
131
- types,
132
- equipmentTypes,
133
- itemFilter,
134
- contentFilter,
135
- addToDirectory,
136
- fetchDirectoryContent,
137
- fetchElementsInfos
138
- ]
126
+ [types, equipmentTypes, itemFilter, contentFilter, addToDirectory]
139
127
  );
140
128
  useEffect(() => {
141
129
  if (open) {
@@ -1,16 +1,19 @@
1
- import { default as PropTypes } from 'prop-types';
2
- export default ElementSearchDialog;
3
- declare function ElementSearchDialog(props: any): import("react/jsx-runtime").JSX.Element;
4
- declare namespace ElementSearchDialog {
5
- namespace propTypes {
6
- let open: PropTypes.Validator<boolean>;
7
- let onClose: PropTypes.Validator<(...args: any[]) => any>;
8
- let searchingLabel: PropTypes.Requireable<string>;
9
- let onSearchTermChange: PropTypes.Validator<(...args: any[]) => any>;
10
- let onSelectionChange: PropTypes.Validator<(...args: any[]) => any>;
11
- let elementsFound: PropTypes.Validator<any[]>;
12
- let renderElement: PropTypes.Validator<(...args: any[]) => any>;
13
- let searchTermDisabled: PropTypes.Requireable<boolean>;
14
- let searchTermDisableReason: PropTypes.Requireable<string>;
15
- }
1
+ import { EquipmentInfos } from '../../index';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface ElementSearchDialogProps {
5
+ open: boolean;
6
+ onClose: () => void;
7
+ searchingLabel?: string;
8
+ searchTerm: string;
9
+ onSearchTermChange: (searchTerm: string) => void;
10
+ onSelectionChange: (selection: EquipmentInfos) => void;
11
+ elementsFound: EquipmentInfos[];
12
+ renderElement: (props: any) => ReactNode;
13
+ searchTermDisabled?: boolean;
14
+ searchTermDisableReason?: string;
15
+ isLoading: boolean;
16
+ loadingText?: string;
16
17
  }
18
+ declare const ElementSearchDialog: (props: ElementSearchDialogProps) => import("react/jsx-runtime").JSX.Element;
19
+ export default ElementSearchDialog;
@@ -1,7 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { useState, useEffect, useCallback } from "react";
2
+ import { useMemo, useCallback } from "react";
3
3
  import { Dialog, DialogContent, Autocomplete, TextField } from "@mui/material";
4
- import PropTypes from "prop-types";
5
4
  import { SearchOff, Search } from "@mui/icons-material";
6
5
  import { useIntl } from "react-intl";
7
6
  const ElementSearchDialog = (props) => {
@@ -10,48 +9,23 @@ const ElementSearchDialog = (props) => {
10
9
  open,
11
10
  onClose,
12
11
  searchingLabel,
12
+ searchTerm,
13
13
  onSearchTermChange,
14
14
  onSelectionChange,
15
15
  elementsFound,
16
- // [{ label: aLabel, id: anId }, ...]
17
16
  renderElement,
18
17
  searchTermDisabled,
19
- searchTermDisableReason
18
+ searchTermDisableReason,
19
+ isLoading,
20
+ loadingText
20
21
  } = props;
21
- const [expanded, setExpanded] = useState(false);
22
- const [value, setValue] = useState(
23
- searchTermDisabled && searchTermDisableReason ? { label: searchTermDisableReason } : null
24
- );
25
- const [loading, setLoading] = useState(false);
26
- useEffect(() => {
27
- setLoading(false);
28
- }, [elementsFound]);
29
- useEffect(() => {
30
- if (!searchTermDisabled || !searchTermDisableReason) {
31
- setValue(null);
32
- } else {
33
- setValue({ label: searchTermDisableReason });
34
- }
35
- }, [searchTermDisabled, searchTermDisableReason]);
36
- useEffect(() => {
37
- setValue((old) => !open ? null : old);
38
- }, [open]);
39
- const handleSearchTermChange = (term) => {
40
- if (term) {
41
- setLoading(true);
42
- onSearchTermChange(term);
43
- setExpanded(true);
44
- setValue({ label: term });
45
- } else {
46
- setExpanded(false);
47
- setValue(null);
48
- }
49
- };
22
+ const displayedValue = useMemo(() => {
23
+ return searchTermDisabled || searchTermDisableReason ? searchTermDisableReason : searchTerm;
24
+ }, [searchTerm, searchTermDisabled, searchTermDisableReason]);
50
25
  const handleClose = useCallback(() => {
51
- setValue(null);
52
- setExpanded(false);
26
+ onSearchTermChange("");
53
27
  onClose();
54
- }, [onClose]);
28
+ }, [onSearchTermChange, onClose]);
55
29
  return /* @__PURE__ */ jsx(
56
30
  Dialog,
57
31
  {
@@ -63,32 +37,32 @@ const ElementSearchDialog = (props) => {
63
37
  children: /* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(
64
38
  Autocomplete,
65
39
  {
40
+ open: isLoading || (elementsFound == null ? void 0 : elementsFound.length) > 0,
66
41
  id: "element-search",
67
42
  forcePopupIcon: false,
68
- open: expanded,
69
- onClose: () => {
70
- setExpanded(false);
71
- },
72
43
  fullWidth: true,
73
44
  freeSolo: true,
74
- clearOnBlur: true,
75
- onInputChange: (_event, value2) => {
76
- if (!searchTermDisabled) {
77
- handleSearchTermChange(value2);
45
+ onInputChange: (_event, value, reason) => {
46
+ if (!searchTermDisabled && reason !== "reset") {
47
+ onSearchTermChange(value);
78
48
  }
79
49
  },
80
50
  onChange: (_event, newValue, reason) => {
81
- if (reason === "selectOption") {
51
+ if (newValue != null && typeof newValue !== "string" && reason === "selectOption") {
82
52
  onSelectionChange(newValue);
83
- setValue(newValue);
53
+ }
54
+ },
55
+ getOptionLabel: (option) => typeof option === "string" ? option : option.label,
56
+ isOptionEqualToValue: (option, value) => {
57
+ if (typeof option === "string" || typeof value === "string") {
58
+ return option === value;
84
59
  } else {
85
- setValue(null);
60
+ return option.id === value.id;
86
61
  }
87
62
  },
88
- getOptionLabel: (option) => option.label,
89
- isOptionEqualToValue: (option, value2) => option.id === value2.id,
90
- options: loading ? [] : elementsFound,
91
- loading,
63
+ options: isLoading ? [] : elementsFound,
64
+ loading: isLoading,
65
+ loadingText,
92
66
  autoHighlight: true,
93
67
  noOptionsText: intl.formatMessage({
94
68
  id: "element_search/noResult"
@@ -104,7 +78,7 @@ const ElementSearchDialog = (props) => {
104
78
  {
105
79
  autoFocus: true,
106
80
  ...params,
107
- label: searchingLabel || intl.formatMessage({
81
+ label: searchingLabel ?? intl.formatMessage({
108
82
  id: "element_search/label"
109
83
  }),
110
84
  InputProps: {
@@ -113,27 +87,16 @@ const ElementSearchDialog = (props) => {
113
87
  searchTermDisabled ? /* @__PURE__ */ jsx(SearchOff, { color: "disabled" }) : /* @__PURE__ */ jsx(Search, { color: "disabled" }),
114
88
  params.InputProps.startAdornment
115
89
  ] })
116
- }
90
+ },
91
+ value: displayedValue ?? ""
117
92
  }
118
93
  ),
119
- value,
120
94
  disabled: searchTermDisabled
121
95
  }
122
96
  ) })
123
97
  }
124
98
  );
125
99
  };
126
- ElementSearchDialog.propTypes = {
127
- open: PropTypes.bool.isRequired,
128
- onClose: PropTypes.func.isRequired,
129
- searchingLabel: PropTypes.string,
130
- onSearchTermChange: PropTypes.func.isRequired,
131
- onSelectionChange: PropTypes.func.isRequired,
132
- elementsFound: PropTypes.array.isRequired,
133
- renderElement: PropTypes.func.isRequired,
134
- searchTermDisabled: PropTypes.bool,
135
- searchTermDisableReason: PropTypes.string
136
- };
137
100
  export {
138
101
  ElementSearchDialog as default
139
102
  };
@@ -1,16 +1,25 @@
1
- export function EquipmentItem({ inputValue, suffixRenderer, element, showsJustText, ...props }: {
2
- [x: string]: any;
3
- inputValue: any;
4
- suffixRenderer?: {
5
- ({ props, element }: {
6
- props: any;
7
- element: any;
8
- }): import("react/jsx-runtime").JSX.Element;
9
- propTypes: {
10
- element: import('prop-types').Requireable<object>;
11
- props: import('prop-types').Requireable<object>;
12
- };
13
- } | undefined;
14
- element: any;
15
- showsJustText?: boolean | undefined;
16
- }): import("react/jsx-runtime").JSX.Element;
1
+ import { SxProps } from '@mui/material';
2
+ import { EquipmentInfos } from '../../utils/EquipmentType';
3
+ import { TagRenderer } from './index';
4
+
5
+ export interface EquipmentItemProps {
6
+ inputValue: string;
7
+ suffixRenderer: typeof TagRenderer;
8
+ element: EquipmentInfos;
9
+ showsJustText: boolean;
10
+ classes?: {
11
+ result?: string;
12
+ equipmentOption?: string;
13
+ equipmentTag?: string;
14
+ equipmentTypeTag?: string;
15
+ equipmentVlTag?: string;
16
+ };
17
+ styles?: {
18
+ result?: SxProps;
19
+ equipmentOption?: SxProps;
20
+ equipmentTag?: SxProps;
21
+ equipmentTypeTag?: SxProps;
22
+ equipmentVlTag?: SxProps;
23
+ };
24
+ }
25
+ export declare const EquipmentItem: ({ inputValue, suffixRenderer, element, showsJustText, ...props }: EquipmentItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,13 +1,14 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import "./element-search-dialog.js";
2
+ import "react";
3
+ import { Box } from "@mui/material";
4
+ import "@mui/icons-material";
5
+ import { FormattedMessage } from "react-intl";
3
6
  import { TagRenderer } from "./tag-renderer.js";
4
7
  import match from "autosuggest-highlight/match";
5
8
  import parse from "autosuggest-highlight/parse";
6
9
  import clsx from "clsx";
7
- import { FormattedMessage } from "react-intl";
8
- import { OverflowableText } from "../OverflowableText/overflowable-text.js";
9
10
  import { EQUIPMENT_TYPE } from "../../utils/EquipmentType.js";
10
- import { Box } from "@mui/material";
11
+ import { OverflowableText } from "../OverflowableText/overflowable-text.js";
11
12
  import { mergeSx } from "../../utils/styles.js";
12
13
  const EquipmentItem = ({
13
14
  inputValue,
@@ -16,7 +17,7 @@ const EquipmentItem = ({
16
17
  showsJustText = false,
17
18
  ...props
18
19
  }) => {
19
- var _a, _b, _c, _d, _e, _f, _g, _h;
20
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
20
21
  let matches = match(element.label, inputValue, {
21
22
  insideWords: true,
22
23
  findAllOccurrences: true
@@ -43,7 +44,7 @@ const EquipmentItem = ({
43
44
  children: /* @__PURE__ */ jsx(
44
45
  FormattedMessage,
45
46
  {
46
- id: EQUIPMENT_TYPE[element.type].tagLabel
47
+ id: (_g = EQUIPMENT_TYPE[element.type]) == null ? void 0 : _g.tagLabel
47
48
  }
48
49
  )
49
50
  }
@@ -52,8 +53,8 @@ const EquipmentItem = ({
52
53
  OverflowableText,
53
54
  {
54
55
  text: parts.map((e) => e.text).join(),
55
- className: (_g = props.classes) == null ? void 0 : _g.result,
56
- sx: (_h = props.styles) == null ? void 0 : _h.result,
56
+ className: (_h = props.classes) == null ? void 0 : _h.result,
57
+ sx: (_i = props.styles) == null ? void 0 : _i.result,
57
58
  children: parts.map((part, index) => /* @__PURE__ */ jsx(
58
59
  "span",
59
60
  {
@@ -1,2 +1,8 @@
1
+ /**
2
+ * Copyright (c) 2021, RTE (http://www.rte-france.com)
3
+ * This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
+ */
1
7
  export { default } from './element-search-dialog';
2
8
  export { TagRenderer } from './tag-renderer';
@@ -1,11 +1,21 @@
1
- import { default as PropTypes } from 'prop-types';
2
- export function TagRenderer({ props, element }: {
3
- props: any;
4
- element: any;
5
- }): import("react/jsx-runtime").JSX.Element;
6
- export namespace TagRenderer {
7
- namespace propTypes {
8
- let element: PropTypes.Requireable<object>;
9
- let props: PropTypes.Requireable<object>;
10
- }
1
+ import { SxProps } from '@mui/material';
2
+ import { EquipmentType } from '../../utils/EquipmentType';
3
+
4
+ interface TagRendererProps {
5
+ props: {
6
+ classes?: {
7
+ equipmentTag?: string;
8
+ equipmentVlTag?: string;
9
+ };
10
+ styles?: {
11
+ equipmentTag?: SxProps;
12
+ equipmentVlTag?: SxProps;
13
+ };
14
+ };
15
+ element: {
16
+ type: EquipmentType;
17
+ voltageLevelLabel?: string;
18
+ };
11
19
  }
20
+ export declare const TagRenderer: ({ props, element }: TagRendererProps) => import("react/jsx-runtime").JSX.Element;
21
+ export {};
@@ -2,32 +2,27 @@ import { jsx, Fragment } from "react/jsx-runtime";
2
2
  import { OverflowableText } from "../OverflowableText/overflowable-text.js";
3
3
  import clsx from "clsx";
4
4
  import { EQUIPMENT_TYPE } from "../../utils/EquipmentType.js";
5
- import PropTypes from "prop-types";
6
5
  import { mergeSx } from "../../utils/styles.js";
7
6
  const TagRenderer = ({ props, element }) => {
8
- var _a, _b, _c, _d;
9
- if (element.type !== EQUIPMENT_TYPE.SUBSTATION.name && element.type !== EQUIPMENT_TYPE.VOLTAGE_LEVEL.name) {
7
+ var _a, _b, _c, _d, _e, _f;
8
+ if (element.type !== ((_a = EQUIPMENT_TYPE.SUBSTATION) == null ? void 0 : _a.name) && element.type !== ((_b = EQUIPMENT_TYPE.VOLTAGE_LEVEL) == null ? void 0 : _b.name)) {
10
9
  return /* @__PURE__ */ jsx(
11
10
  OverflowableText,
12
11
  {
13
12
  text: element.voltageLevelLabel,
14
13
  className: clsx(
15
- (_a = props.classes) == null ? void 0 : _a.equipmentTag,
16
- (_b = props.classes) == null ? void 0 : _b.equipmentVlTag
14
+ (_c = props.classes) == null ? void 0 : _c.equipmentTag,
15
+ (_d = props.classes) == null ? void 0 : _d.equipmentVlTag
17
16
  ),
18
17
  sx: mergeSx(
19
- (_c = props.styles) == null ? void 0 : _c.equipmentTag,
20
- (_d = props.styles) == null ? void 0 : _d.equipmentVlTag
18
+ (_e = props.styles) == null ? void 0 : _e.equipmentTag,
19
+ (_f = props.styles) == null ? void 0 : _f.equipmentVlTag
21
20
  )
22
21
  }
23
22
  );
24
23
  }
25
24
  return /* @__PURE__ */ jsx(Fragment, {});
26
25
  };
27
- TagRenderer.propTypes = {
28
- element: PropTypes.object,
29
- props: PropTypes.object
30
- };
31
26
  export {
32
27
  TagRenderer
33
28
  };
@@ -1,10 +1,30 @@
1
- export function extractDefault(paramDescription: any): any;
2
- export function FlatParameters({ paramsAsArray, initValues, onChange, variant, showSeparator, selectionWithDialog, }: {
3
- paramsAsArray: any;
4
- initValues: any;
5
- onChange: any;
6
- variant?: string | undefined;
7
- showSeparator?: boolean | undefined;
8
- selectionWithDialog?: ((param: any) => boolean) | undefined;
9
- }): import("react/jsx-runtime").JSX.Element;
1
+ import { TextFieldProps } from '@mui/material';
2
+
3
+ export declare function extractDefault(paramDescription: any): any;
4
+ export type Parameter = {
5
+ type: 'BOOLEAN' | 'DOUBLE' | 'INTEGER' | 'STRING_LIST' | 'STRING';
6
+ description?: string;
7
+ name: string;
8
+ possibleValues: any;
9
+ defaultValue: any;
10
+ };
11
+ export interface FlatParametersProps {
12
+ paramsAsArray: Parameter[];
13
+ initValues: Record<string, string>;
14
+ onChange: (paramName: string, value: unknown, isInEdition: boolean) => void;
15
+ variant: TextFieldProps['variant'];
16
+ showSeparator?: boolean;
17
+ selectionWithDialog?: (param: Parameter) => boolean;
18
+ }
19
+ /**
20
+ * Present a "list" of independently editable parameters according to
21
+ * their description, as given by paramsAsArray, with current values as in initValues.
22
+ * @param paramsAsArray [{type,name,possibleValues,defaultValue}]
23
+ * @param initValues {k:v}
24
+ * @param onChange (paramName, newValue, isInEdition)
25
+ * @param variant style variant for TextField, Autocomplete and Select parameter fields
26
+ * @param showSeparator if true, a separator is added between parameters
27
+ * @param selectionWithDialog {(param: {}) => boolean} if true, param with multiple options use dialog for selection
28
+ */
29
+ export declare const FlatParameters: ({ paramsAsArray, initValues, onChange, variant, showSeparator, selectionWithDialog, }: FlatParametersProps) => import("react/jsx-runtime").JSX.Element;
10
30
  export default FlatParameters;
@@ -42,10 +42,10 @@ function extractDefault(paramDescription) {
42
42
  return d;
43
43
  }
44
44
  const mo = ListRE.exec(d);
45
- if ((mo == null ? void 0 : mo.length) > 1) {
46
- return mo[1].split(sepRE).map((s) => s.trim()).filter((s) => !!s);
45
+ if (mo === null || mo.length <= 1) {
46
+ return [];
47
47
  }
48
- return [];
48
+ return mo[1].split(sepRE).map((s) => s.trim()).filter((s) => !!s);
49
49
  }
50
50
  return d ?? null;
51
51
  }
@@ -1 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2023, RTE (http://www.rte-france.com)
3
+ * This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
+ */
1
7
  export { default } from './FlatParameters';
@@ -1,5 +1,12 @@
1
+ /**
2
+ * Copyright (c) 2020, RTE (http://www.rte-france.com)
3
+ * This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
+ */
7
+ export interface LoginProps {
8
+ onLoginClick: () => void;
9
+ disabled: boolean;
10
+ }
11
+ declare const Login: ({ onLoginClick, disabled }: LoginProps) => import("react/jsx-runtime").JSX.Element;
1
12
  export default Login;
2
- declare function Login({ onLoginClick, disabled }: {
3
- onLoginClick: any;
4
- disabled: any;
5
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,12 @@
1
+ /**
2
+ * Copyright (c) 2020, RTE (http://www.rte-france.com)
3
+ * This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
+ */
7
+ export interface LogoutProps {
8
+ onLogoutClick: () => void;
9
+ disabled: boolean;
10
+ }
11
+ declare const Logout: ({ onLogoutClick, disabled }: LogoutProps) => import("react/jsx-runtime").JSX.Element;
1
12
  export default Logout;
2
- declare function Logout({ onLogoutClick, disabled }: {
3
- onLogoutClick: any;
4
- disabled: any;
5
- }): import("react/jsx-runtime").JSX.Element;