@gridsuite/commons-ui 0.63.4 → 0.64.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 (131) hide show
  1. package/dist/_mocks_/svg.js +1 -3
  2. package/dist/assets/expert-filter-form.css +18 -8
  3. package/dist/components/AuthenticationRouter/AuthenticationRouter.js +88 -97
  4. package/dist/components/CardErrorBoundary/card-error-boundary.js +6 -20
  5. package/dist/components/CustomAGGrid/custom-aggrid.js +47 -49
  6. package/dist/components/DirectoryItemSelector/directory-item-selector.js +10 -40
  7. package/dist/components/ElementSearchDialog/element-search-dialog.js +1 -17
  8. package/dist/components/ElementSearchDialog/equipment-item.js +29 -47
  9. package/dist/components/ElementSearchDialog/tag-renderer.js +2 -8
  10. package/dist/components/ElementSearchDialog/use-element-search.js +1 -4
  11. package/dist/components/FlatParameters/FlatParameters.js +13 -77
  12. package/dist/components/Login/Login.js +9 -34
  13. package/dist/components/Login/Logout.js +3 -26
  14. package/dist/components/MuiVirtualizedTable/ColumnHeader.js +35 -64
  15. package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +4 -17
  16. package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.d.ts +1 -1
  17. package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.js +19 -95
  18. package/dist/components/MuiVirtualizedTable/index.d.ts +1 -1
  19. package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.js +2 -6
  20. package/dist/components/OverflowableText/overflowable-text.js +3 -10
  21. package/dist/components/ReportViewer/filter-button.d.ts +1 -1
  22. package/dist/components/ReportViewer/filter-button.js +2 -7
  23. package/dist/components/ReportViewer/log-report-item.js +7 -17
  24. package/dist/components/ReportViewer/log-report.js +4 -13
  25. package/dist/components/ReportViewer/log-table.d.ts +1 -1
  26. package/dist/components/ReportViewer/log-table.js +3 -16
  27. package/dist/components/ReportViewer/multi-select-list.d.ts +1 -1
  28. package/dist/components/ReportViewer/multi-select-list.js +2 -14
  29. package/dist/components/ReportViewer/report-item.js +4 -10
  30. package/dist/components/ReportViewer/report-viewer.d.ts +1 -1
  31. package/dist/components/ReportViewer/report-viewer.js +2 -7
  32. package/dist/components/ReportViewerDialog/report-viewer-dialog.js +1 -13
  33. package/dist/components/SignInCallbackHandler/SignInCallbackHandler.d.ts +1 -1
  34. package/dist/components/SignInCallbackHandler/SignInCallbackHandler.js +1 -4
  35. package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.d.ts +1 -1
  36. package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.js +1 -4
  37. package/dist/components/SnackbarProvider/SnackbarProvider.js +4 -11
  38. package/dist/components/TopBar/AboutDialog.js +51 -152
  39. package/dist/components/TopBar/GridLogo.d.ts +2 -2
  40. package/dist/components/TopBar/GridLogo.js +8 -41
  41. package/dist/components/TopBar/TopBar.js +197 -328
  42. package/dist/components/TreeViewFinder/TreeViewFinder.js +23 -66
  43. package/dist/components/TreeViewFinder/index.d.ts +2 -2
  44. package/dist/components/dialogs/custom-mui-dialog.d.ts +2 -1
  45. package/dist/components/dialogs/custom-mui-dialog.js +64 -39
  46. package/dist/components/dialogs/modify-element-selection.js +1 -3
  47. package/dist/components/dialogs/popup-confirmation-dialog.d.ts +1 -1
  48. package/dist/components/dialogs/popup-confirmation-dialog.js +8 -15
  49. package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.js +3 -18
  50. package/dist/components/filter/criteria-based/criteria-based-filter-utils.js +3 -9
  51. package/dist/components/filter/criteria-based/criteria-based-form.d.ts +1 -1
  52. package/dist/components/filter/criteria-based/criteria-based-form.js +7 -15
  53. package/dist/components/filter/criteria-based/filter-free-properties.d.ts +1 -1
  54. package/dist/components/filter/criteria-based/filter-free-properties.js +1 -4
  55. package/dist/components/filter/criteria-based/filter-properties.js +16 -24
  56. package/dist/components/filter/criteria-based/filter-property.js +1 -4
  57. package/dist/components/filter/expert/expert-filter-constants.d.ts +10 -3
  58. package/dist/components/filter/expert/expert-filter-constants.js +16 -12
  59. package/dist/components/filter/expert/expert-filter-edition-dialog.js +3 -18
  60. package/dist/components/filter/expert/expert-filter-form.js +1 -7
  61. package/dist/components/filter/expert/expert-filter-utils.js +10 -30
  62. package/dist/components/filter/expert/expert-filter.type.d.ts +3 -1
  63. package/dist/components/filter/expert/expert-filter.type.js +2 -0
  64. package/dist/components/filter/explicit-naming/explicit-naming-filter-edition-dialog.js +2 -15
  65. package/dist/components/filter/explicit-naming/explicit-naming-filter-form.d.ts +1 -1
  66. package/dist/components/filter/explicit-naming/explicit-naming-filter-form.js +10 -35
  67. package/dist/components/filter/filter-creation-dialog.js +5 -10
  68. package/dist/components/filter/filter-form.js +3 -17
  69. package/dist/components/filter/utils/filter-api.js +1 -7
  70. package/dist/components/inputs/react-hook-form/ExpandingTextField.js +1 -9
  71. package/dist/components/inputs/react-hook-form/ag-grid-table/bottom-right-buttons.js +14 -52
  72. package/dist/components/inputs/react-hook-form/ag-grid-table/csv-uploader/csv-uploader.js +14 -62
  73. package/dist/components/inputs/react-hook-form/ag-grid-table/custom-ag-grid-table.js +29 -40
  74. package/dist/components/inputs/react-hook-form/autocomplete-inputs/autocomplete-input.js +2 -8
  75. package/dist/components/inputs/react-hook-form/autocomplete-inputs/multiple-autocomplete-input.js +1 -3
  76. package/dist/components/inputs/react-hook-form/booleans/boolean-input.js +1 -7
  77. package/dist/components/inputs/react-hook-form/booleans/checkbox-input.js +1 -9
  78. package/dist/components/inputs/react-hook-form/booleans/switch-input.js +1 -9
  79. package/dist/components/inputs/react-hook-form/description-field.d.ts +8 -0
  80. package/dist/components/inputs/react-hook-form/description-field.js +48 -0
  81. package/dist/components/inputs/react-hook-form/directory-items-input.js +5 -29
  82. package/dist/components/inputs/react-hook-form/error-management/error-input.d.ts +1 -1
  83. package/dist/components/inputs/react-hook-form/provider/custom-form-provider.js +1 -7
  84. package/dist/components/inputs/react-hook-form/radio-input.js +8 -18
  85. package/dist/components/inputs/react-hook-form/range-input.js +1 -4
  86. package/dist/components/inputs/react-hook-form/select-inputs/countries-input.js +1 -9
  87. package/dist/components/inputs/react-hook-form/select-inputs/mui-select-input.js +2 -13
  88. package/dist/components/inputs/react-hook-form/select-inputs/select-input.js +2 -6
  89. package/dist/components/inputs/react-hook-form/slider-input.d.ts +1 -1
  90. package/dist/components/inputs/react-hook-form/slider-input.js +2 -19
  91. package/dist/components/inputs/react-hook-form/unique-name-input.js +1 -9
  92. package/dist/components/inputs/react-hook-form/utils/field-label.d.ts +1 -1
  93. package/dist/components/inputs/react-hook-form/utils/field-label.js +1 -5
  94. package/dist/components/inputs/react-hook-form/utils/submit-button.js +1 -8
  95. package/dist/components/inputs/react-hook-form/utils/text-field-with-adornment.js +18 -47
  96. package/dist/components/inputs/react-query-builder/add-button.js +1 -10
  97. package/dist/components/inputs/react-query-builder/autocomplete-with-favorites.d.ts +12 -0
  98. package/dist/components/inputs/react-query-builder/autocomplete-with-favorites.js +43 -0
  99. package/dist/components/inputs/react-query-builder/composite-rule-editor/group-value-editor.js +14 -27
  100. package/dist/components/inputs/react-query-builder/composite-rule-editor/rule-value-editor.js +1 -3
  101. package/dist/components/inputs/react-query-builder/country-value-editor.js +27 -28
  102. package/dist/components/inputs/react-query-builder/custom-react-query-builder.js +25 -31
  103. package/dist/components/inputs/react-query-builder/element-value-editor.js +1 -10
  104. package/dist/components/inputs/react-query-builder/property-value-editor.js +6 -11
  105. package/dist/components/inputs/react-query-builder/remove-button.js +1 -9
  106. package/dist/components/inputs/react-query-builder/text-value-editor.js +2 -1
  107. package/dist/components/inputs/react-query-builder/translated-value-editor.js +3 -4
  108. package/dist/components/inputs/react-query-builder/use-convert-value.d.ts +1 -1
  109. package/dist/components/inputs/react-query-builder/use-convert-value.js +1 -6
  110. package/dist/components/inputs/react-query-builder/value-editor.js +4 -20
  111. package/dist/components/translations/filter-expert-en.d.ts +2 -0
  112. package/dist/components/translations/filter-expert-en.js +3 -1
  113. package/dist/components/translations/filter-expert-fr.d.ts +2 -0
  114. package/dist/components/translations/filter-expert-fr.js +3 -1
  115. package/dist/hooks/localized-countries-hook.js +1 -3
  116. package/dist/hooks/useConfidentialityWarning.d.ts +8 -0
  117. package/dist/hooks/useConfidentialityWarning.js +14 -0
  118. package/dist/hooks/useDebounce.js +1 -4
  119. package/dist/hooks/useSnackMessage.js +3 -12
  120. package/dist/index.d.ts +11 -9
  121. package/dist/index.js +157 -151
  122. package/dist/services/apps-metadata.d.ts +7 -0
  123. package/dist/services/apps-metadata.js +13 -0
  124. package/dist/services/directory.js +3 -11
  125. package/dist/services/explore.js +2 -8
  126. package/dist/services/index.js +3 -1
  127. package/dist/services/utils.js +4 -12
  128. package/dist/utils/AuthService.js +8 -29
  129. package/dist/utils/UserManagerMock.js +6 -23
  130. package/dist/utils/styles.js +1 -6
  131. package/package.json +1 -1
@@ -1,8 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- const SvgrMock = forwardRef(
4
- (props, ref) => /* @__PURE__ */ jsx("svg", { ref, ...props })
5
- );
3
+ const SvgrMock = forwardRef((props, ref) => /* @__PURE__ */ jsx("svg", { ref, ...props }));
6
4
  export {
7
5
  SvgrMock as default
8
6
  };
@@ -58,10 +58,11 @@
58
58
  position: relative;
59
59
  }
60
60
 
61
- .queryBuilder-branches .rule::before, .queryBuilder-branches .rule::after,
61
+ .queryBuilder-branches .rule::before,
62
+ .queryBuilder-branches .rule::after,
62
63
  .queryBuilder-branches .ruleGroup .ruleGroup::before,
63
64
  .queryBuilder-branches .ruleGroup .ruleGroup::after {
64
- content: "";
65
+ content: '';
65
66
  width: 0.5rem;
66
67
  left: calc(-0.5rem - 1px);
67
68
  border-color: #969696;
@@ -94,7 +95,8 @@
94
95
  display: none;
95
96
  }
96
97
 
97
- .queryBuilder-branches .ruleGroup .ruleGroup::before, .queryBuilder-branches .ruleGroup .ruleGroup::after {
98
+ .queryBuilder-branches .ruleGroup .ruleGroup::before,
99
+ .queryBuilder-branches .ruleGroup .ruleGroup::after {
98
100
  left: calc(calc(-0.5rem - 1px) - 1px);
99
101
  }
100
102
 
@@ -133,25 +135,33 @@
133
135
  }
134
136
 
135
137
  /* DnD section, copied from original, just 'border-bottom-color: lightgrey' change */
136
- [data-inlinecombinators=disabled] .dndOver.rule, [data-inlinecombinators=disabled] .dndOver.ruleGroup-header {
138
+ [data-inlinecombinators='disabled'] .dndOver.rule,
139
+ [data-inlinecombinators='disabled'] .dndOver.ruleGroup-header {
137
140
  border-bottom-width: 2px;
138
141
  border-bottom-style: dashed;
139
142
  border-bottom-color: lightgrey;
140
143
  padding-bottom: 0.5rem;
141
144
  }
142
145
 
143
- [data-inlinecombinators=disabled] .dndOver.rule.dndCopy, [data-inlinecombinators=disabled] .dndOver.ruleGroup-header.dndCopy {
146
+ [data-inlinecombinators='disabled'] .dndOver.rule.dndCopy,
147
+ [data-inlinecombinators='disabled'] .dndOver.ruleGroup-header.dndCopy {
144
148
  border-bottom-color: #669933;
145
149
  }
146
150
 
147
- [data-inlinecombinators=enabled] .dndOver.rule:last-child, [data-inlinecombinators=enabled] .dndOver.ruleGroup-header, [data-inlinecombinators=enabled] .dndOver.rule + .betweenRules, [data-inlinecombinators=enabled] .dndOver.betweenRules {
151
+ [data-inlinecombinators='enabled'] .dndOver.rule:last-child,
152
+ [data-inlinecombinators='enabled'] .dndOver.ruleGroup-header,
153
+ [data-inlinecombinators='enabled'] .dndOver.rule + .betweenRules,
154
+ [data-inlinecombinators='enabled'] .dndOver.betweenRules {
148
155
  border-bottom-width: 2px;
149
156
  border-bottom-style: dashed;
150
157
  border-bottom-color: lightgrey;
151
158
  padding-bottom: 0.5rem;
152
159
  }
153
160
 
154
- [data-inlinecombinators=enabled] .dndOver.rule:last-child.dndCopy, [data-inlinecombinators=enabled] .dndOver.ruleGroup-header.dndCopy, [data-inlinecombinators=enabled] .dndOver.rule + .betweenRules.dndCopy, [data-inlinecombinators=enabled] .dndOver.betweenRules.dndCopy {
161
+ [data-inlinecombinators='enabled'] .dndOver.rule:last-child.dndCopy,
162
+ [data-inlinecombinators='enabled'] .dndOver.ruleGroup-header.dndCopy,
163
+ [data-inlinecombinators='enabled'] .dndOver.rule + .betweenRules.dndCopy,
164
+ [data-inlinecombinators='enabled'] .dndOver.betweenRules.dndCopy {
155
165
  border-bottom-color: #669933;
156
166
  }
157
167
 
@@ -165,4 +175,4 @@
165
175
  cursor: move;
166
176
  }
167
177
 
168
- /* end DnD section */
178
+ /* end DnD section */
@@ -27,116 +27,107 @@ function AuthenticationRouter({
27
27
  handleSilentRenewCallback(userManager.instance);
28
28
  }
29
29
  }, [userManager.instance]);
30
- return /* @__PURE__ */ jsxs(
31
- Grid,
32
- {
33
- container: true,
34
- alignContent: "center",
35
- alignItems: "center",
36
- direction: "column",
37
- children: [
38
- userManager.error !== null && /* @__PURE__ */ jsxs("h1", { children: [
39
- "Error : Getting userManager; ",
40
- userManager.error
41
- ] }),
42
- signInCallbackError !== null && /* @__PURE__ */ jsxs("h1", { children: [
43
- "Error : SignIn Callback Error;",
44
- signInCallbackError.message
45
- ] }),
46
- /* @__PURE__ */ jsxs(Routes, { children: [
47
- /* @__PURE__ */ jsx(
48
- Route,
30
+ return /* @__PURE__ */ jsxs(Grid, { container: true, alignContent: "center", alignItems: "center", direction: "column", children: [
31
+ userManager.error !== null && /* @__PURE__ */ jsxs("h1", { children: [
32
+ "Error : Getting userManager; ",
33
+ userManager.error
34
+ ] }),
35
+ signInCallbackError !== null && /* @__PURE__ */ jsxs("h1", { children: [
36
+ "Error : SignIn Callback Error;",
37
+ signInCallbackError.message
38
+ ] }),
39
+ /* @__PURE__ */ jsxs(Routes, { children: [
40
+ /* @__PURE__ */ jsx(
41
+ Route,
42
+ {
43
+ path: "sign-in-callback",
44
+ element: /* @__PURE__ */ jsx(
45
+ SignInCallbackHandler,
49
46
  {
50
- path: "sign-in-callback",
51
- element: /* @__PURE__ */ jsx(
52
- SignInCallbackHandler,
53
- {
54
- userManager: userManager.instance,
55
- handleSignInCallback: handleSigninCallbackClosure
56
- }
57
- )
47
+ userManager: userManager.instance,
48
+ handleSignInCallback: handleSigninCallbackClosure
58
49
  }
59
- ),
50
+ )
51
+ }
52
+ ),
53
+ /* @__PURE__ */ jsx(
54
+ Route,
55
+ {
56
+ path: "silent-renew-callback",
57
+ element: /* @__PURE__ */ jsx(
58
+ SilentRenewCallbackHandler,
59
+ {
60
+ userManager: userManager.instance,
61
+ handleSilentRenewCallback: handleSilentRenewCallbackClosure
62
+ }
63
+ )
64
+ }
65
+ ),
66
+ /* @__PURE__ */ jsx(Route, { path: "logout-callback", element: /* @__PURE__ */ jsx(Navigate, { to: "/" }) }),
67
+ /* @__PURE__ */ jsx(
68
+ Route,
69
+ {
70
+ path: "*",
71
+ element: showAuthenticationRouterLogin && authenticationRouterError == null && /* @__PURE__ */ jsx(
72
+ Login,
73
+ {
74
+ disabled: userManager.instance === null,
75
+ onLoginClick: () => login(location, userManager.instance)
76
+ }
77
+ )
78
+ }
79
+ )
80
+ ] }),
81
+ authenticationRouterError !== null && /* @__PURE__ */ jsxs(Fragment, { children: [
82
+ /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
83
+ Logout,
84
+ {
85
+ disabled: userManager.instance === null,
86
+ onLogoutClick: () => logout(dispatch, userManager.instance)
87
+ }
88
+ ) }),
89
+ /* @__PURE__ */ jsxs(Grid, { item: true, xs: 4, children: [
90
+ authenticationRouterError.logoutError != null && /* @__PURE__ */ jsxs(Alert, { severity: "error", children: [
91
+ /* @__PURE__ */ jsx(AlertTitle, { children: /* @__PURE__ */ jsx(FormattedMessage, { id: "login/errorInLogout" }) }),
60
92
  /* @__PURE__ */ jsx(
61
- Route,
93
+ FormattedMessage,
62
94
  {
63
- path: "silent-renew-callback",
64
- element: /* @__PURE__ */ jsx(
65
- SilentRenewCallbackHandler,
66
- {
67
- userManager: userManager.instance,
68
- handleSilentRenewCallback: handleSilentRenewCallbackClosure
69
- }
70
- )
95
+ id: "login/errorInLogoutMessage",
96
+ values: {
97
+ userName: authenticationRouterError.userName
98
+ }
71
99
  }
72
100
  ),
73
- /* @__PURE__ */ jsx(Route, { path: "logout-callback", element: /* @__PURE__ */ jsx(Navigate, { to: "/" }) }),
101
+ /* @__PURE__ */ jsx("p", { children: authenticationRouterError.logoutError.error.message })
102
+ ] }),
103
+ (authenticationRouterError == null ? void 0 : authenticationRouterError.userValidationError) != null && /* @__PURE__ */ jsxs(Alert, { severity: "error", children: [
104
+ /* @__PURE__ */ jsx(AlertTitle, { children: /* @__PURE__ */ jsx(FormattedMessage, { id: "login/errorInUserValidation" }) }),
74
105
  /* @__PURE__ */ jsx(
75
- Route,
106
+ FormattedMessage,
76
107
  {
77
- path: "*",
78
- element: showAuthenticationRouterLogin && authenticationRouterError == null && /* @__PURE__ */ jsx(
79
- Login,
80
- {
81
- disabled: userManager.instance === null,
82
- onLoginClick: () => login(location, userManager.instance)
83
- }
84
- )
108
+ id: "login/errorInUserValidationMessage",
109
+ values: {
110
+ userName: authenticationRouterError.userName
111
+ }
85
112
  }
86
- )
113
+ ),
114
+ /* @__PURE__ */ jsx("p", { children: authenticationRouterError.userValidationError.error.message })
87
115
  ] }),
88
- authenticationRouterError !== null && /* @__PURE__ */ jsxs(Fragment, { children: [
89
- /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
90
- Logout,
116
+ (authenticationRouterError == null ? void 0 : authenticationRouterError.unauthorizedUserInfo) != null && /* @__PURE__ */ jsxs(Alert, { severity: "info", children: [
117
+ /* @__PURE__ */ jsx(AlertTitle, { children: /* @__PURE__ */ jsx(FormattedMessage, { id: "login/unauthorizedAccess" }) }),
118
+ /* @__PURE__ */ jsx(
119
+ FormattedMessage,
91
120
  {
92
- disabled: userManager.instance === null,
93
- onLogoutClick: () => logout(dispatch, userManager.instance)
121
+ id: "login/unauthorizedAccessMessage",
122
+ values: {
123
+ userName: authenticationRouterError.userName
124
+ }
94
125
  }
95
- ) }),
96
- /* @__PURE__ */ jsxs(Grid, { item: true, xs: 4, children: [
97
- authenticationRouterError.logoutError != null && /* @__PURE__ */ jsxs(Alert, { severity: "error", children: [
98
- /* @__PURE__ */ jsx(AlertTitle, { children: /* @__PURE__ */ jsx(FormattedMessage, { id: "login/errorInLogout" }) }),
99
- /* @__PURE__ */ jsx(
100
- FormattedMessage,
101
- {
102
- id: "login/errorInLogoutMessage",
103
- values: {
104
- userName: authenticationRouterError.userName
105
- }
106
- }
107
- ),
108
- /* @__PURE__ */ jsx("p", { children: authenticationRouterError.logoutError.error.message })
109
- ] }),
110
- (authenticationRouterError == null ? void 0 : authenticationRouterError.userValidationError) != null && /* @__PURE__ */ jsxs(Alert, { severity: "error", children: [
111
- /* @__PURE__ */ jsx(AlertTitle, { children: /* @__PURE__ */ jsx(FormattedMessage, { id: "login/errorInUserValidation" }) }),
112
- /* @__PURE__ */ jsx(
113
- FormattedMessage,
114
- {
115
- id: "login/errorInUserValidationMessage",
116
- values: {
117
- userName: authenticationRouterError.userName
118
- }
119
- }
120
- ),
121
- /* @__PURE__ */ jsx("p", { children: authenticationRouterError.userValidationError.error.message })
122
- ] }),
123
- (authenticationRouterError == null ? void 0 : authenticationRouterError.unauthorizedUserInfo) != null && /* @__PURE__ */ jsxs(Alert, { severity: "info", children: [
124
- /* @__PURE__ */ jsx(AlertTitle, { children: /* @__PURE__ */ jsx(FormattedMessage, { id: "login/unauthorizedAccess" }) }),
125
- /* @__PURE__ */ jsx(
126
- FormattedMessage,
127
- {
128
- id: "login/unauthorizedAccessMessage",
129
- values: {
130
- userName: authenticationRouterError.userName
131
- }
132
- }
133
- )
134
- ] })
135
- ] })
126
+ )
136
127
  ] })
137
- ]
138
- }
139
- );
128
+ ] })
129
+ ] })
130
+ ] });
140
131
  }
141
132
  export {
142
133
  AuthenticationRouter as default
@@ -67,14 +67,7 @@ class CardErrorBoundary extends Component {
67
67
  }
68
68
  ) }) }),
69
69
  /* @__PURE__ */ jsxs(CardActions, { disableSpacing: true, children: [
70
- /* @__PURE__ */ jsx(
71
- IconButton,
72
- {
73
- onClick: this.handleReloadClick,
74
- "aria-label": "reload",
75
- children: /* @__PURE__ */ jsx(Replay, {})
76
- }
77
- ),
70
+ /* @__PURE__ */ jsx(IconButton, { onClick: this.handleReloadClick, "aria-label": "reload", children: /* @__PURE__ */ jsx(Replay, {}) }),
78
71
  /* @__PURE__ */ jsx(
79
72
  ExpandMore,
80
73
  {
@@ -87,20 +80,13 @@ class CardErrorBoundary extends Component {
87
80
  )
88
81
  ] }),
89
82
  /* @__PURE__ */ jsx(Collapse, { in: expanded, children: /* @__PURE__ */ jsxs(CardContent, { children: [
90
- /* @__PURE__ */ jsx(
91
- Typography,
83
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "text.secondary", children: /* @__PURE__ */ jsx(
84
+ FormattedMessage,
92
85
  {
93
- variant: "body2",
94
- color: "text.secondary",
95
- children: /* @__PURE__ */ jsx(
96
- FormattedMessage,
97
- {
98
- id: "card_error_boundary/expandederrorheader",
99
- defaultMessage: "Error message (and see more information in the developper console):"
100
- }
101
- )
86
+ id: "card_error_boundary/expandederrorheader",
87
+ defaultMessage: "Error message (and see more information in the developper console):"
102
88
  }
103
- ),
89
+ ) }),
104
90
  /* @__PURE__ */ jsx(Typography, { variant: "caption", children: error.message })
105
91
  ] }) })
106
92
  ] }) });
@@ -19,55 +19,53 @@ const onColumnResized = (params) => {
19
19
  }
20
20
  }
21
21
  };
22
- const CustomAGGrid = React.forwardRef(
23
- (props, ref) => {
24
- const {
25
- shouldHidePinnedHeaderRightBorder = false,
26
- overlayNoRowsTemplate,
27
- loadingOverlayComponent,
28
- loadingOverlayComponentParams,
29
- showOverlay = false
30
- } = props;
31
- const theme = useTheme();
32
- const intl = useIntl();
33
- const GRID_PREFIX = "grid.";
34
- const getLocaleText = useCallback(
35
- (params) => {
36
- const key = GRID_PREFIX + params.key;
37
- return intl.formatMessage({
38
- id: key,
39
- defaultMessage: params.defaultValue
40
- });
41
- },
42
- [intl]
43
- );
44
- return /* @__PURE__ */ jsx(
45
- Box,
46
- {
47
- sx: mergeSx(
48
- styles.grid,
49
- shouldHidePinnedHeaderRightBorder ? styles.noBorderRight : void 0,
50
- showOverlay ? styles.overlayBackground : void 0
51
- ),
52
- className: `${theme.aggrid.theme} ${CUSTOM_AGGRID_THEME}`,
53
- children: /* @__PURE__ */ jsx(
54
- AgGridReact,
55
- {
56
- ref,
57
- getLocaleText,
58
- suppressPropertyNamesCheck: true,
59
- loadingOverlayComponent,
60
- loadingOverlayComponentParams,
61
- overlayNoRowsTemplate,
62
- onColumnResized,
63
- enableCellTextSelection: true,
64
- ...props
65
- }
66
- )
67
- }
68
- );
69
- }
70
- );
22
+ const CustomAGGrid = React.forwardRef((props, ref) => {
23
+ const {
24
+ shouldHidePinnedHeaderRightBorder = false,
25
+ overlayNoRowsTemplate,
26
+ loadingOverlayComponent,
27
+ loadingOverlayComponentParams,
28
+ showOverlay = false
29
+ } = props;
30
+ const theme = useTheme();
31
+ const intl = useIntl();
32
+ const GRID_PREFIX = "grid.";
33
+ const getLocaleText = useCallback(
34
+ (params) => {
35
+ const key = GRID_PREFIX + params.key;
36
+ return intl.formatMessage({
37
+ id: key,
38
+ defaultMessage: params.defaultValue
39
+ });
40
+ },
41
+ [intl]
42
+ );
43
+ return /* @__PURE__ */ jsx(
44
+ Box,
45
+ {
46
+ sx: mergeSx(
47
+ styles.grid,
48
+ shouldHidePinnedHeaderRightBorder ? styles.noBorderRight : void 0,
49
+ showOverlay ? styles.overlayBackground : void 0
50
+ ),
51
+ className: `${theme.aggrid.theme} ${CUSTOM_AGGRID_THEME}`,
52
+ children: /* @__PURE__ */ jsx(
53
+ AgGridReact,
54
+ {
55
+ ref,
56
+ getLocaleText,
57
+ suppressPropertyNamesCheck: true,
58
+ loadingOverlayComponent,
59
+ loadingOverlayComponentParams,
60
+ overlayNoRowsTemplate,
61
+ onColumnResized,
62
+ enableCellTextSelection: true,
63
+ ...props
64
+ }
65
+ )
66
+ }
67
+ );
68
+ });
71
69
  export {
72
70
  CustomAGGrid as default
73
71
  };
@@ -27,10 +27,7 @@ function flattenDownNodes(n, cef) {
27
27
  if (subs.length === 0) {
28
28
  return [n];
29
29
  }
30
- return Array.prototype.concat(
31
- [n],
32
- ...subs.map((sn) => flattenDownNodes(sn, cef))
33
- );
30
+ return Array.prototype.concat([n], ...subs.map((sn) => flattenDownNodes(sn, cef)));
34
31
  }
35
32
  function refreshedUpNodes(m, nn) {
36
33
  if (!(nn == null ? void 0 : nn.elementUuid)) {
@@ -40,9 +37,7 @@ function refreshedUpNodes(m, nn) {
40
37
  return [nn];
41
38
  }
42
39
  const parent = m[nn.parentUuid];
43
- const nextChildren = parent.children.map(
44
- (c) => c.elementUuid === nn.elementUuid ? nn : c
45
- );
40
+ const nextChildren = parent.children.map((c) => c.elementUuid === nn.elementUuid ? nn : c);
46
41
  const nextParent = { ...parent, children: nextChildren };
47
42
  return [nn, ...refreshedUpNodes(m, nextParent)];
48
43
  }
@@ -71,20 +66,14 @@ function updatedTree(prevRoots, prevMap, nodeId, children) {
71
66
  if ((prevChildren == null ? void 0 : prevChildren.length) === nextChildren.length && prevChildren.every((e, i) => e === nextChildren[i])) {
72
67
  return [prevRoots, prevMap];
73
68
  }
74
- const nextUuids = new Set(
75
- children ? children.map((n) => n.elementUuid) : []
76
- );
69
+ const nextUuids = new Set(children ? children.map((n) => n.elementUuid) : []);
77
70
  const prevUuids = prevChildren ? prevChildren.map((n) => n.elementUuid) : [];
78
71
  const mayNodeId = nodeId ? [nodeId] : [];
79
72
  const nonCopyUuids = /* @__PURE__ */ new Set([
80
73
  ...nextUuids,
81
74
  ...mayNodeId,
82
75
  ...Array.prototype.concat(
83
- ...prevUuids.filter((u) => !nextUuids.has(u)).map(
84
- (u) => flattenDownNodes(prevMap[u], (n) => n.children).map(
85
- (n) => n.elementUuid
86
- )
87
- )
76
+ ...prevUuids.filter((u) => !nextUuids.has(u)).map((u) => flattenDownNodes(prevMap[u], (n) => n.children).map((n) => n.elementUuid))
88
77
  )
89
78
  ]);
90
79
  const prevNode = nodeId ? prevMap[nodeId] : {};
@@ -128,10 +117,7 @@ function DirectoryItemSelector({
128
117
  const rootsRef = useRef([]);
129
118
  rootsRef.current = rootDirectories;
130
119
  const { snackError } = useSnackMessage();
131
- const contentFilter = useCallback(
132
- () => /* @__PURE__ */ new Set([ElementType.DIRECTORY, ...types]),
133
- [types]
134
- );
120
+ const contentFilter = useCallback(() => /* @__PURE__ */ new Set([ElementType.DIRECTORY, ...types]), [types]);
135
121
  const convertChildren = useCallback((children) => {
136
122
  return children.map((e) => {
137
123
  return {
@@ -151,9 +137,7 @@ function DirectoryItemSelector({
151
137
  id: e.elementUuid,
152
138
  name: e.elementName,
153
139
  icon: getFileIcon(e.type, styles.icon),
154
- children: e.type === ElementType.DIRECTORY ? convertChildren(
155
- nodeMap.current[e.elementUuid].children
156
- ) : void 0,
140
+ children: e.type === ElementType.DIRECTORY ? convertChildren(nodeMap.current[e.elementUuid].children) : void 0,
157
141
  childrenCount: e.type === ElementType.DIRECTORY ? e.subdirectoriesCount : void 0
158
142
  };
159
143
  });
@@ -162,12 +146,7 @@ function DirectoryItemSelector({
162
146
  );
163
147
  const addToDirectory = useCallback(
164
148
  (nodeId, content) => {
165
- const [nrs, mdr] = updatedTree(
166
- rootsRef.current,
167
- nodeMap.current,
168
- nodeId,
169
- content
170
- );
149
+ const [nrs, mdr] = updatedTree(rootsRef.current, nodeMap.current, nodeId, content);
171
150
  setRootDirectories(nrs);
172
151
  nodeMap.current = mdr;
173
152
  setData(convertRoots(nrs));
@@ -176,12 +155,7 @@ function DirectoryItemSelector({
176
155
  );
177
156
  const updateRootDirectories = useCallback(() => {
178
157
  fetchRootFolders(types).then((newData) => {
179
- const [nrs, mdr] = updatedTree(
180
- rootsRef.current,
181
- nodeMap.current,
182
- null,
183
- newData
184
- );
158
+ const [nrs, mdr] = updatedTree(rootsRef.current, nodeMap.current, null, newData);
185
159
  setRootDirectories(nrs);
186
160
  nodeMap.current = mdr;
187
161
  setData(convertRoots(nrs));
@@ -196,9 +170,7 @@ function DirectoryItemSelector({
196
170
  (nodeId) => {
197
171
  const typeList = types.includes(ElementType.DIRECTORY) ? [] : types;
198
172
  fetchDirectoryContent(nodeId, typeList).then((children) => {
199
- const childrenMatchedTypes = children.filter(
200
- (item) => contentFilter().has(item.type)
201
- );
173
+ const childrenMatchedTypes = children.filter((item) => contentFilter().has(item.type));
202
174
  if (childrenMatchedTypes.length > 0 && equipmentTypes && equipmentTypes.length > 0) {
203
175
  fetchElementsInfos(
204
176
  childrenMatchedTypes.map((e) => e.elementUuid),
@@ -217,9 +189,7 @@ function DirectoryItemSelector({
217
189
  addToDirectory(nodeId, childrenMatchedTypes);
218
190
  }
219
191
  }).catch((error) => {
220
- console.warn(
221
- `Could not update subs (and content) of '${nodeId}' : ${error.message}`
222
- );
192
+ console.warn(`Could not update subs (and content) of '${nodeId}' : ${error.message}`);
223
193
  });
224
194
  },
225
195
  [types, equipmentTypes, itemFilter, contentFilter, addToDirectory]
@@ -8,23 +8,7 @@ function ElementSearchDialog(props) {
8
8
  onSearchTermChange("");
9
9
  onClose == null ? void 0 : onClose();
10
10
  }, [onSearchTermChange, onClose]);
11
- return /* @__PURE__ */ jsx(
12
- Dialog,
13
- {
14
- open,
15
- onClose: handleClose,
16
- disableRestoreFocus: true,
17
- "aria-labelledby": "dialog-title-search",
18
- fullWidth: true,
19
- children: /* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(
20
- ElementSearchInput,
21
- {
22
- onSearchTermChange,
23
- ...rest
24
- }
25
- ) })
26
- }
27
- );
11
+ return /* @__PURE__ */ jsx(Dialog, { open, onClose: handleClose, disableRestoreFocus: true, "aria-labelledby": "dialog-title-search", fullWidth: true, children: /* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(ElementSearchInput, { onSearchTermChange, ...rest }) }) });
28
12
  }
29
13
  export {
30
14
  ElementSearchDialog,
@@ -23,54 +23,36 @@ function EquipmentItem({
23
23
  findAllOccurrences: true
24
24
  });
25
25
  const parts = parse(element.label, matches);
26
- return /* @__PURE__ */ jsx("li", { ...props, children: /* @__PURE__ */ jsxs(
27
- Box,
28
- {
29
- className: (_a = props.classes) == null ? void 0 : _a.equipmentOption,
30
- sx: (_b = props.styles) == null ? void 0 : _b.equipmentOption,
31
- children: [
32
- !showsJustText && /* @__PURE__ */ jsx(
33
- Box,
26
+ return /* @__PURE__ */ jsx("li", { ...props, children: /* @__PURE__ */ jsxs(Box, { className: (_a = props.classes) == null ? void 0 : _a.equipmentOption, sx: (_b = props.styles) == null ? void 0 : _b.equipmentOption, children: [
27
+ !showsJustText && /* @__PURE__ */ jsx(
28
+ Box,
29
+ {
30
+ component: "span",
31
+ className: clsx((_c = props.classes) == null ? void 0 : _c.equipmentTag, (_d = props.classes) == null ? void 0 : _d.equipmentTypeTag),
32
+ sx: mergeSx((_e = props.styles) == null ? void 0 : _e.equipmentTag, (_f = props.styles) == null ? void 0 : _f.equipmentTypeTag),
33
+ children: /* @__PURE__ */ jsx(FormattedMessage, { id: (_g = EQUIPMENT_TYPE[element.type]) == null ? void 0 : _g.tagLabel })
34
+ }
35
+ ),
36
+ /* @__PURE__ */ jsx(
37
+ OverflowableText,
38
+ {
39
+ text: parts.map((e) => e.text).join(),
40
+ className: (_h = props.classes) == null ? void 0 : _h.result,
41
+ sx: (_i = props.styles) == null ? void 0 : _i.result,
42
+ children: parts.map((part) => /* @__PURE__ */ jsx(
43
+ "span",
34
44
  {
35
- component: "span",
36
- className: clsx(
37
- (_c = props.classes) == null ? void 0 : _c.equipmentTag,
38
- (_d = props.classes) == null ? void 0 : _d.equipmentTypeTag
39
- ),
40
- sx: mergeSx(
41
- (_e = props.styles) == null ? void 0 : _e.equipmentTag,
42
- (_f = props.styles) == null ? void 0 : _f.equipmentTypeTag
43
- ),
44
- children: /* @__PURE__ */ jsx(
45
- FormattedMessage,
46
- {
47
- id: (_g = EQUIPMENT_TYPE[element.type]) == null ? void 0 : _g.tagLabel
48
- }
49
- )
50
- }
51
- ),
52
- /* @__PURE__ */ jsx(
53
- OverflowableText,
54
- {
55
- text: parts.map((e) => e.text).join(),
56
- className: (_h = props.classes) == null ? void 0 : _h.result,
57
- sx: (_i = props.styles) == null ? void 0 : _i.result,
58
- children: parts.map((part) => /* @__PURE__ */ jsx(
59
- "span",
60
- {
61
- style: {
62
- fontWeight: part.highlight ? "bold" : "inherit"
63
- },
64
- children: part.text
65
- },
66
- `${part.text}-${part.highlight}`
67
- ))
68
- }
69
- ),
70
- !showsJustText && suffixRenderer({ element, ...props })
71
- ]
72
- }
73
- ) }, element.key);
45
+ style: {
46
+ fontWeight: part.highlight ? "bold" : "inherit"
47
+ },
48
+ children: part.text
49
+ },
50
+ `${part.text}-${part.highlight}`
51
+ ))
52
+ }
53
+ ),
54
+ !showsJustText && suffixRenderer({ element, ...props })
55
+ ] }) }, element.key);
74
56
  }
75
57
  export {
76
58
  EquipmentItem