@gen-epix/ui-client-common 4.3.2 → 4.4.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 (361) hide show
  1. package/README.md +9 -10
  2. package/dist/@types/mui.d.ts +1 -1
  3. package/dist/_chunks/ApplicationFooter.js +49 -49
  4. package/dist/_chunks/ApplicationFooter.js.map +1 -1
  5. package/dist/_chunks/Breadcrumbs.js +23 -22
  6. package/dist/_chunks/Breadcrumbs.js.map +1 -1
  7. package/dist/_chunks/CrudPage.js +211 -210
  8. package/dist/_chunks/CrudPage.js.map +1 -1
  9. package/dist/_chunks/GeoFilter.js.map +1 -1
  10. package/dist/_chunks/Notifications.js +67 -66
  11. package/dist/_chunks/Notifications.js.map +1 -1
  12. package/dist/_chunks/OutageList.js +30 -30
  13. package/dist/_chunks/OutageList.js.map +1 -1
  14. package/dist/_chunks/OutageUtil.js +2 -2
  15. package/dist/_chunks/OutageUtil.js.map +1 -1
  16. package/dist/_chunks/QueryClientProvider.js +1 -1
  17. package/dist/_chunks/QueryClientProvider.js.map +1 -1
  18. package/dist/_chunks/QueryClientService.js +405 -115
  19. package/dist/_chunks/QueryClientService.js.map +1 -1
  20. package/dist/_chunks/Reflect.js +642 -0
  21. package/dist/_chunks/Reflect.js.map +1 -0
  22. package/dist/_chunks/Table.js +572 -574
  23. package/dist/_chunks/Table.js.map +1 -1
  24. package/dist/_chunks/TableUtil.js +5 -5
  25. package/dist/_chunks/TableUtil.js.map +1 -1
  26. package/dist/_chunks/TextFilter.js +1 -1
  27. package/dist/_chunks/TextFilter.js.map +1 -1
  28. package/dist/_chunks/UserInvitationsAdminPage.js +109 -107
  29. package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
  30. package/dist/_chunks/UserManagerUtil.js +7 -15
  31. package/dist/_chunks/UserManagerUtil.js.map +1 -1
  32. package/dist/_chunks/_baseAssignValue.js.map +1 -1
  33. package/dist/_chunks/_baseFlatten.js +8 -8
  34. package/dist/_chunks/_baseFlatten.js.map +1 -1
  35. package/dist/_chunks/_baseUnset.js +299 -22
  36. package/dist/_chunks/_baseUnset.js.map +1 -1
  37. package/dist/_chunks/_cacheHas.js.map +1 -1
  38. package/dist/_chunks/_setToString.js.map +1 -1
  39. package/dist/_chunks/decorate.js +9 -0
  40. package/dist/_chunks/decorateParam.js +8 -0
  41. package/dist/_chunks/format.js.map +1 -1
  42. package/dist/_chunks/isArrayLike.js.map +1 -1
  43. package/dist/_chunks/isObject.js.map +1 -1
  44. package/dist/_chunks/isSymbol.js.map +1 -1
  45. package/dist/_chunks/middleware.js +1 -1
  46. package/dist/_chunks/middleware.js.map +1 -1
  47. package/dist/_chunks/omit.js +39 -40
  48. package/dist/_chunks/omit.js.map +1 -1
  49. package/dist/_chunks/query.js +13 -17
  50. package/dist/_chunks/query.js.map +1 -1
  51. package/dist/_chunks/react.js +1 -1
  52. package/dist/_chunks/react.js.map +1 -1
  53. package/dist/_chunks/tableStore.js +40 -54
  54. package/dist/_chunks/tableStore.js.map +1 -1
  55. package/dist/_chunks/toDate.js.map +1 -1
  56. package/dist/_chunks/useColumnsMenu.js +2 -2
  57. package/dist/_chunks/useColumnsMenu.js.map +1 -1
  58. package/dist/_chunks/useMutation.js +31 -30
  59. package/dist/_chunks/useMutation.js.map +1 -1
  60. package/dist/_chunks/useQueryMemo.js +5 -5
  61. package/dist/_chunks/useQueryMemo.js.map +1 -1
  62. package/dist/_chunks/vanilla.js +1 -1
  63. package/dist/_chunks/vanilla.js.map +1 -1
  64. package/dist/_chunks/yup.js +2 -2
  65. package/dist/_chunks/yup.js.map +1 -1
  66. package/dist/classes/TableEventBus/TableEventBus.d.ts +1 -1
  67. package/dist/classes/TableEventBus/index.js.map +1 -1
  68. package/dist/classes/abstracts/FilterAbstract/index.js.map +1 -1
  69. package/dist/classes/containers/UiClientCommonContainer/UiClientCommonContainer.d.ts +5 -0
  70. package/dist/classes/containers/UiClientCommonContainer/index.d.ts +1 -0
  71. package/dist/classes/containers/UiClientCommonContainer/index.js +17 -0
  72. package/dist/classes/containers/UiClientCommonContainer/index.js.map +1 -0
  73. package/dist/classes/filters/BooleanFilter.d.ts +1 -1
  74. package/dist/classes/filters/DateFilter.d.ts +2 -2
  75. package/dist/classes/filters/GeoFilter.d.ts +2 -2
  76. package/dist/classes/filters/MultiSelectFilter.d.ts +2 -2
  77. package/dist/classes/filters/NumberRangeFilter.d.ts +1 -1
  78. package/dist/classes/filters/TextFilter.d.ts +1 -1
  79. package/dist/classes/services/AuthenticationService/AuthenticationService.d.ts +5 -3
  80. package/dist/classes/services/AuthenticationService/index.js +34 -661
  81. package/dist/classes/services/AuthenticationService/index.js.map +1 -1
  82. package/dist/classes/services/AuthorizationService/AuthorizationService.d.ts +4 -4
  83. package/dist/classes/services/AuthorizationService/index.js +12 -10
  84. package/dist/classes/services/AuthorizationService/index.js.map +1 -1
  85. package/dist/classes/services/BackendVersionService/BackendVersionService.d.ts +0 -3
  86. package/dist/classes/services/BackendVersionService/index.js +5 -8
  87. package/dist/classes/services/BackendVersionService/index.js.map +1 -1
  88. package/dist/classes/services/BreadcrumbService/BreadcrumbService.d.ts +1 -3
  89. package/dist/classes/services/BreadcrumbService/index.js +19 -21
  90. package/dist/classes/services/BreadcrumbService/index.js.map +1 -1
  91. package/dist/classes/services/EmotionCacheService/EmotionCacheService.d.ts +4 -4
  92. package/dist/classes/services/EmotionCacheService/index.js +17 -14
  93. package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
  94. package/dist/classes/services/FeatureFlagsService/FeatureFlagsService.d.ts +0 -3
  95. package/dist/classes/services/FeatureFlagsService/index.js +5 -8
  96. package/dist/classes/services/FeatureFlagsService/index.js.map +1 -1
  97. package/dist/classes/services/I18nService/I18nService.d.ts +3 -3
  98. package/dist/classes/services/I18nService/index.js +25 -29
  99. package/dist/classes/services/I18nService/index.js.map +1 -1
  100. package/dist/classes/services/InactivityService/InactivityService.d.ts +6 -3
  101. package/dist/classes/services/InactivityService/index.js +42 -36
  102. package/dist/classes/services/InactivityService/index.js.map +1 -1
  103. package/dist/classes/services/LogService/LogService.d.ts +7 -4
  104. package/dist/classes/services/LogService/index.js +39 -32
  105. package/dist/classes/services/LogService/index.js.map +1 -1
  106. package/dist/classes/services/NavigationHistoryService/NavigationHistoryService.d.ts +0 -3
  107. package/dist/classes/services/NavigationHistoryService/index.js +5 -8
  108. package/dist/classes/services/NavigationHistoryService/index.js.map +1 -1
  109. package/dist/classes/services/NotificationService/NotificationService.d.ts +4 -4
  110. package/dist/classes/services/NotificationService/index.js +21 -21
  111. package/dist/classes/services/NotificationService/index.js.map +1 -1
  112. package/dist/classes/services/PageEventBusService/PageEventBusService.d.ts +4 -3
  113. package/dist/classes/services/PageEventBusService/index.js +18 -15
  114. package/dist/classes/services/PageEventBusService/index.js.map +1 -1
  115. package/dist/classes/services/QueryClientService/QueryClientService.d.ts +6 -7
  116. package/dist/classes/services/QueryClientService/index.js +1 -2
  117. package/dist/classes/services/RouterService/RouterService.d.ts +6 -9
  118. package/dist/classes/services/RouterService/index.js +8 -12
  119. package/dist/classes/services/RouterService/index.js.map +1 -1
  120. package/dist/classes/services/UserSettingsService/UserSettingsService.d.ts +0 -3
  121. package/dist/classes/services/UserSettingsService/index.js +5 -8
  122. package/dist/classes/services/UserSettingsService/index.js.map +1 -1
  123. package/dist/components/app/App/App.d.ts +5 -1
  124. package/dist/components/app/App/index.js +31 -37
  125. package/dist/components/app/App/index.js.map +1 -1
  126. package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +50 -49
  127. package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
  128. package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +42 -41
  129. package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -1
  130. package/dist/components/app/AuthenticationWrapper/index.js +68 -67
  131. package/dist/components/app/AuthenticationWrapper/index.js.map +1 -1
  132. package/dist/components/app/AuthorizationWrapper/index.js +33 -32
  133. package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
  134. package/dist/components/app/RouterRoot/index.js +62 -61
  135. package/dist/components/app/RouterRoot/index.js.map +1 -1
  136. package/dist/components/epi/EpiContactDetailsDialog/index.js +38 -37
  137. package/dist/components/epi/EpiContactDetailsDialog/index.js.map +1 -1
  138. package/dist/components/filters/BooleanFilterField/index.js +5 -5
  139. package/dist/components/filters/BooleanFilterField/index.js.map +1 -1
  140. package/dist/components/filters/DateFilterField/index.js +3 -3
  141. package/dist/components/filters/DateFilterField/index.js.map +1 -1
  142. package/dist/components/filters/GeoFilterField/index.js +4 -4
  143. package/dist/components/filters/GeoFilterField/index.js.map +1 -1
  144. package/dist/components/filters/MultiSelectFilterField/index.js +4 -4
  145. package/dist/components/filters/MultiSelectFilterField/index.js.map +1 -1
  146. package/dist/components/filters/NumberRangeFilterField/index.js +3 -3
  147. package/dist/components/filters/NumberRangeFilterField/index.js.map +1 -1
  148. package/dist/components/filters/TextFilterField/index.js +3 -3
  149. package/dist/components/filters/TextFilterField/index.js.map +1 -1
  150. package/dist/components/ui/ApplicationBar/index.js +242 -241
  151. package/dist/components/ui/ApplicationBar/index.js.map +1 -1
  152. package/dist/components/ui/ApplicationFooter/index.js +1 -2
  153. package/dist/components/ui/Breadcrumbs/Breadcrumb.d.ts +1 -1
  154. package/dist/components/ui/Breadcrumbs/index.js +1 -2
  155. package/dist/components/ui/ConsentDialog/index.js +11 -6
  156. package/dist/components/ui/ConsentDialog/index.js.map +1 -1
  157. package/dist/components/ui/GenericErrorMessage/index.js +51 -50
  158. package/dist/components/ui/GenericErrorMessage/index.js.map +1 -1
  159. package/dist/components/ui/LicensesDialog/index.js +66 -69
  160. package/dist/components/ui/LicensesDialog/index.js.map +1 -1
  161. package/dist/components/ui/MyPermissionsDialog/index.js +26 -25
  162. package/dist/components/ui/MyPermissionsDialog/index.js.map +1 -1
  163. package/dist/components/ui/NavLink/index.js +6 -6
  164. package/dist/components/ui/NavLink/index.js.map +1 -1
  165. package/dist/components/ui/Notifications/NotificationItem.d.ts +1 -1
  166. package/dist/components/ui/Notifications/index.js +1 -2
  167. package/dist/components/ui/OrganizationSwitcherDialog/index.js +69 -76
  168. package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
  169. package/dist/components/ui/OutageList/index.js +1 -2
  170. package/dist/components/ui/OutagesDialog/index.js.map +1 -1
  171. package/dist/components/ui/PageContainer/PageContainer.d.ts +1 -1
  172. package/dist/components/ui/PageContainer/index.js +57 -52
  173. package/dist/components/ui/PageContainer/index.js.map +1 -1
  174. package/dist/components/ui/ResponseHandler/ResponseHandler.d.ts +1 -1
  175. package/dist/components/ui/ResponseHandler/index.js.map +1 -1
  176. package/dist/components/ui/Sidebar/SidebarItem.d.ts +1 -1
  177. package/dist/components/ui/Sidebar/SidebarMenuItem.d.ts +1 -1
  178. package/dist/components/ui/Sidebar/index.js +45 -45
  179. package/dist/components/ui/Sidebar/index.js.map +1 -1
  180. package/dist/components/ui/Table/Table.d.ts +1 -1
  181. package/dist/components/ui/Table/TableActionsCell.d.ts +1 -1
  182. package/dist/components/ui/Table/TableCell.d.ts +1 -1
  183. package/dist/components/ui/Table/TableCheckboxCell.d.ts +1 -1
  184. package/dist/components/ui/Table/TableCheckboxHeader.d.ts +1 -1
  185. package/dist/components/ui/Table/TableColumnsEditorDialog.d.ts +1 -1
  186. package/dist/components/ui/Table/TableFilter.d.ts +2 -2
  187. package/dist/components/ui/Table/TableHeaderCell.d.ts +1 -1
  188. package/dist/components/ui/Table/TableHeaderFilter.d.ts +2 -2
  189. package/dist/components/ui/Table/TableReadableIndexCell.d.ts +1 -1
  190. package/dist/components/ui/Table/index.js +1 -2
  191. package/dist/components/ui/UserFeedbackDialog/index.js +65 -64
  192. package/dist/components/ui/UserFeedbackDialog/index.js.map +1 -1
  193. package/dist/components/ui/UserInactivityConfirmation/index.js +26 -25
  194. package/dist/components/ui/UserInactivityConfirmation/index.js.map +1 -1
  195. package/dist/constants/config.constants.d.ts +5 -0
  196. package/dist/constants/config.constants.js +6 -0
  197. package/dist/constants/config.constants.js.map +1 -0
  198. package/dist/constants/{query.js → query.constants.js} +2 -2
  199. package/dist/constants/query.constants.js.map +1 -0
  200. package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContext.d.ts +6 -2
  201. package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContextProvider.d.ts +2 -2
  202. package/dist/context/uiClientCommonConfigContext/index.js +28 -12
  203. package/dist/context/uiClientCommonConfigContext/index.js.map +1 -1
  204. package/dist/context/uiClientCommonConfigContext/useUiClientCommonConfigContext.d.ts +2 -1
  205. package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +17 -16
  206. package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js.map +1 -1
  207. package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/useIdentifierIssuerOwnOrganizationQuery.d.ts +1 -1
  208. package/dist/dataHooks/useIdentifierIssuerQuery/index.js +18 -17
  209. package/dist/dataHooks/useIdentifierIssuerQuery/index.js.map +1 -1
  210. package/dist/dataHooks/useIdentifierIssuerQuery/useIdentifierIssuerQuery.d.ts +1 -1
  211. package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +11 -10
  212. package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -1
  213. package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +22 -21
  214. package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js.map +1 -1
  215. package/dist/dataHooks/useOrganizationAdminPoliciesQuery/useOrganizationAdminPoliciesQuery.d.ts +1 -1
  216. package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js +8 -7
  217. package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js.map +1 -1
  218. package/dist/dataHooks/useOrganizationsQuery/index.js +17 -16
  219. package/dist/dataHooks/useOrganizationsQuery/index.js.map +1 -1
  220. package/dist/dataHooks/useOrganizationsQuery/useOrganizationsQuery.d.ts +1 -1
  221. package/dist/dataHooks/useUsersQuery/index.js +18 -17
  222. package/dist/dataHooks/useUsersQuery/index.js.map +1 -1
  223. package/dist/dataHooks/useUsersQuery/useUsersQuery.d.ts +1 -1
  224. package/dist/hoc/withPermissions/index.js +12 -11
  225. package/dist/hoc/withPermissions/index.js.map +1 -1
  226. package/dist/hooks/useColumnsMenu/index.js +1 -2
  227. package/dist/hooks/useColumnsMenu/useColumnsMenu.d.ts +2 -2
  228. package/dist/hooks/useConfig/index.d.ts +1 -0
  229. package/dist/hooks/useConfig/index.js +7 -0
  230. package/dist/hooks/useConfig/index.js.map +1 -0
  231. package/dist/hooks/useConfig/useConfig.d.ts +2 -0
  232. package/dist/hooks/useCreateMutation/index.js +25 -24
  233. package/dist/hooks/useCreateMutation/index.js.map +1 -1
  234. package/dist/hooks/useCreateMutation/useCreateMutation.d.ts +1 -1
  235. package/dist/hooks/useDeleteMutation/index.js +24 -23
  236. package/dist/hooks/useDeleteMutation/index.js.map +1 -1
  237. package/dist/hooks/useDeleteMutation/useDeleteMutation.d.ts +1 -1
  238. package/dist/hooks/useEditMutation/index.js +33 -32
  239. package/dist/hooks/useEditMutation/index.js.map +1 -1
  240. package/dist/hooks/useEditMutation/useEditMutation.d.ts +1 -1
  241. package/dist/hooks/useInitializeTableStore/index.js.map +1 -1
  242. package/dist/hooks/useInitializeTableStore/useInitializeTableStore.d.ts +1 -1
  243. package/dist/hooks/useItemQuery/index.js +36 -35
  244. package/dist/hooks/useItemQuery/index.js.map +1 -1
  245. package/dist/hooks/useItemQuery/useItemQuery.d.ts +1 -1
  246. package/dist/hooks/useQueryMemo/index.js +1 -2
  247. package/dist/hooks/useUpdateBreadcrumb/index.js +10 -9
  248. package/dist/hooks/useUpdateBreadcrumb/index.js.map +1 -1
  249. package/dist/hooks/useUpdateDocumentTitle/index.js +4 -3
  250. package/dist/hooks/useUpdateDocumentTitle/index.js.map +1 -1
  251. package/dist/models/{admin.js → admin.models.js} +2 -2
  252. package/dist/models/admin.models.js.map +1 -0
  253. package/dist/models/api.models.d.ts +16 -0
  254. package/dist/models/api.models.js +6 -0
  255. package/dist/models/api.models.js.map +1 -0
  256. package/dist/models/{dataHooks.d.ts → data-hooks.models.d.ts} +1 -1
  257. package/dist/models/{table.d.ts → table.models.d.ts} +2 -2
  258. package/dist/models/{table.js → table.models.js} +2 -2
  259. package/dist/models/table.models.js.map +1 -0
  260. package/dist/pages/AcceptInvitationPage/index.js +40 -39
  261. package/dist/pages/AcceptInvitationPage/index.js.map +1 -1
  262. package/dist/pages/AdminPage/index.js +39 -38
  263. package/dist/pages/AdminPage/index.js.map +1 -1
  264. package/dist/pages/ChooseIdentityProviderPage/ChooseIdentityProviderPage.d.ts +1 -1
  265. package/dist/pages/ChooseIdentityProviderPage/index.js +38 -37
  266. package/dist/pages/ChooseIdentityProviderPage/index.js.map +1 -1
  267. package/dist/pages/CrudPage/CrudPage.d.ts +6 -6
  268. package/dist/pages/CrudPage/CrudPageDeleteDialog.d.ts +1 -1
  269. package/dist/pages/CrudPage/CrudPageEditDialog.d.ts +2 -2
  270. package/dist/pages/CrudPage/index.js +1 -2
  271. package/dist/pages/ErrorPage/index.js.map +1 -1
  272. package/dist/pages/IdentifierIssuersAdminPage/index.js +41 -40
  273. package/dist/pages/IdentifierIssuersAdminPage/index.js.map +1 -1
  274. package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +58 -57
  275. package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js.map +1 -1
  276. package/dist/pages/OrganizationContactsAdminPage/index.js +49 -48
  277. package/dist/pages/OrganizationContactsAdminPage/index.js.map +1 -1
  278. package/dist/pages/OrganizationSitesAdminPage/index.js +44 -43
  279. package/dist/pages/OrganizationSitesAdminPage/index.js.map +1 -1
  280. package/dist/pages/OrganizationsAdminPage/index.js +57 -56
  281. package/dist/pages/OrganizationsAdminPage/index.js.map +1 -1
  282. package/dist/pages/OutagesAdminPage/index.js +63 -62
  283. package/dist/pages/OutagesAdminPage/index.js.map +1 -1
  284. package/dist/pages/PostLoginPage/index.js +14 -13
  285. package/dist/pages/PostLoginPage/index.js.map +1 -1
  286. package/dist/pages/PostLogoutPage/index.js +19 -18
  287. package/dist/pages/PostLogoutPage/index.js.map +1 -1
  288. package/dist/pages/RouterErrorPage/index.js.map +1 -1
  289. package/dist/pages/UserInvitationsAdminPage/index.js +1 -2
  290. package/dist/pages/UsersAdminPage/UsersAdminPage.d.ts +1 -1
  291. package/dist/pages/UsersAdminPage/index.js +110 -109
  292. package/dist/pages/UsersAdminPage/index.js.map +1 -1
  293. package/dist/routes/adminRoutes.d.ts +1 -1
  294. package/dist/routes/index.js +1 -1
  295. package/dist/routes/index.js.map +1 -1
  296. package/dist/routes/routes.d.ts +1 -1
  297. package/dist/setup/setup.js.map +1 -1
  298. package/dist/stores/oidcStore/index.js.map +1 -1
  299. package/dist/stores/outagesStore/index.js.map +1 -1
  300. package/dist/stores/outagesStore/outagesStore.d.ts +1 -1
  301. package/dist/stores/tableStore/index.js +1 -2
  302. package/dist/stores/tableStore/tableStore.d.ts +2 -2
  303. package/dist/theme/demoTheme/index.js.map +1 -1
  304. package/dist/utils/AxiosUtil/index.js.map +1 -1
  305. package/dist/utils/DataHookUtil/DataHookUtil.d.ts +1 -1
  306. package/dist/utils/DataHookUtil/index.js.map +1 -1
  307. package/dist/utils/LoadableUtil/LoadableUtil.d.ts +1 -1
  308. package/dist/utils/LoadableUtil/index.js.map +1 -1
  309. package/dist/utils/MenuDataUtil/MenuDataUtil.d.ts +1 -1
  310. package/dist/utils/MenuDataUtil/index.js.map +1 -1
  311. package/dist/utils/NotificationUtil/index.js.map +1 -1
  312. package/dist/utils/OutageUtil/OutageUtil.d.ts +1 -1
  313. package/dist/utils/OutageUtil/index.js +1 -2
  314. package/dist/utils/StandardConfigUtil/StandardConfigUtil.d.ts +1 -1
  315. package/dist/utils/StandardConfigUtil/index.js.map +1 -1
  316. package/dist/utils/TableUtil/TableUtil.d.ts +4 -4
  317. package/dist/utils/TableUtil/index.js +1 -2
  318. package/dist/utils/TimeUtil/index.js.map +1 -1
  319. package/dist/utils/UserManagerUtil/index.js +1 -2
  320. package/dist/utils/UserUtil/index.js.map +1 -1
  321. package/package.json +92 -86
  322. package/dist/_chunks/_baseGet.js +0 -280
  323. package/dist/_chunks/_baseGet.js.map +0 -1
  324. package/dist/_chunks/_baseIteratee.js +0 -274
  325. package/dist/_chunks/_baseIteratee.js.map +0 -1
  326. package/dist/_chunks/last.js +0 -13
  327. package/dist/_chunks/last.js.map +0 -1
  328. package/dist/_chunks/uniq.js +0 -44
  329. package/dist/_chunks/uniq.js.map +0 -1
  330. package/dist/classes/services/ApiService/ApiService.d.ts +0 -19
  331. package/dist/classes/services/ApiService/index.d.ts +0 -1
  332. package/dist/classes/services/ApiService/index.js +0 -21
  333. package/dist/classes/services/ApiService/index.js.map +0 -1
  334. package/dist/classes/services/ConfigService/ConfigService.d.ts +0 -9
  335. package/dist/classes/services/ConfigService/index.d.ts +0 -1
  336. package/dist/classes/services/ConfigService/index.js +0 -21
  337. package/dist/classes/services/ConfigService/index.js.map +0 -1
  338. package/dist/constants/query.js.map +0 -1
  339. package/dist/models/admin.js.map +0 -1
  340. package/dist/models/api.d.ts +0 -9
  341. package/dist/models/table.js.map +0 -1
  342. package/dist/models/theme.js +0 -0
  343. /package/dist/constants/{query.d.ts → query.constants.d.ts} +0 -0
  344. /package/dist/models/{admin.d.ts → admin.models.d.ts} +0 -0
  345. /package/dist/models/{auth.d.ts → auth.models.d.ts} +0 -0
  346. /package/dist/models/{api.js → auth.models.js} +0 -0
  347. /package/dist/models/{config.d.ts → config.models.d.ts} +0 -0
  348. /package/dist/models/{auth.js → config.models.js} +0 -0
  349. /package/dist/models/{config.js → data-hooks.models.js} +0 -0
  350. /package/dist/models/{data.d.ts → data.models.d.ts} +0 -0
  351. /package/dist/models/{data.js → data.models.js} +0 -0
  352. /package/dist/models/{filter.d.ts → filter.models.d.ts} +0 -0
  353. /package/dist/models/{dataHooks.js → filter.models.js} +0 -0
  354. /package/dist/models/{notification.d.ts → notification.models.d.ts} +0 -0
  355. /package/dist/models/{filter.js → notification.models.js} +0 -0
  356. /package/dist/models/{outage.d.ts → outage.models.d.ts} +0 -0
  357. /package/dist/models/{notification.js → outage.models.js} +0 -0
  358. /package/dist/models/{reactRouter.d.ts → react-router.models.d.ts} +0 -0
  359. /package/dist/models/{outage.js → react-router.models.js} +0 -0
  360. /package/dist/models/{theme.d.ts → theme.models.d.ts} +0 -0
  361. /package/dist/models/{reactRouter.js → theme.models.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"CrudPage.js","names":[],"sources":["../../src/pages/CrudPage/CrudPageEditDialog.tsx","../../src/pages/CrudPage/CrudPageDeleteDialog.tsx","../../src/pages/CrudPage/CrudPage.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport {\n useCallback,\n useEffect,\n useId,\n useMemo,\n useState,\n} from 'react';\nimport SaveIcon from '@mui/icons-material/Save';\nimport { useTranslation } from 'react-i18next';\nimport type {\n AnyObject,\n ObjectSchema,\n} from 'yup';\nimport { yupResolver } from '@hookform/resolvers/yup';\nimport type {\n Resolver,\n UseFormReturn,\n} from 'react-hook-form';\nimport { useForm } from 'react-hook-form';\nimport { useDebouncedCallback } from 'use-debounce';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { GenericForm } from '@gen-epix/ui-core-form/components/helpers/GenericForm';\nimport type { FormFieldDefinition } from '@gen-epix/ui-core-form/models/form';\nimport { FormUtil } from '@gen-epix/ui-core-form/utils/FormUtil';\nimport type { DialogAction } from '@gen-epix/ui-core-components/components/Dialog';\nimport type {\n WithDialogRefMethods,\n WithDialogRenderProps,\n} from '@gen-epix/ui-core-components/hoc/withDialog';\nimport { withDialog } from '@gen-epix/ui-core-components/hoc/withDialog';\n\nimport type { GenericData } from '../../models/data';\n\n\nexport interface CrudPageEditDialogOpenProps<TData extends GenericData> {\n readonly canSave: boolean;\n readonly extraActionsFactory?: (item: TData) => DialogAction[];\n readonly item?: TData;\n}\nexport interface CrudPageEditDialogProps<TData extends GenericData, TFormFields extends AnyObject> extends WithDialogRenderProps<CrudPageEditDialogOpenProps<TData>> {\n readonly createItemDialogTitle?: string;\n readonly defaultNewItem?: Partial<TFormFields>;\n readonly formFieldDefinitions: ((item: TData, values?: TFormFields) => FormFieldDefinition<TFormFields>[]) | FormFieldDefinition<TFormFields>[];\n readonly getFormValuesFromItem?: (item: TData) => Partial<TFormFields>;\n readonly getName: (item: TData | TFormFields) => string;\n readonly onChange?: (item: TData, formValues: TFormFields, formMethods: UseFormReturn<TFormFields>) => void;\n readonly onSave: (formValues: TFormFields, item: TData) => void;\n readonly schema: ObjectSchema<TFormFields, TFormFields>;\n}\nexport type CrudPageEditDialogRefMethods<TData extends GenericData, TFormFields extends AnyObject> = WithDialogRefMethods<CrudPageEditDialogProps<TData, TFormFields>, CrudPageEditDialogOpenProps<TData>>;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const CrudPageEditDialog = withDialog<CrudPageEditDialogProps<any, any>, CrudPageEditDialogOpenProps<any>>(<TData extends GenericData, TFormFields extends AnyObject>(\n {\n createItemDialogTitle,\n defaultNewItem,\n formFieldDefinitions,\n getFormValuesFromItem,\n getName,\n onActionsChange,\n onChange,\n onClose,\n onSave,\n onTitleChange,\n openProps,\n schema,\n }: CrudPageEditDialogProps<TData, TFormFields>,\n): ReactElement => {\n const { t } = useTranslation();\n const formId = useId();\n\n const initialFormFieldDefinitions = useMemo(() => {\n return typeof formFieldDefinitions === 'function' ? formFieldDefinitions(openProps.item) : formFieldDefinitions;\n }, [formFieldDefinitions, openProps.item]);\n\n const [resolvedFormFieldDefinitions, setResolvedFormFieldDefinitions] = useState<FormFieldDefinition<TFormFields>[]>(initialFormFieldDefinitions);\n\n useEffect(() => {\n const actions: DialogAction[] = [];\n if (openProps.extraActionsFactory) {\n actions.push(...openProps.extraActionsFactory(openProps.item));\n }\n actions.push({\n ...TestIdUtil.createAttributes('CrudPageEditDialog-saveButton'),\n autoFocus: true,\n color: 'secondary',\n disabled: !openProps.canSave || resolvedFormFieldDefinitions.some(def => def.loading),\n form: formId,\n label: t`Save`,\n startIcon: <SaveIcon />,\n type: 'submit',\n variant: 'contained',\n });\n onActionsChange(actions);\n }, [onActionsChange, formId, t, resolvedFormFieldDefinitions, openProps]);\n\n const values = useMemo<TFormFields>(() => {\n return { ...defaultNewItem, ...FormUtil.createFormValues(resolvedFormFieldDefinitions, { ...defaultNewItem, ...(getFormValuesFromItem ? getFormValuesFromItem(openProps.item) : (openProps.item ?? {})) }) };\n }, [defaultNewItem, resolvedFormFieldDefinitions, getFormValuesFromItem, openProps.item]);\n\n useEffect(() => {\n if (openProps.item?.id) {\n onTitleChange(`Edit item: ${getName({ ...defaultNewItem as TFormFields, ...(getFormValuesFromItem ? getFormValuesFromItem(openProps.item) : (openProps.item ?? {})) })}`);\n } else {\n onTitleChange(createItemDialogTitle ?? t`Create new item`);\n }\n }, [getName, onTitleChange, openProps, t, createItemDialogTitle, defaultNewItem, getFormValuesFromItem]);\n\n\n const formMethods = useForm<TFormFields>({\n resolver: yupResolver(schema) as unknown as Resolver<TFormFields>,\n values,\n });\n const { formState, handleSubmit, subscribe } = formMethods;\n\n const debouncedHandleValuesChange = useDebouncedCallback((formValues: TFormFields) => {\n if (onChange) {\n onChange(openProps.item, formValues, formMethods);\n }\n\n if (typeof formFieldDefinitions !== 'function') {\n return;\n }\n setResolvedFormFieldDefinitions(formFieldDefinitions(openProps.item, formValues));\n }, 500, {\n leading: false,\n trailing: true,\n });\n\n useEffect(() => {\n const unsubscribe = subscribe({\n callback: ({ values: formValues }) => {\n debouncedHandleValuesChange(formValues);\n },\n formState: {\n values: true,\n },\n });\n return () => unsubscribe();\n }, [debouncedHandleValuesChange, formFieldDefinitions, subscribe]);\n\n if (formState.errors && Object.keys(formState.errors).length > 0) {\n console.table(formState.errors);\n }\n\n const onFormSubmit = useCallback((formFields: TFormFields): void => {\n onSave(formFields, openProps.item);\n onClose();\n }, [onClose, onSave, openProps.item]);\n\n return (\n <GenericForm<TFormFields>\n disableAll={!openProps.canSave}\n formFieldDefinitions={resolvedFormFieldDefinitions}\n formId={formId}\n formMethods={formMethods}\n onSubmit={openProps.canSave ? handleSubmit(onFormSubmit) : undefined}\n schema={schema}\n />\n );\n}, {\n defaultTitle: '',\n fullWidth: true,\n maxWidth: 'lg',\n testId: 'CrudPageEditDialog',\n});\n","import type { ReactElement } from 'react';\nimport {\n useCallback,\n useEffect,\n} from 'react';\nimport SaveIcon from '@mui/icons-material/Save';\nimport { useTranslation } from 'react-i18next';\nimport { Box } from '@mui/material';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport type { DialogAction } from '@gen-epix/ui-core-components/components/Dialog';\nimport type {\n WithDialogRefMethods,\n WithDialogRenderProps,\n} from '@gen-epix/ui-core-components/hoc/withDialog';\nimport { withDialog } from '@gen-epix/ui-core-components/hoc/withDialog';\n\nimport type { GenericData } from '../../models/data';\n\n\nexport interface CrudPageDeleteDialogOpenProps<TData extends GenericData> {\n readonly item: TData;\n}\nexport interface CrudPageDeleteDialogProps<TData extends GenericData> extends WithDialogRenderProps<CrudPageDeleteDialogOpenProps<TData>> {\n readonly createItemDialogTitle?: string;\n readonly getName: (item: TData) => string;\n readonly onConfirm: (item: TData) => void;\n}\nexport type CrudPageDeleteDialogRefMethods<TData extends GenericData> = WithDialogRefMethods<CrudPageDeleteDialogProps<TData>, CrudPageDeleteDialogOpenProps<TData>>;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const CrudPageDeleteDialog = withDialog<CrudPageDeleteDialogProps<any>, CrudPageDeleteDialogOpenProps<any>>(<TData extends GenericData>(\n {\n createItemDialogTitle,\n getName,\n onActionsChange,\n onClose,\n onConfirm,\n onTitleChange,\n openProps,\n }: CrudPageDeleteDialogProps<TData>,\n): ReactElement => {\n const { t } = useTranslation();\n\n const onConfirmButtonClick = useCallback(() => {\n onConfirm(openProps.item);\n onClose();\n }, [onClose, onConfirm, openProps.item]);\n\n useEffect(() => {\n const actions: DialogAction[] = [];\n actions.push({\n ...TestIdUtil.createAttributes('CrudPageDeleteDialog-closeButton'),\n autoFocus: true,\n color: 'primary',\n label: t`Cancel`,\n onClick: onClose,\n variant: 'outlined',\n });\n actions.push({\n ...TestIdUtil.createAttributes('CrudPageDeleteDialog-confirmButton'),\n color: 'secondary',\n label: t`Confirm`,\n onClick: onConfirmButtonClick,\n startIcon: <SaveIcon />,\n variant: 'contained',\n });\n\n onActionsChange(actions);\n }, [onActionsChange, t, openProps, onConfirmButtonClick, onClose]);\n\n useEffect(() => {\n onTitleChange(t('Delete item: {{itemName}}', { itemName: getName(openProps.item) }));\n }, [getName, onTitleChange, openProps, t, createItemDialogTitle]);\n\n return (\n <Box>\n {t('Are you sure you want to delete the item \"{{itemName}}\"?', { itemName: getName(openProps.item) })}\n </Box>\n );\n}, {\n defaultTitle: '',\n fullWidth: true,\n maxWidth: 'lg',\n testId: 'CrudPageDeleteDialog',\n});\n","import { useTranslation } from 'react-i18next';\nimport EditIcon from '@mui/icons-material/Edit';\nimport DeleteForeverIcon from '@mui/icons-material/DeleteForever';\nimport ArrowCircleRightIcon from '@mui/icons-material/ArrowCircleRight';\nimport ContentCopyIcon from '@mui/icons-material/ContentCopy';\nimport {\n Box,\n Button,\n ListItemIcon,\n ListItemText,\n MenuItem,\n useTheme,\n} from '@mui/material';\nimport type { ReactElement } from 'react';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\nimport type { ObjectSchema } from 'yup';\nimport isArray from 'lodash/isArray';\nimport type {\n FieldValues,\n UseFormReturn,\n} from 'react-hook-form';\nimport type { CommonDbApiPermission } from '@gen-epix/api-commondb';\nimport { CommonDbPermissionType } from '@gen-epix/api-commondb';\nimport type { PropsWithTestIdAttributes } from '@gen-epix/ui-core/models/testId';\nimport type { FormFieldDefinition } from '@gen-epix/ui-core-form/models/form';\nimport type { DialogAction } from '@gen-epix/ui-core-components/components/Dialog';\n\nimport { AuthorizationService } from '../../classes/services/AuthorizationService';\nimport { ConfigService } from '../../classes/services/ConfigService';\nimport { RouterService } from '../../classes/services/RouterService';\nimport { PageContainer } from '../../components/ui/PageContainer';\nimport { ResponseHandler } from '../../components/ui/ResponseHandler';\nimport {\n Table,\n TableCaption,\n TableHeader,\n TableSidebarMenu,\n} from '../../components/ui/Table';\nimport type { MutationContextCreate } from '../../hooks/useCreateMutation';\nimport { useCreateMutation } from '../../hooks/useCreateMutation';\nimport type { MutationContextDelete } from '../../hooks/useDeleteMutation';\nimport { useDeleteMutation } from '../../hooks/useDeleteMutation';\nimport type { MutationContextEdit } from '../../hooks/useEditMutation';\nimport { useEditMutation } from '../../hooks/useEditMutation';\nimport { useInitializeTableStore } from '../../hooks/useInitializeTableStore';\nimport type { GenericData } from '../../models/data';\nimport type { Loadable } from '../../models/dataHooks';\nimport type {\n TableColumn,\n TableRowParams,\n TableSortDirection,\n} from '../../models/table';\nimport {\n createTableStore,\n TableStoreContextProvider,\n} from '../../stores/tableStore';\nimport { TableUtil } from '../../utils/TableUtil';\nimport { useQueryMemo } from '../../hooks/useQueryMemo';\nimport { LoadableUtil } from '../../utils/LoadableUtil';\nimport { QueryClientService } from '../../classes/services/QueryClientService';\nimport type { COMMON_QUERY_KEY } from '../../constants/query';\n\nimport type { CrudPageEditDialogRefMethods } from './CrudPageEditDialog';\nimport { CrudPageEditDialog } from './CrudPageEditDialog';\nimport type { CrudPageDeleteDialogRefMethods } from './CrudPageDeleteDialog';\nimport { CrudPageDeleteDialog } from './CrudPageDeleteDialog';\n\nexport type CrudPageProps<\n TFormFields extends FieldValues,\n TData extends GenericData,\n TTableData extends TData = TData,\n TQueryKey extends string = COMMON_QUERY_KEY,\n TApiPermission extends {\n command_name: string;\n permission_type: string;\n } = CommonDbApiPermission,\n TCommandName extends TApiPermission['command_name'] = TApiPermission['command_name'],\n> = PropsWithTestIdAttributes<{\n readonly associationQueryKeys?: string[][];\n readonly canEditItem?: (item: TData) => boolean;\n readonly contentActions?: ReactElement;\n readonly contentHeader?: string;\n readonly convertToTableData?: (items: TData[]) => TTableData[];\n readonly createItemButtonText?: string;\n readonly createItemDialogTitle?: string;\n readonly createOne?: (item: TFormFields) => Promise<TData>;\n readonly crudCommandType?: TCommandName;\n readonly customOnRowClick?: (params: TableRowParams<TData, null>) => void;\n readonly defaultNewItem?: Partial<TFormFields>;\n readonly defaultSortByField: keyof TTableData;\n readonly defaultSortDirection: TableSortDirection;\n readonly deleteOne?: (item: TData) => Promise<unknown>;\n readonly editDialogExtraActionsFactory?: (item: TData) => DialogAction[];\n readonly extraActionsFactory?: (params: TableRowParams<TData, null>) => ReactElement[];\n readonly extraCreateOnePermissions?: TApiPermission[];\n readonly extraDeleteOnePermissions?: TApiPermission[];\n readonly extraUpdateOnePermissions?: TApiPermission[];\n readonly fetchAll: (signal: AbortSignal) => Promise<TData[]>;\n readonly fetchAllSelect?: (data: TData[]) => TData[];\n readonly formFieldDefinitions: ((values: TFormFields, item: TData) => FormFieldDefinition<TFormFields>[]) | FormFieldDefinition<TFormFields>[];\n readonly getFormValuesFromItem?: (item: TData) => Partial<TFormFields>;\n readonly getName: (item: TData | TFormFields) => string;\n readonly getOptimisticUpdateIntermediateItem?: (variables: TFormFields, previousItem: TData) => TData;\n readonly itemName: string;\n readonly loadables?: Loadable[];\n readonly onCreateError?: (error: unknown, variables: TFormFields, context: MutationContextCreate<TData>) => Promise<void> | void;\n readonly onCreateSuccess?: (item: TData, variables: TFormFields, context: MutationContextCreate<TData>) => Promise<void> | void;\n readonly onDeleteError?: (error: unknown, item: TData, context: MutationContextDelete<TData>) => Promise<void> | void;\n readonly onDeleteSuccess?: (item: TData, context: MutationContextDelete<TData>) => Promise<void> | void;\n readonly onEditError?: (error: unknown, variables: TFormFields, context: MutationContextEdit<TData>) => Promise<void> | void;\n readonly onEditSuccess?: (item: TData, variables: TFormFields, context: MutationContextEdit<TData>) => Promise<void> | void;\n readonly onFormChange?: (item: TData, formValues: TFormFields, formMethods: UseFormReturn<TFormFields>) => void;\n readonly onRowsChange?: (items: TData[]) => void;\n readonly onShowItem?: (params: TableRowParams<TTableData, null>) => void;\n readonly readOnly?: boolean;\n readonly resourceQueryKeyBase: TQueryKey;\n readonly schema?: ObjectSchema<TFormFields, TFormFields>;\n readonly showBreadcrumbs?: boolean;\n readonly showIdColumn?: boolean;\n readonly subPages?: CrudPageSubPage<TData>[];\n readonly tableColumns: TableColumn<TTableData, null>[];\n readonly tableStoreStorageNamePostFix?: string;\n readonly tableStoreStorageVersion?: number;\n readonly title: string | string[];\n readonly updateOne?: (variables: TFormFields, data: TData) => Promise<TData>;\n}>;\n\nexport type CrudPageSubPage<TData extends GenericData> = {\n getPathName: (item: TData) => string;\n icon?: ReactElement;\n label: string;\n};\n\nexport const CrudPage = <\n TFormFields extends FieldValues,\n TData extends GenericData,\n TTableData extends TData = TData,\n TQueryKey extends string = COMMON_QUERY_KEY,\n TApiPermission extends {\n command_name: string;\n permission_type: string;\n } = CommonDbApiPermission,\n TCommandName extends TApiPermission['command_name'] = TApiPermission['command_name'],\n>({\n associationQueryKeys,\n canEditItem,\n contentActions,\n contentHeader,\n convertToTableData,\n createItemButtonText,\n createItemDialogTitle,\n createOne,\n crudCommandType,\n customOnRowClick,\n defaultNewItem,\n defaultSortByField,\n defaultSortDirection,\n deleteOne,\n editDialogExtraActionsFactory,\n extraActionsFactory,\n extraCreateOnePermissions,\n extraDeleteOnePermissions,\n extraUpdateOnePermissions,\n fetchAll,\n fetchAllSelect,\n formFieldDefinitions,\n getFormValuesFromItem,\n getName,\n getOptimisticUpdateIntermediateItem,\n itemName,\n loadables,\n onCreateError,\n onCreateSuccess,\n onDeleteError,\n onDeleteSuccess,\n onEditError,\n onEditSuccess,\n onFormChange,\n onRowsChange,\n onShowItem,\n resourceQueryKeyBase,\n schema,\n showIdColumn = false,\n subPages,\n tableColumns,\n tableStoreStorageNamePostFix,\n tableStoreStorageVersion,\n testIdAttributes,\n title,\n updateOne,\n}: CrudPageProps<TFormFields, TData, TTableData, TQueryKey, TApiPermission, TCommandName>) => {\n type CrudPermission = Pick<TApiPermission, 'command_name' | 'permission_type'>;\n\n const { t } = useTranslation();\n const theme = useTheme();\n const deleteConfirmationRef = useRef<CrudPageDeleteDialogRefMethods<TData>>(null);\n const editDialogRef = useRef<CrudPageEditDialogRefMethods<TData, TFormFields>>(null);\n const authorizationService = useMemo(() => AuthorizationService.getInstance(), []);\n const resourceQueryKey = useMemo(() => [resourceQueryKeyBase], [resourceQueryKeyBase]);\n const tableStore = useMemo(() => createTableStore<TTableData, null>({\n defaultSortByField: defaultSortByField as string,\n defaultSortDirection,\n idSelectorCallback: (item) => item.id,\n navigatorFunction: RouterService.getInstance().router.navigate,\n storageNamePostFix: tableStoreStorageNamePostFix ? `CRUDPage-${resourceQueryKeyBase}-${tableStoreStorageNamePostFix}` : `CRUDPage-${resourceQueryKeyBase}`,\n storageVersion: tableStoreStorageVersion ?? 1,\n }), [defaultSortByField, defaultSortDirection, resourceQueryKeyBase, tableStoreStorageNamePostFix, tableStoreStorageVersion]);\n\n const isLoadablesLoading = useMemo(() => {\n if (isArray(loadables)) {\n return LoadableUtil.isSomeLoading(loadables);\n }\n return false;\n }, [loadables]);\n\n const { data: rows, error: rowsError, isLoading: isRowsLoading } = useQueryMemo({\n enabled: !isLoadablesLoading,\n queryFn: async ({ signal }) => fetchAll(signal),\n queryKey: resourceQueryKey,\n select: fetchAllSelect,\n });\n\n useEffect(() => {\n if (onRowsChange && rows) {\n onRowsChange(rows);\n }\n }, [onRowsChange, rows]);\n\n const isLoading = useMemo(() => {\n if (isRowsLoading) {\n return true;\n }\n return isLoadablesLoading;\n }, [isRowsLoading, isLoadablesLoading]);\n\n const error = useMemo(() => {\n if (rowsError) {\n return rowsError;\n }\n if (isArray(loadables)) {\n return loadables.find((loadable) => loadable.error)?.error as Error;\n }\n return null;\n }, [rowsError, loadables]);\n\n const createPermission = useCallback((permissionType: CrudPermission['permission_type']): CrudPermission => {\n return {\n command_name: crudCommandType,\n permission_type: permissionType,\n };\n }, [crudCommandType]);\n\n const userCanEdit = useMemo(() => {\n if (!updateOne) {\n return false;\n }\n return authorizationService.doesUserHavePermission<CrudPermission>(\n [\n ...(crudCommandType ? [createPermission(CommonDbPermissionType.UPDATE)] : []),\n ...(extraUpdateOnePermissions ?? []),\n ],\n );\n }, [authorizationService, createPermission, crudCommandType, extraUpdateOnePermissions, updateOne]);\n\n const userCanDelete = useMemo(() => {\n if (!deleteOne) {\n return false;\n }\n return authorizationService.doesUserHavePermission<CrudPermission>(\n [\n ...(crudCommandType ? [createPermission(CommonDbPermissionType.DELETE)] : []),\n ...(extraDeleteOnePermissions ?? []),\n ],\n );\n }, [authorizationService, createPermission, crudCommandType, deleteOne, extraDeleteOnePermissions]);\n\n const userCanCreate = useMemo(() => {\n if (!createOne || error) {\n return false;\n }\n return authorizationService.doesUserHavePermission<CrudPermission>(\n [\n ...(crudCommandType ? [createPermission(CommonDbPermissionType.CREATE)] : []),\n ...(extraCreateOnePermissions ?? []),\n ],\n );\n }, [authorizationService, createOne, createPermission, crudCommandType, error, extraCreateOnePermissions]);\n\n const normalizedEditDialogExtraActionsFactory = useCallback((item: TData) => {\n const actions: DialogAction[] = [];\n\n if (editDialogExtraActionsFactory) {\n actions.push(...editDialogExtraActionsFactory(item));\n }\n subPages?.forEach(subPage => {\n actions.push({\n color: 'primary',\n label: subPage.label,\n onClick: async () => await RouterService.getInstance().router.navigate({\n pathname: subPage.getPathName(item),\n }),\n variant: 'outlined',\n });\n });\n\n return actions;\n }, [editDialogExtraActionsFactory, subPages]);\n\n const editItem = useCallback((item: TTableData) => {\n editDialogRef.current.open({\n canSave: userCanEdit && (!item || canEditItem ? canEditItem(item) : true),\n extraActionsFactory: normalizedEditDialogExtraActionsFactory,\n item,\n });\n }, [canEditItem, normalizedEditDialogExtraActionsFactory, userCanEdit]);\n\n const tryToGetName = useCallback((item: TData | TFormFields) => {\n let name: string;\n try {\n name = getName(item);\n } catch {\n name = undefined;\n }\n return name;\n }, [getName]);\n\n const getEditProgressNotificationMessage = useCallback((data: TData) => {\n const name = tryToGetName(data);\n return name ? t('{{itemName}} \"{{name}}\" is being saved...', { itemName, name }) : t('{{itemName}} is being saved...', { itemName });\n }, [t, tryToGetName, itemName]);\n\n const getCreateProgressNotificationMessage = useCallback((data: TFormFields) => {\n const name = tryToGetName(data);\n return name ? t('{{itemName}} \"{{name}}\" is being saved...', { itemName, name }) : t('{{itemName}} is being saved...', { itemName });\n }, [t, tryToGetName, itemName]);\n\n const getDeleteProgressNotificationMessage = useCallback((data: TData) => {\n const name = tryToGetName(data);\n return name ? t('{{itemName}} \"{{name}}\" is being deleted...', { itemName, name }) : t('{{itemName}} is being deleted...', { itemName });\n }, [t, tryToGetName, itemName]);\n\n const getEditSuccessNotificationMessage = useCallback((data: TData) => {\n const name = tryToGetName(data);\n return name ? t('{{itemName}} \"{{name}}\" has been saved.', { itemName, name }) : t('{{itemName}} has been saved.', { itemName });\n }, [t, tryToGetName, itemName]);\n\n const getCreateSuccessNotificationMessage = useCallback((data: TData) => {\n const name = tryToGetName(data);\n return name ? t('{{itemName}} \"{{name}}\" has been created.', { itemName, name }) : t('{{itemName}} has been created.', { itemName });\n }, [t, tryToGetName, itemName]);\n\n const getDeleteSuccessNotificationMessage = useCallback((data: TData) => {\n const name = tryToGetName(data);\n return name ? t('{{itemName}} \"{{name}}\" has been deleted.', { itemName, name }) : t('{{itemName}} has been deleted.', { itemName });\n }, [t, tryToGetName, itemName]);\n\n const getEditErrorNotificationMessage = useCallback((data: TData) => {\n const name = tryToGetName(data);\n return name ? t('{{itemName}} \"{{name}}\" could not be saved.', { itemName, name }) : t('{{itemName}} could not be saved.', { itemName });\n }, [t, tryToGetName, itemName]);\n\n const getCreateErrorNotificationMessage = useCallback((data: TFormFields) => {\n const name = tryToGetName(data);\n return name ? t('{{itemName}} \"{{name}}\" could not be created.', { itemName, name }) : t('{{itemName}} could not be created.', { itemName });\n }, [t, tryToGetName, itemName]);\n\n const getDeleteErrorNotificationMessage = useCallback((data: TData) => {\n const name = tryToGetName(data);\n return name ? t('{{itemName}} \"{{name}}\" could not be deleted.', { itemName, name }) : t('{{itemName}} could not be deleted.', { itemName });\n }, [t, tryToGetName, itemName]);\n\n const calculatedAssociationQueryKeys = useMemo<string[][]>(() => {\n const keys = associationQueryKeys ?? [];\n\n QueryClientService.getInstance().getQueryKeyDependencies([resourceQueryKeyBase]).forEach(key => {\n keys.push(key);\n });\n return keys;\n }, [associationQueryKeys, resourceQueryKeyBase]);\n\n const { mutate: mutateEdit, setPreviousItem: mutateEditSetPreviousItem } = useEditMutation<TData, TFormFields>({\n associationQueryKeys: calculatedAssociationQueryKeys,\n getErrorNotificationMessage: getEditErrorNotificationMessage,\n getIntermediateItem: getOptimisticUpdateIntermediateItem,\n getProgressNotificationMessage: getEditProgressNotificationMessage,\n getSuccessNotificationMessage: getEditSuccessNotificationMessage,\n onError: onEditError,\n onSuccess: onEditSuccess,\n queryFn: updateOne,\n resourceQueryKey,\n });\n\n const { isMutating: isCreating, mutate: mutateCreate } = useCreateMutation<TData, TFormFields>({\n associationQueryKeys: calculatedAssociationQueryKeys,\n getErrorNotificationMessage: getCreateErrorNotificationMessage,\n getProgressNotificationMessage: getCreateProgressNotificationMessage,\n getSuccessNotificationMessage: getCreateSuccessNotificationMessage,\n onError: onCreateError,\n onSuccess: onCreateSuccess,\n queryFn: createOne,\n resourceQueryKey,\n });\n\n const { mutate: mutateDelete } = useDeleteMutation<TData>({\n associationQueryKeys: calculatedAssociationQueryKeys,\n getErrorNotificationMessage: getDeleteErrorNotificationMessage,\n getProgressNotificationMessage: getDeleteProgressNotificationMessage,\n getSuccessNotificationMessage: getDeleteSuccessNotificationMessage,\n onError: onDeleteError,\n onSuccess: onDeleteSuccess,\n queryFn: deleteOne,\n resourceQueryKey,\n });\n\n const onEditDialogSave = useCallback((formValues: TFormFields, item: TData) => {\n if (item?.id) {\n mutateEditSetPreviousItem(item);\n mutateEdit(formValues);\n } else {\n mutateCreate(formValues);\n }\n }, [mutateCreate, mutateEdit, mutateEditSetPreviousItem]);\n\n const onEditIconClick = useCallback((params: TableRowParams<TTableData, null>) => {\n editItem(params.row);\n }, [editItem]);\n\n const onRowClick = useCallback((params: TableRowParams<TTableData, null>) => {\n if (customOnRowClick) {\n customOnRowClick(params);\n } else if (onShowItem) {\n onShowItem(params);\n } else {\n editItem(params.row);\n }\n }, [customOnRowClick, onShowItem, editItem]);\n\n const onDeleteConfirmationConfirm = useCallback((item: TData) => {\n mutateDelete(item);\n }, [mutateDelete]);\n\n const normalizedExtraActions = useCallback((params: TableRowParams<TTableData, null>) => {\n const actions: ReactElement[] = [];\n\n const extraActions = extraActionsFactory ? extraActionsFactory(params) : [];\n if (extraActions?.length > 0) {\n actions.push(...extraActions);\n }\n subPages?.forEach(subPage => {\n actions.push((\n <MenuItem\n key={subPage.label}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={async () => await RouterService.getInstance().router.navigate({\n pathname: subPage.getPathName(params.row),\n })}\n >\n <ListItemIcon>\n {subPage.icon ? subPage.icon : <ArrowCircleRightIcon />}\n </ListItemIcon>\n <ListItemText>\n {subPage.label}\n </ListItemText>\n </MenuItem>\n ));\n });\n\n if (userCanCreate) {\n actions.push((\n <MenuItem\n key={'clone'}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={() => editDialogRef.current.open({\n canSave: true,\n item: { ...params.row, id: null },\n })}\n >\n <ListItemIcon>\n <ContentCopyIcon />\n </ListItemIcon>\n <ListItemText>\n {t`Clone`}\n </ListItemText>\n </MenuItem>\n ));\n }\n\n return actions;\n }, [extraActionsFactory, subPages, userCanCreate, t]);\n\n const columns = useMemo<TableColumn<TTableData, null>[]>(() => {\n const internalColumns: TableColumn<TTableData, null>[] = [\n TableUtil.createReadableIndexColumn(),\n ];\n\n if (showIdColumn) {\n internalColumns.push({\n headerName: t`Id`,\n id: 'id',\n isInitiallyVisible: true,\n type: 'text',\n widthPx: 300,\n });\n }\n internalColumns.push(...tableColumns);\n\n internalColumns.push(\n TableUtil.createActionsColumn({\n getActions: (params) => {\n const actions: ReactElement[] = [];\n if (onShowItem) {\n actions.push(\n <MenuItem\n key={'actions1'}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={() => onShowItem(params)}\n >\n <ListItemIcon>\n <ArrowCircleRightIcon />\n </ListItemIcon>\n <ListItemText>\n {t`Show`}\n </ListItemText>\n </MenuItem>,\n );\n }\n actions.push(\n <MenuItem\n key={'actions2'}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={() => onEditIconClick(params)}\n >\n <ListItemIcon>\n <EditIcon />\n </ListItemIcon>\n <ListItemText>\n {t`Edit`}\n </ListItemText>\n </MenuItem>,\n );\n if (userCanDelete) {\n actions.push(\n <MenuItem\n key={'actions3'}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={() => deleteConfirmationRef.current.open({\n item: params.row,\n })}\n >\n <ListItemIcon>\n <DeleteForeverIcon />\n </ListItemIcon>\n <ListItemText>\n {t`Delete`}\n </ListItemText>\n </MenuItem>,\n );\n }\n const extraActions = normalizedExtraActions(params) ?? [];\n if (extraActions?.length > 0 && actions.length > 0) {\n actions.push(...extraActions);\n }\n return actions;\n },\n t,\n }),\n );\n return internalColumns;\n }, [normalizedExtraActions, onEditIconClick, onShowItem, showIdColumn, t, tableColumns, userCanDelete]);\n\n const tableRows = useMemo(() => {\n if (!convertToTableData) {\n return rows as TTableData[];\n }\n return convertToTableData(rows);\n }, [convertToTableData, rows]);\n\n useInitializeTableStore<TTableData, null>({ columns, context: null, createFiltersFromColumns: true, rows: tableRows, store: tableStore });\n\n const onCreateItemButtonClick = useCallback(() => {\n editDialogRef.current.open({\n canSave: true,\n });\n }, []);\n\n const customContentActions = useMemo(() => {\n if (!contentActions && !userCanCreate) {\n return (\n <TableHeader />\n );\n }\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n gap: theme.spacing(1),\n }}\n >\n <TableHeader />\n {userCanCreate && (\n <Button\n color={'secondary'}\n disabled={isLoading || isCreating}\n loading={isLoading || isCreating}\n onClick={onCreateItemButtonClick}\n size={'small'}\n variant={'contained'}\n >\n {createItemButtonText ?? t`Create item`}\n </Button>\n )}\n {contentActions}\n </Box>\n );\n }, [contentActions, userCanCreate, isLoading, isCreating, onCreateItemButtonClick, createItemButtonText, t, theme]);\n\n const normalizedTitle = useMemo<string>(() => {\n if (isArray(title)) {\n return title.join(' -> ');\n }\n return title;\n }, [title]);\n\n\n return (\n <TableStoreContextProvider store={tableStore}>\n <PageContainer\n contentActions={customContentActions}\n contentHeader={(\n <TableCaption\n caption={contentHeader ?? normalizedTitle}\n component={'h2'}\n variant={'h2'}\n />\n )}\n fullWidth\n showBreadcrumbs\n testIdAttributes={testIdAttributes}\n title={normalizedTitle}\n >\n <Box\n sx={{\n height: '100%',\n position: 'relative',\n }}\n >\n <ResponseHandler\n error={error}\n isLoading={isLoading}\n >\n <TableSidebarMenu />\n <Box\n sx={{\n height: '100%',\n paddingLeft: theme.spacing(ConfigService.getInstance().config.layout.SIDEBAR_MENU_WIDTH + 1),\n width: '100%',\n }}\n >\n <Table\n getRowName={getName}\n onRowClick={onRowClick}\n />\n </Box>\n </ResponseHandler>\n </Box>\n <CrudPageEditDialog\n createItemDialogTitle={createItemDialogTitle}\n defaultNewItem={defaultNewItem}\n formFieldDefinitions={formFieldDefinitions}\n getFormValuesFromItem={getFormValuesFromItem}\n getName={getName}\n onChange={onFormChange}\n onSave={onEditDialogSave}\n ref={editDialogRef}\n schema={schema}\n />\n <CrudPageDeleteDialog\n getName={getName}\n onConfirm={onDeleteConfirmationConfirm}\n ref={deleteConfirmationRef}\n />\n </PageContainer>\n </TableStoreContextProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAqDa,KAAqB,GAChC,EACE,0BACA,mBACA,yBACA,0BACA,YACA,oBACA,aACA,YACA,WACA,kBACA,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BAAC,GAAD,CAAc,CAAA;GACb,KACC,kBAAC,IAAD;IACE,OAAO;IACP,UAAU,KAAa;IACvB,SAAS,KAAa;IACtB,SAAS;IACT,MAAM;IACN,SAAS;IAER,UAAA,KAAwB,CAAC;GACpB,CAAA;GAET;EACE;KAEN;EAAC;EAAgB;EAAe;EAAW;EAAY;EAAyB;EAAsB;EAAG;CAAK,CAAC,GAE5G,KAAkB,SACtB,GAAI,GAAA,QAAA,CAAQ,CAAK,IACR,EAAM,KAAK,MAAM,IAEnB,GACN,CAAC,CAAK,CAAC;CAGV,OACE,kBAAC,GAAD;EAA2B,OAAO;EAChC,UAAA,kBAAC,GAAD;GACE,gBAAgB;GAChB,eACE,kBAAC,GAAD;IACE,SAAS,MAAiB;IAC1B,WAAW;IACX,SAAS;GACV,CAAA;GAEH,WAAA;GACA,iBAAA;GACkB;GAClB,OAAO;GAZT,UAAA;IAcE,kBAAC,GAAD;KACE,IAAI;MACF,QAAQ;MACR,UAAU;KACZ;KAEA,UAAA,kBAAC,GAAD;MACS;MACI;MAFb,UAAA,CAIE,kBAAC,IAAD,CAAmB,CAAA,GACnB,kBAAC,GAAD;OACE,IAAI;QACF,QAAQ;QACR,aAAa,GAAM,QAAQ,EAAc,YAAY,CAAC,CAAC,OAAO,OAAO,qBAAqB,CAAC;QAC3F,OAAO;OACT;OAEA,UAAA,kBAAC,GAAD;QACE,YAAY;QACA;OACb,CAAA;MACE,CAAA,CACU;;IACd,CAAA;IACL,kBAAC,IAAD;KACyB;KACP;KACM;KACC;KACd;KACT,UAAU;KACV,QAAQ;KACR,KAAK;KACG;IACT,CAAA;IACD,kBAAC,IAAD;KACW;KACT,WAAW;KACX,KAAK;IACN,CAAA;GACY;;CACU,CAAA;AAE/B"}
1
+ {"version":3,"file":"CrudPage.js","names":["yupResolver","useDebouncedCallback","rootContainer","isArray","Table","__toESM","require_isArray","QueryClientService","useQueryMemo","createTableStore","TableStoreContextProvider","Table$1","c","TableHeader","TableCaption","TableSidebarMenu","o","EditIcon","DeleteForeverIcon","ArrowCircleRightIcon","ContentCopyIcon","SaveIcon","import_isArray","CrudPageEditDialog","withDialog","useTranslation","formId","useId","initialFormFieldDefinitions","useMemo","formFieldDefinitions","openProps","resolvedFormFieldDefinitions","setResolvedFormFieldDefinitions","useState","actions","TestIdUtil","def","onActionsChange","t","values","defaultNewItem","FormUtil","getFormValuesFromItem","onTitleChange","getName","createItemDialogTitle","formMethods","useForm","schema","debouncedHandleValuesChange","onChange","formValues","useEffect","unsubscribe","subscribe","formState","onFormSubmit","useCallback","onSave","formFields","onClose","GenericForm","handleSubmit","CrudPageDeleteDialog","onConfirmButtonClick","onConfirm","Box","CrudPage","theme","useTheme","config","useConfig","deleteConfirmationRef","useRef","editDialogRef","authorizationService","container","AuthorizationService","resourceQueryKey","resourceQueryKeyBase","tableStore","item","RouterService","tableStoreStorageNamePostFix","tableStoreStorageVersion","defaultSortByField","defaultSortDirection","isLoadablesLoading","loadables","LoadableUtil","rows","rowsError","isRowsLoading","fetchAll","signal","fetchAllSelect","onRowsChange","isLoading","error","loadable","createPermission","crudCommandType","permissionType","userCanEdit","updateOne","CommonDbPermissionType","extraUpdateOnePermissions","userCanDelete","deleteOne","extraDeleteOnePermissions","userCanCreate","createOne","extraCreateOnePermissions","normalizedEditDialogExtraActionsFactory","editDialogExtraActionsFactory","subPages","subPage","editItem","canEditItem","tryToGetName","name","getEditProgressNotificationMessage","data","itemName","getCreateProgressNotificationMessage","getDeleteProgressNotificationMessage","getEditSuccessNotificationMessage","getCreateSuccessNotificationMessage","getDeleteSuccessNotificationMessage","getEditErrorNotificationMessage","getCreateErrorNotificationMessage","getDeleteErrorNotificationMessage","calculatedAssociationQueryKeys","keys","associationQueryKeys","key","mutateEdit","mutateEditSetPreviousItem","useEditMutation","getOptimisticUpdateIntermediateItem","onEditError","onEditSuccess","isCreating","mutateCreate","useCreateMutation","onCreateError","onCreateSuccess","mutateDelete","useDeleteMutation","onDeleteError","onDeleteSuccess","onEditDialogSave","onEditIconClick","params","onRowClick","customOnRowClick","onShowItem","onDeleteConfirmationConfirm","normalizedExtraActions","extraActions","extraActionsFactory","MenuItem","ListItemIcon","ListItemText","columns","internalColumns","TableUtil","showIdColumn","tableColumns","tableRows","convertToTableData","onCreateItemButtonClick","customContentActions","contentActions","Button","createItemButtonText","normalizedTitle","title","PageContainer","contentHeader","ResponseHandler","onFormChange"],"sources":["../../src/pages/CrudPage/CrudPageEditDialog.tsx","../../src/pages/CrudPage/CrudPageDeleteDialog.tsx","../../src/pages/CrudPage/CrudPage.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport {\n useCallback,\n useEffect,\n useId,\n useMemo,\n useState,\n} from 'react';\nimport SaveIcon from '@mui/icons-material/Save';\nimport { useTranslation } from 'react-i18next';\nimport type {\n AnyObject,\n ObjectSchema,\n} from 'yup';\nimport { yupResolver } from '@hookform/resolvers/yup';\nimport type {\n Resolver,\n UseFormReturn,\n} from 'react-hook-form';\nimport { useForm } from 'react-hook-form';\nimport { useDebouncedCallback } from 'use-debounce';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { GenericForm } from '@gen-epix/ui-core-form/components/helpers/GenericForm';\nimport type { FormFieldDefinition } from '@gen-epix/ui-core-form/models/form.models';\nimport { FormUtil } from '@gen-epix/ui-core-form/utils/FormUtil';\nimport type { DialogAction } from '@gen-epix/ui-core-components/components/Dialog';\nimport type {\n WithDialogRefMethods,\n WithDialogRenderProps,\n} from '@gen-epix/ui-core-components/hoc/withDialog';\nimport { withDialog } from '@gen-epix/ui-core-components/hoc/withDialog';\n\nimport type { GenericData } from '../../models/data.models';\n\n\nexport interface CrudPageEditDialogOpenProps<TData extends GenericData> {\n readonly canSave: boolean;\n readonly extraActionsFactory?: (item: TData) => DialogAction[];\n readonly item?: TData;\n}\nexport interface CrudPageEditDialogProps<TData extends GenericData, TFormFields extends AnyObject> extends WithDialogRenderProps<CrudPageEditDialogOpenProps<TData>> {\n readonly createItemDialogTitle?: string;\n readonly defaultNewItem?: Partial<TFormFields>;\n readonly formFieldDefinitions: ((item: TData, values?: TFormFields) => FormFieldDefinition<TFormFields>[]) | FormFieldDefinition<TFormFields>[];\n readonly getFormValuesFromItem?: (item: TData) => Partial<TFormFields>;\n readonly getName: (item: TData | TFormFields) => string;\n readonly onChange?: (item: TData, formValues: TFormFields, formMethods: UseFormReturn<TFormFields>) => void;\n readonly onSave: (formValues: TFormFields, item: TData) => void;\n readonly schema: ObjectSchema<TFormFields, TFormFields>;\n}\nexport type CrudPageEditDialogRefMethods<TData extends GenericData, TFormFields extends AnyObject> = WithDialogRefMethods<CrudPageEditDialogProps<TData, TFormFields>, CrudPageEditDialogOpenProps<TData>>;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const CrudPageEditDialog = withDialog<CrudPageEditDialogProps<any, any>, CrudPageEditDialogOpenProps<any>>(<TData extends GenericData, TFormFields extends AnyObject>(\n {\n createItemDialogTitle,\n defaultNewItem,\n formFieldDefinitions,\n getFormValuesFromItem,\n getName,\n onActionsChange,\n onChange,\n onClose,\n onSave,\n onTitleChange,\n openProps,\n schema,\n }: CrudPageEditDialogProps<TData, TFormFields>,\n): ReactElement => {\n const { t } = useTranslation();\n const formId = useId();\n\n const initialFormFieldDefinitions = useMemo(() => {\n return typeof formFieldDefinitions === 'function' ? formFieldDefinitions(openProps.item) : formFieldDefinitions;\n }, [formFieldDefinitions, openProps.item]);\n\n const [resolvedFormFieldDefinitions, setResolvedFormFieldDefinitions] = useState<FormFieldDefinition<TFormFields>[]>(initialFormFieldDefinitions);\n\n useEffect(() => {\n const actions: DialogAction[] = [];\n if (openProps.extraActionsFactory) {\n actions.push(...openProps.extraActionsFactory(openProps.item));\n }\n actions.push({\n ...TestIdUtil.createAttributes('CrudPageEditDialog-saveButton'),\n autoFocus: true,\n color: 'secondary',\n disabled: !openProps.canSave || resolvedFormFieldDefinitions.some(def => def.loading),\n form: formId,\n label: t`Save`,\n startIcon: <SaveIcon />,\n type: 'submit',\n variant: 'contained',\n });\n onActionsChange(actions);\n }, [onActionsChange, formId, t, resolvedFormFieldDefinitions, openProps]);\n\n const values = useMemo<TFormFields>(() => {\n return { ...defaultNewItem, ...FormUtil.createFormValues(resolvedFormFieldDefinitions, { ...defaultNewItem, ...(getFormValuesFromItem ? getFormValuesFromItem(openProps.item) : (openProps.item ?? {})) }) };\n }, [defaultNewItem, resolvedFormFieldDefinitions, getFormValuesFromItem, openProps.item]);\n\n useEffect(() => {\n if (openProps.item?.id) {\n onTitleChange(`Edit item: ${getName({ ...defaultNewItem as TFormFields, ...(getFormValuesFromItem ? getFormValuesFromItem(openProps.item) : (openProps.item ?? {})) })}`);\n } else {\n onTitleChange(createItemDialogTitle ?? t`Create new item`);\n }\n }, [getName, onTitleChange, openProps, t, createItemDialogTitle, defaultNewItem, getFormValuesFromItem]);\n\n\n const formMethods = useForm<TFormFields>({\n resolver: yupResolver(schema) as unknown as Resolver<TFormFields>,\n values,\n });\n const { formState, handleSubmit, subscribe } = formMethods;\n\n const debouncedHandleValuesChange = useDebouncedCallback((formValues: TFormFields) => {\n if (onChange) {\n onChange(openProps.item, formValues, formMethods);\n }\n\n if (typeof formFieldDefinitions !== 'function') {\n return;\n }\n setResolvedFormFieldDefinitions(formFieldDefinitions(openProps.item, formValues));\n }, 500, {\n leading: false,\n trailing: true,\n });\n\n useEffect(() => {\n const unsubscribe = subscribe({\n callback: ({ values: formValues }) => {\n debouncedHandleValuesChange(formValues);\n },\n formState: {\n values: true,\n },\n });\n return () => unsubscribe();\n }, [debouncedHandleValuesChange, formFieldDefinitions, subscribe]);\n\n if (formState.errors && Object.keys(formState.errors).length > 0) {\n console.table(formState.errors);\n }\n\n const onFormSubmit = useCallback((formFields: TFormFields): void => {\n onSave(formFields, openProps.item);\n onClose();\n }, [onClose, onSave, openProps.item]);\n\n return (\n <GenericForm<TFormFields>\n disableAll={!openProps.canSave}\n formFieldDefinitions={resolvedFormFieldDefinitions}\n formId={formId}\n formMethods={formMethods}\n onSubmit={openProps.canSave ? handleSubmit(onFormSubmit) : undefined}\n schema={schema}\n />\n );\n}, {\n defaultTitle: '',\n fullWidth: true,\n maxWidth: 'lg',\n testId: 'CrudPageEditDialog',\n});\n","import type { ReactElement } from 'react';\nimport {\n useCallback,\n useEffect,\n} from 'react';\nimport SaveIcon from '@mui/icons-material/Save';\nimport { useTranslation } from 'react-i18next';\nimport { Box } from '@mui/material';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport type { DialogAction } from '@gen-epix/ui-core-components/components/Dialog';\nimport type {\n WithDialogRefMethods,\n WithDialogRenderProps,\n} from '@gen-epix/ui-core-components/hoc/withDialog';\nimport { withDialog } from '@gen-epix/ui-core-components/hoc/withDialog';\n\nimport type { GenericData } from '../../models/data.models';\n\n\nexport interface CrudPageDeleteDialogOpenProps<TData extends GenericData> {\n readonly item: TData;\n}\nexport interface CrudPageDeleteDialogProps<TData extends GenericData> extends WithDialogRenderProps<CrudPageDeleteDialogOpenProps<TData>> {\n readonly createItemDialogTitle?: string;\n readonly getName: (item: TData) => string;\n readonly onConfirm: (item: TData) => void;\n}\nexport type CrudPageDeleteDialogRefMethods<TData extends GenericData> = WithDialogRefMethods<CrudPageDeleteDialogProps<TData>, CrudPageDeleteDialogOpenProps<TData>>;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const CrudPageDeleteDialog = withDialog<CrudPageDeleteDialogProps<any>, CrudPageDeleteDialogOpenProps<any>>(<TData extends GenericData>(\n {\n createItemDialogTitle,\n getName,\n onActionsChange,\n onClose,\n onConfirm,\n onTitleChange,\n openProps,\n }: CrudPageDeleteDialogProps<TData>,\n): ReactElement => {\n const { t } = useTranslation();\n\n const onConfirmButtonClick = useCallback(() => {\n onConfirm(openProps.item);\n onClose();\n }, [onClose, onConfirm, openProps.item]);\n\n useEffect(() => {\n const actions: DialogAction[] = [];\n actions.push({\n ...TestIdUtil.createAttributes('CrudPageDeleteDialog-closeButton'),\n autoFocus: true,\n color: 'primary',\n label: t`Cancel`,\n onClick: onClose,\n variant: 'outlined',\n });\n actions.push({\n ...TestIdUtil.createAttributes('CrudPageDeleteDialog-confirmButton'),\n color: 'secondary',\n label: t`Confirm`,\n onClick: onConfirmButtonClick,\n startIcon: <SaveIcon />,\n variant: 'contained',\n });\n\n onActionsChange(actions);\n }, [onActionsChange, t, openProps, onConfirmButtonClick, onClose]);\n\n useEffect(() => {\n onTitleChange(t('Delete item: {{itemName}}', { itemName: getName(openProps.item) }));\n }, [getName, onTitleChange, openProps, t, createItemDialogTitle]);\n\n return (\n <Box>\n {t('Are you sure you want to delete the item \"{{itemName}}\"?', { itemName: getName(openProps.item) })}\n </Box>\n );\n}, {\n defaultTitle: '',\n fullWidth: true,\n maxWidth: 'lg',\n testId: 'CrudPageDeleteDialog',\n});\n","import { container as rootContainer } from 'tsyringe';\nimport { useTranslation } from 'react-i18next';\nimport EditIcon from '@mui/icons-material/Edit';\nimport DeleteForeverIcon from '@mui/icons-material/DeleteForever';\nimport ArrowCircleRightIcon from '@mui/icons-material/ArrowCircleRight';\nimport ContentCopyIcon from '@mui/icons-material/ContentCopy';\nimport {\n Box,\n Button,\n ListItemIcon,\n ListItemText,\n MenuItem,\n useTheme,\n} from '@mui/material';\nimport type { ReactElement } from 'react';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\nimport type { ObjectSchema } from 'yup';\nimport isArray from 'lodash/isArray';\nimport type {\n FieldValues,\n UseFormReturn,\n} from 'react-hook-form';\nimport type { CommonDbApiPermission } from '@gen-epix/api-commondb';\nimport { CommonDbPermissionType } from '@gen-epix/api-commondb';\nimport type { PropsWithTestIdAttributes } from '@gen-epix/ui-core/models/test-id.models';\nimport type { FormFieldDefinition } from '@gen-epix/ui-core-form/models/form.models';\nimport type { DialogAction } from '@gen-epix/ui-core-components/components/Dialog';\n\nimport { AuthorizationService } from '../../classes/services/AuthorizationService';\nimport { RouterService } from '../../classes/services/RouterService';\nimport { PageContainer } from '../../components/ui/PageContainer';\nimport { ResponseHandler } from '../../components/ui/ResponseHandler';\nimport {\n Table,\n TableCaption,\n TableHeader,\n TableSidebarMenu,\n} from '../../components/ui/Table';\nimport type { MutationContextCreate } from '../../hooks/useCreateMutation';\nimport { useCreateMutation } from '../../hooks/useCreateMutation';\nimport type { MutationContextDelete } from '../../hooks/useDeleteMutation';\nimport { useDeleteMutation } from '../../hooks/useDeleteMutation';\nimport type { MutationContextEdit } from '../../hooks/useEditMutation';\nimport { useEditMutation } from '../../hooks/useEditMutation';\nimport { useInitializeTableStore } from '../../hooks/useInitializeTableStore';\nimport type { GenericData } from '../../models/data.models';\nimport type { Loadable } from '../../models/data-hooks.models';\nimport type {\n TableColumn,\n TableRowParams,\n TableSortDirection,\n} from '../../models/table.models';\nimport {\n createTableStore,\n TableStoreContextProvider,\n} from '../../stores/tableStore';\nimport { TableUtil } from '../../utils/TableUtil';\nimport { useQueryMemo } from '../../hooks/useQueryMemo';\nimport { LoadableUtil } from '../../utils/LoadableUtil';\nimport { QueryClientService } from '../../classes/services/QueryClientService';\nimport type { COMMON_QUERY_KEY } from '../../constants/query.constants';\nimport { useConfig } from '../../hooks/useConfig';\n\nimport type { CrudPageEditDialogRefMethods } from './CrudPageEditDialog';\nimport { CrudPageEditDialog } from './CrudPageEditDialog';\nimport type { CrudPageDeleteDialogRefMethods } from './CrudPageDeleteDialog';\nimport { CrudPageDeleteDialog } from './CrudPageDeleteDialog';\n\nexport type CrudPageProps<\n TFormFields extends FieldValues,\n TData extends GenericData,\n TTableData extends TData = TData,\n TQueryKey extends string = COMMON_QUERY_KEY,\n TApiPermission extends {\n command_name: string;\n permission_type: string;\n } = CommonDbApiPermission,\n TCommandName extends TApiPermission['command_name'] = TApiPermission['command_name'],\n> = PropsWithTestIdAttributes<{\n readonly associationQueryKeys?: string[][];\n readonly canEditItem?: (item: TData) => boolean;\n readonly contentActions?: ReactElement;\n readonly contentHeader?: string;\n readonly convertToTableData?: (items: TData[]) => TTableData[];\n readonly createItemButtonText?: string;\n readonly createItemDialogTitle?: string;\n readonly createOne?: (item: TFormFields) => Promise<TData>;\n readonly crudCommandType?: TCommandName;\n readonly customOnRowClick?: (params: TableRowParams<TData, null>) => void;\n readonly defaultNewItem?: Partial<TFormFields>;\n readonly defaultSortByField: keyof TTableData;\n readonly defaultSortDirection: TableSortDirection;\n readonly deleteOne?: (item: TData) => Promise<unknown>;\n readonly editDialogExtraActionsFactory?: (item: TData) => DialogAction[];\n readonly extraActionsFactory?: (params: TableRowParams<TData, null>) => ReactElement[];\n readonly extraCreateOnePermissions?: TApiPermission[];\n readonly extraDeleteOnePermissions?: TApiPermission[];\n readonly extraUpdateOnePermissions?: TApiPermission[];\n readonly fetchAll: (signal: AbortSignal) => Promise<TData[]>;\n readonly fetchAllSelect?: (data: TData[]) => TData[];\n readonly formFieldDefinitions: ((values: TFormFields, item: TData) => FormFieldDefinition<TFormFields>[]) | FormFieldDefinition<TFormFields>[];\n readonly getFormValuesFromItem?: (item: TData) => Partial<TFormFields>;\n readonly getName: (item: TData | TFormFields) => string;\n readonly getOptimisticUpdateIntermediateItem?: (variables: TFormFields, previousItem: TData) => TData;\n readonly itemName: string;\n readonly loadables?: Loadable[];\n readonly onCreateError?: (error: unknown, variables: TFormFields, context: MutationContextCreate<TData>) => Promise<void> | void;\n readonly onCreateSuccess?: (item: TData, variables: TFormFields, context: MutationContextCreate<TData>) => Promise<void> | void;\n readonly onDeleteError?: (error: unknown, item: TData, context: MutationContextDelete<TData>) => Promise<void> | void;\n readonly onDeleteSuccess?: (item: TData, context: MutationContextDelete<TData>) => Promise<void> | void;\n readonly onEditError?: (error: unknown, variables: TFormFields, context: MutationContextEdit<TData>) => Promise<void> | void;\n readonly onEditSuccess?: (item: TData, variables: TFormFields, context: MutationContextEdit<TData>) => Promise<void> | void;\n readonly onFormChange?: (item: TData, formValues: TFormFields, formMethods: UseFormReturn<TFormFields>) => void;\n readonly onRowsChange?: (items: TData[]) => void;\n readonly onShowItem?: (params: TableRowParams<TTableData, null>) => void;\n readonly readOnly?: boolean;\n readonly resourceQueryKeyBase: TQueryKey;\n readonly schema?: ObjectSchema<TFormFields, TFormFields>;\n readonly showBreadcrumbs?: boolean;\n readonly showIdColumn?: boolean;\n readonly subPages?: CrudPageSubPage<TData>[];\n readonly tableColumns: TableColumn<TTableData, null>[];\n readonly tableStoreStorageNamePostFix?: string;\n readonly tableStoreStorageVersion?: number;\n readonly title: string | string[];\n readonly updateOne?: (variables: TFormFields, data: TData) => Promise<TData>;\n}>;\n\nexport type CrudPageSubPage<TData extends GenericData> = {\n getPathName: (item: TData) => string;\n icon?: ReactElement;\n label: string;\n};\n\nexport const CrudPage = <\n TFormFields extends FieldValues,\n TData extends GenericData,\n TTableData extends TData = TData,\n TQueryKey extends string = COMMON_QUERY_KEY,\n TApiPermission extends {\n command_name: string;\n permission_type: string;\n } = CommonDbApiPermission,\n TCommandName extends TApiPermission['command_name'] = TApiPermission['command_name'],\n>({\n associationQueryKeys,\n canEditItem,\n contentActions,\n contentHeader,\n convertToTableData,\n createItemButtonText,\n createItemDialogTitle,\n createOne,\n crudCommandType,\n customOnRowClick,\n defaultNewItem,\n defaultSortByField,\n defaultSortDirection,\n deleteOne,\n editDialogExtraActionsFactory,\n extraActionsFactory,\n extraCreateOnePermissions,\n extraDeleteOnePermissions,\n extraUpdateOnePermissions,\n fetchAll,\n fetchAllSelect,\n formFieldDefinitions,\n getFormValuesFromItem,\n getName,\n getOptimisticUpdateIntermediateItem,\n itemName,\n loadables,\n onCreateError,\n onCreateSuccess,\n onDeleteError,\n onDeleteSuccess,\n onEditError,\n onEditSuccess,\n onFormChange,\n onRowsChange,\n onShowItem,\n resourceQueryKeyBase,\n schema,\n showIdColumn = false,\n subPages,\n tableColumns,\n tableStoreStorageNamePostFix,\n tableStoreStorageVersion,\n testIdAttributes,\n title,\n updateOne,\n}: CrudPageProps<TFormFields, TData, TTableData, TQueryKey, TApiPermission, TCommandName>) => {\n type CrudPermission = Pick<TApiPermission, 'command_name' | 'permission_type'>;\n\n const { t } = useTranslation();\n const theme = useTheme();\n const config = useConfig();\n const deleteConfirmationRef = useRef<CrudPageDeleteDialogRefMethods<TData>>(null);\n const editDialogRef = useRef<CrudPageEditDialogRefMethods<TData, TFormFields>>(null);\n const authorizationService = useMemo(() => rootContainer.resolve(AuthorizationService), []);\n const resourceQueryKey = useMemo(() => [resourceQueryKeyBase], [resourceQueryKeyBase]);\n const tableStore = useMemo(() => createTableStore<TTableData, null>({\n defaultSortByField: defaultSortByField as string,\n defaultSortDirection,\n idSelectorCallback: (item) => item.id,\n navigatorFunction: rootContainer.resolve(RouterService).router.navigate,\n storageNamePostFix: tableStoreStorageNamePostFix ? `CRUDPage-${resourceQueryKeyBase}-${tableStoreStorageNamePostFix}` : `CRUDPage-${resourceQueryKeyBase}`,\n storageVersion: tableStoreStorageVersion ?? 1,\n }), [defaultSortByField, defaultSortDirection, resourceQueryKeyBase, tableStoreStorageNamePostFix, tableStoreStorageVersion]);\n\n const isLoadablesLoading = useMemo(() => {\n if (isArray(loadables)) {\n return LoadableUtil.isSomeLoading(loadables);\n }\n return false;\n }, [loadables]);\n\n const { data: rows, error: rowsError, isLoading: isRowsLoading } = useQueryMemo({\n enabled: !isLoadablesLoading,\n queryFn: async ({ signal }) => fetchAll(signal),\n queryKey: resourceQueryKey,\n select: fetchAllSelect,\n });\n\n useEffect(() => {\n if (onRowsChange && rows) {\n onRowsChange(rows);\n }\n }, [onRowsChange, rows]);\n\n const isLoading = useMemo(() => {\n if (isRowsLoading) {\n return true;\n }\n return isLoadablesLoading;\n }, [isRowsLoading, isLoadablesLoading]);\n\n const error = useMemo(() => {\n if (rowsError) {\n return rowsError;\n }\n if (isArray(loadables)) {\n return loadables.find((loadable) => loadable.error)?.error as Error;\n }\n return null;\n }, [rowsError, loadables]);\n\n const createPermission = useCallback((permissionType: CrudPermission['permission_type']): CrudPermission => {\n return {\n command_name: crudCommandType,\n permission_type: permissionType,\n };\n }, [crudCommandType]);\n\n const userCanEdit = useMemo(() => {\n if (!updateOne) {\n return false;\n }\n return authorizationService.doesUserHavePermission<CrudPermission>(\n [\n ...(crudCommandType ? [createPermission(CommonDbPermissionType.UPDATE)] : []),\n ...(extraUpdateOnePermissions ?? []),\n ],\n );\n }, [authorizationService, createPermission, crudCommandType, extraUpdateOnePermissions, updateOne]);\n\n const userCanDelete = useMemo(() => {\n if (!deleteOne) {\n return false;\n }\n return authorizationService.doesUserHavePermission<CrudPermission>(\n [\n ...(crudCommandType ? [createPermission(CommonDbPermissionType.DELETE)] : []),\n ...(extraDeleteOnePermissions ?? []),\n ],\n );\n }, [authorizationService, createPermission, crudCommandType, deleteOne, extraDeleteOnePermissions]);\n\n const userCanCreate = useMemo(() => {\n if (!createOne || error) {\n return false;\n }\n return authorizationService.doesUserHavePermission<CrudPermission>(\n [\n ...(crudCommandType ? [createPermission(CommonDbPermissionType.CREATE)] : []),\n ...(extraCreateOnePermissions ?? []),\n ],\n );\n }, [authorizationService, createOne, createPermission, crudCommandType, error, extraCreateOnePermissions]);\n\n const normalizedEditDialogExtraActionsFactory = useCallback((item: TData) => {\n const actions: DialogAction[] = [];\n\n if (editDialogExtraActionsFactory) {\n actions.push(...editDialogExtraActionsFactory(item));\n }\n subPages?.forEach(subPage => {\n actions.push({\n color: 'primary',\n label: subPage.label,\n onClick: async () => await rootContainer.resolve(RouterService).router.navigate({\n pathname: subPage.getPathName(item),\n }),\n variant: 'outlined',\n });\n });\n\n return actions;\n }, [editDialogExtraActionsFactory, subPages]);\n\n const editItem = useCallback((item: TTableData) => {\n editDialogRef.current.open({\n canSave: userCanEdit && (!item || canEditItem ? canEditItem(item) : true),\n extraActionsFactory: normalizedEditDialogExtraActionsFactory,\n item,\n });\n }, [canEditItem, normalizedEditDialogExtraActionsFactory, userCanEdit]);\n\n const tryToGetName = useCallback((item: TData | TFormFields) => {\n let name: string;\n try {\n name = getName(item);\n } catch {\n name = undefined;\n }\n return name;\n }, [getName]);\n\n const getEditProgressNotificationMessage = useCallback((data: TData) => {\n const name = tryToGetName(data);\n return name ? t('{{itemName}} \"{{name}}\" is being saved...', { itemName, name }) : t('{{itemName}} is being saved...', { itemName });\n }, [t, tryToGetName, itemName]);\n\n const getCreateProgressNotificationMessage = useCallback((data: TFormFields) => {\n const name = tryToGetName(data);\n return name ? t('{{itemName}} \"{{name}}\" is being saved...', { itemName, name }) : t('{{itemName}} is being saved...', { itemName });\n }, [t, tryToGetName, itemName]);\n\n const getDeleteProgressNotificationMessage = useCallback((data: TData) => {\n const name = tryToGetName(data);\n return name ? t('{{itemName}} \"{{name}}\" is being deleted...', { itemName, name }) : t('{{itemName}} is being deleted...', { itemName });\n }, [t, tryToGetName, itemName]);\n\n const getEditSuccessNotificationMessage = useCallback((data: TData) => {\n const name = tryToGetName(data);\n return name ? t('{{itemName}} \"{{name}}\" has been saved.', { itemName, name }) : t('{{itemName}} has been saved.', { itemName });\n }, [t, tryToGetName, itemName]);\n\n const getCreateSuccessNotificationMessage = useCallback((data: TData) => {\n const name = tryToGetName(data);\n return name ? t('{{itemName}} \"{{name}}\" has been created.', { itemName, name }) : t('{{itemName}} has been created.', { itemName });\n }, [t, tryToGetName, itemName]);\n\n const getDeleteSuccessNotificationMessage = useCallback((data: TData) => {\n const name = tryToGetName(data);\n return name ? t('{{itemName}} \"{{name}}\" has been deleted.', { itemName, name }) : t('{{itemName}} has been deleted.', { itemName });\n }, [t, tryToGetName, itemName]);\n\n const getEditErrorNotificationMessage = useCallback((data: TData) => {\n const name = tryToGetName(data);\n return name ? t('{{itemName}} \"{{name}}\" could not be saved.', { itemName, name }) : t('{{itemName}} could not be saved.', { itemName });\n }, [t, tryToGetName, itemName]);\n\n const getCreateErrorNotificationMessage = useCallback((data: TFormFields) => {\n const name = tryToGetName(data);\n return name ? t('{{itemName}} \"{{name}}\" could not be created.', { itemName, name }) : t('{{itemName}} could not be created.', { itemName });\n }, [t, tryToGetName, itemName]);\n\n const getDeleteErrorNotificationMessage = useCallback((data: TData) => {\n const name = tryToGetName(data);\n return name ? t('{{itemName}} \"{{name}}\" could not be deleted.', { itemName, name }) : t('{{itemName}} could not be deleted.', { itemName });\n }, [t, tryToGetName, itemName]);\n\n const calculatedAssociationQueryKeys = useMemo<string[][]>(() => {\n const keys = associationQueryKeys ?? [];\n\n rootContainer.resolve(QueryClientService).getQueryKeyDependencies([resourceQueryKeyBase]).forEach(key => {\n keys.push(key);\n });\n return keys;\n }, [associationQueryKeys, resourceQueryKeyBase]);\n\n const { mutate: mutateEdit, setPreviousItem: mutateEditSetPreviousItem } = useEditMutation<TData, TFormFields>({\n associationQueryKeys: calculatedAssociationQueryKeys,\n getErrorNotificationMessage: getEditErrorNotificationMessage,\n getIntermediateItem: getOptimisticUpdateIntermediateItem,\n getProgressNotificationMessage: getEditProgressNotificationMessage,\n getSuccessNotificationMessage: getEditSuccessNotificationMessage,\n onError: onEditError,\n onSuccess: onEditSuccess,\n queryFn: updateOne,\n resourceQueryKey,\n });\n\n const { isMutating: isCreating, mutate: mutateCreate } = useCreateMutation<TData, TFormFields>({\n associationQueryKeys: calculatedAssociationQueryKeys,\n getErrorNotificationMessage: getCreateErrorNotificationMessage,\n getProgressNotificationMessage: getCreateProgressNotificationMessage,\n getSuccessNotificationMessage: getCreateSuccessNotificationMessage,\n onError: onCreateError,\n onSuccess: onCreateSuccess,\n queryFn: createOne,\n resourceQueryKey,\n });\n\n const { mutate: mutateDelete } = useDeleteMutation<TData>({\n associationQueryKeys: calculatedAssociationQueryKeys,\n getErrorNotificationMessage: getDeleteErrorNotificationMessage,\n getProgressNotificationMessage: getDeleteProgressNotificationMessage,\n getSuccessNotificationMessage: getDeleteSuccessNotificationMessage,\n onError: onDeleteError,\n onSuccess: onDeleteSuccess,\n queryFn: deleteOne,\n resourceQueryKey,\n });\n\n const onEditDialogSave = useCallback((formValues: TFormFields, item: TData) => {\n if (item?.id) {\n mutateEditSetPreviousItem(item);\n mutateEdit(formValues);\n } else {\n mutateCreate(formValues);\n }\n }, [mutateCreate, mutateEdit, mutateEditSetPreviousItem]);\n\n const onEditIconClick = useCallback((params: TableRowParams<TTableData, null>) => {\n editItem(params.row);\n }, [editItem]);\n\n const onRowClick = useCallback((params: TableRowParams<TTableData, null>) => {\n if (customOnRowClick) {\n customOnRowClick(params);\n } else if (onShowItem) {\n onShowItem(params);\n } else {\n editItem(params.row);\n }\n }, [customOnRowClick, onShowItem, editItem]);\n\n const onDeleteConfirmationConfirm = useCallback((item: TData) => {\n mutateDelete(item);\n }, [mutateDelete]);\n\n const normalizedExtraActions = useCallback((params: TableRowParams<TTableData, null>) => {\n const actions: ReactElement[] = [];\n\n const extraActions = extraActionsFactory ? extraActionsFactory(params) : [];\n if (extraActions?.length > 0) {\n actions.push(...extraActions);\n }\n subPages?.forEach(subPage => {\n actions.push((\n <MenuItem\n key={subPage.label}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={async () => await rootContainer.resolve(RouterService).router.navigate({\n pathname: subPage.getPathName(params.row),\n })}\n >\n <ListItemIcon>\n {subPage.icon ? subPage.icon : <ArrowCircleRightIcon />}\n </ListItemIcon>\n <ListItemText>\n {subPage.label}\n </ListItemText>\n </MenuItem>\n ));\n });\n\n if (userCanCreate) {\n actions.push((\n <MenuItem\n key={'clone'}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={() => editDialogRef.current.open({\n canSave: true,\n item: { ...params.row, id: null },\n })}\n >\n <ListItemIcon>\n <ContentCopyIcon />\n </ListItemIcon>\n <ListItemText>\n {t`Clone`}\n </ListItemText>\n </MenuItem>\n ));\n }\n\n return actions;\n }, [extraActionsFactory, subPages, userCanCreate, t]);\n\n const columns = useMemo<TableColumn<TTableData, null>[]>(() => {\n const internalColumns: TableColumn<TTableData, null>[] = [\n TableUtil.createReadableIndexColumn(),\n ];\n\n if (showIdColumn) {\n internalColumns.push({\n headerName: t`Id`,\n id: 'id',\n isInitiallyVisible: true,\n type: 'text',\n widthPx: 300,\n });\n }\n internalColumns.push(...tableColumns);\n\n internalColumns.push(\n TableUtil.createActionsColumn({\n getActions: (params) => {\n const actions: ReactElement[] = [];\n if (onShowItem) {\n actions.push(\n <MenuItem\n key={'actions1'}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={() => onShowItem(params)}\n >\n <ListItemIcon>\n <ArrowCircleRightIcon />\n </ListItemIcon>\n <ListItemText>\n {t`Show`}\n </ListItemText>\n </MenuItem>,\n );\n }\n actions.push(\n <MenuItem\n key={'actions2'}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={() => onEditIconClick(params)}\n >\n <ListItemIcon>\n <EditIcon />\n </ListItemIcon>\n <ListItemText>\n {t`Edit`}\n </ListItemText>\n </MenuItem>,\n );\n if (userCanDelete) {\n actions.push(\n <MenuItem\n key={'actions3'}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={() => deleteConfirmationRef.current.open({\n item: params.row,\n })}\n >\n <ListItemIcon>\n <DeleteForeverIcon />\n </ListItemIcon>\n <ListItemText>\n {t`Delete`}\n </ListItemText>\n </MenuItem>,\n );\n }\n const extraActions = normalizedExtraActions(params) ?? [];\n if (extraActions?.length > 0 && actions.length > 0) {\n actions.push(...extraActions);\n }\n return actions;\n },\n t,\n }),\n );\n return internalColumns;\n }, [normalizedExtraActions, onEditIconClick, onShowItem, showIdColumn, t, tableColumns, userCanDelete]);\n\n const tableRows = useMemo(() => {\n if (!convertToTableData) {\n return rows as TTableData[];\n }\n return convertToTableData(rows);\n }, [convertToTableData, rows]);\n\n useInitializeTableStore<TTableData, null>({ columns, context: null, createFiltersFromColumns: true, rows: tableRows, store: tableStore });\n\n const onCreateItemButtonClick = useCallback(() => {\n editDialogRef.current.open({\n canSave: true,\n });\n }, []);\n\n const customContentActions = useMemo(() => {\n if (!contentActions && !userCanCreate) {\n return (\n <TableHeader />\n );\n }\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n gap: theme.spacing(1),\n }}\n >\n <TableHeader />\n {userCanCreate && (\n <Button\n color={'secondary'}\n disabled={isLoading || isCreating}\n loading={isLoading || isCreating}\n onClick={onCreateItemButtonClick}\n size={'small'}\n variant={'contained'}\n >\n {createItemButtonText ?? t`Create item`}\n </Button>\n )}\n {contentActions}\n </Box>\n );\n }, [contentActions, userCanCreate, isLoading, isCreating, onCreateItemButtonClick, createItemButtonText, t, theme]);\n\n const normalizedTitle = useMemo<string>(() => {\n if (isArray(title)) {\n return title.join(' -> ');\n }\n return title;\n }, [title]);\n\n\n return (\n <TableStoreContextProvider store={tableStore}>\n <PageContainer\n contentActions={customContentActions}\n contentHeader={(\n <TableCaption\n caption={contentHeader ?? normalizedTitle}\n component={'h2'}\n variant={'h2'}\n />\n )}\n fullWidth\n showBreadcrumbs\n testIdAttributes={testIdAttributes}\n title={normalizedTitle}\n >\n <Box\n sx={{\n height: '100%',\n position: 'relative',\n }}\n >\n <ResponseHandler\n error={error}\n isLoading={isLoading}\n >\n <TableSidebarMenu />\n <Box\n sx={{\n height: '100%',\n paddingLeft: theme.spacing(config.layout.SIDEBAR_MENU_WIDTH + 1),\n width: '100%',\n }}\n >\n <Table\n getRowName={getName}\n onRowClick={onRowClick}\n />\n </Box>\n </ResponseHandler>\n </Box>\n <CrudPageEditDialog\n createItemDialogTitle={createItemDialogTitle}\n defaultNewItem={defaultNewItem}\n formFieldDefinitions={formFieldDefinitions}\n getFormValuesFromItem={getFormValuesFromItem}\n getName={getName}\n onChange={onFormChange}\n onSave={onEditDialogSave}\n ref={editDialogRef}\n schema={schema}\n />\n <CrudPageDeleteDialog\n getName={getName}\n onConfirm={onDeleteConfirmationConfirm}\n ref={deleteConfirmationRef}\n />\n </PageContainer>\n </TableStoreContextProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAqDauB,KAAqBC,GAChC,EACE,0BACA,mBACA,yBACA,0BACA,YACA,oBACA,aACA,YACA,WACA,kBACA,cACA,gBAEe;CACjB,IAAM,EAAE,SAAMC,GAAe,GACv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CAAK,IACRA,EAAM,KAAK,MAAM,IAEnBA,GACN,CAACA,CAAK,CAAC;CAGV,OACE,kBAACxK,GAAD;EAA2B,OAAOuE;EAChC,UAAA,kBAACkG,GAAD;GACE,gBAAgBN;GAChB,eACE,kBAAC/J,GAAD;IACE,SAASsK,MAAiBH;IAC1B,WAAW;IACX,SAAS;GACV,CAAA;GAEH,WAAA;GACA,iBAAA;GACkB;GAClB,OAAOA;GAZT,UAAA;IAcE,kBAAC9G,GAAD;KACE,IAAI;MACF,QAAQ;MACR,UAAU;KACZ;KAEA,UAAA,kBAACkH,GAAD;MACS;MACI;MAFb,UAAA,CAIE,kBAACtK,IAAD,CAAmB,CAAA,GACnB,kBAACoD,GAAD;OACE,IAAI;QACF,QAAQ;QACR,aAAaE,GAAM,QAAQE,GAAO,OAAO,qBAAqB,CAAC;QAC/D,OAAO;OACT;OAEA,UAAA,kBAACnE,GAAD;QACE,YAAYyC;QACA;OACb,CAAA;MACE,CAAA,CACU;;IACd,CAAA;IACL,kBAACtB,IAAD;KACyB;KACP;KACM;KACC;KACd;KACT,UAAU+J;KACV,QAAQ9B;KACR,KAAK7E;KACG;IACT,CAAA;IACD,kBAACX,IAAD;KACW;KACT,WAAW8F;KACX,KAAKrF;IACN,CAAA;GACY;;CACU,CAAA;AAE/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"GeoFilter.js","names":[],"sources":["../../src/classes/filters/GeoFilter.ts"],"sourcesContent":["import isArray from 'lodash/isArray';\nimport type { CommonDbStringSetFilter } from '@gen-epix/api-commondb';\nimport type { AutoCompleteOption } from '@gen-epix/ui-core-form/models/form';\n\nimport type { Filter } from '../../models/filter';\nimport type { FilterAbstractKwArgs } from '../abstracts/FilterAbstract';\nimport { FilterAbstract } from '../abstracts/FilterAbstract';\n\nexport interface GeoFilterKwArgs extends FilterAbstractKwArgs {\n options: AutoCompleteOption[];\n}\n\nexport class GeoFilter extends FilterAbstract<string[]> implements Filter<string[], string> {\n public filterValue: string[] = [];\n public initialFilterValue: string[] = [];\n public options: AutoCompleteOption[];\n private readonly optionsMap: Map<string, string> = new Map<string, string>();\n\n public constructor(kwArgs: GeoFilterKwArgs) {\n super({\n filterDimensionId: kwArgs.filterDimensionId,\n filterMode: kwArgs.filterMode,\n filterPriority: kwArgs.filterPriority,\n id: kwArgs.id,\n label: kwArgs.label,\n });\n this.options = kwArgs.options;\n kwArgs.options.forEach(option => {\n this.optionsMap.set(option.value as string, option.label);\n });\n }\n\n public getPresentationValue(value?: unknown): string {\n const usedValues = value as string[] ?? this.filterValue;\n return usedValues.map(v => this.optionsMap.get(v)).join(', ');\n }\n\n public matchRowValue(rowValue: string): boolean {\n if (!this.filterValue) {\n return true;\n }\n\n if (!this.filterValue || !isArray(this.filterValue) || this.filterValue.length === 0) {\n return true;\n }\n return (this.filterValue).includes(rowValue);\n }\n\n public toBackendFilter(): CommonDbStringSetFilter {\n if (this.isInitialFilterValue()) {\n return;\n }\n\n return {\n key: this.id,\n members: this.filterValue,\n type: 'STRING_SET',\n };\n }\n}\n"],"mappings":";;;;mCAYa,IAAb,cAA+B,EAA6D;CAC1F,cAA+B,CAAC;CAChC,qBAAsC,CAAC;CACvC;CACA,6BAAmD,IAAI,IAAoB;CAE3E,YAAmB,GAAyB;EAS1C,AARA,MAAM;GACJ,mBAAmB,EAAO;GAC1B,YAAY,EAAO;GACnB,gBAAgB,EAAO;GACvB,IAAI,EAAO;GACX,OAAO,EAAO;EAChB,CAAC,GACD,KAAK,UAAU,EAAO,SACtB,EAAO,QAAQ,SAAQ,MAAU;GAC/B,KAAK,WAAW,IAAI,EAAO,OAAiB,EAAO,KAAK;EAC1D,CAAC;CACH;CAEA,qBAA4B,GAAyB;EAEnD,QADmB,KAAqB,KAAK,YAAA,CAC3B,KAAI,MAAK,KAAK,WAAW,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;CAC9D;CAEA,cAAqB,GAA2B;EAQ9C,OAPI,CAAC,KAAK,eAIN,CAAC,KAAK,eAAe,EAAA,GAAC,EAAA,QAAA,CAAQ,KAAK,WAAW,KAAK,KAAK,YAAY,WAAW,KAG3E,KAAK,YAAa,SAAS,CAAQ;CAC7C;CAEA,kBAAkD;EAC5C,UAAK,qBAAqB,GAI9B,OAAO;GACL,KAAK,KAAK;GACV,SAAS,KAAK;GACd,MAAM;EACR;CACF;AACF"}
1
+ {"version":3,"file":"GeoFilter.js","names":["isArray","__toESM","require_isArray","import_isArray","GeoFilter","FilterAbstract","kwArgs","option","value","v","rowValue"],"sources":["../../src/classes/filters/GeoFilter.ts"],"sourcesContent":["import isArray from 'lodash/isArray';\nimport type { CommonDbStringSetFilter } from '@gen-epix/api-commondb';\nimport type { AutoCompleteOption } from '@gen-epix/ui-core-form/models/form.models';\n\nimport type { Filter } from '../../models/filter.models';\nimport type { FilterAbstractKwArgs } from '../abstracts/FilterAbstract';\nimport { FilterAbstract } from '../abstracts/FilterAbstract';\n\nexport interface GeoFilterKwArgs extends FilterAbstractKwArgs {\n options: AutoCompleteOption[];\n}\n\nexport class GeoFilter extends FilterAbstract<string[]> implements Filter<string[], string> {\n public filterValue: string[] = [];\n public initialFilterValue: string[] = [];\n public options: AutoCompleteOption[];\n private readonly optionsMap: Map<string, string> = new Map<string, string>();\n\n public constructor(kwArgs: GeoFilterKwArgs) {\n super({\n filterDimensionId: kwArgs.filterDimensionId,\n filterMode: kwArgs.filterMode,\n filterPriority: kwArgs.filterPriority,\n id: kwArgs.id,\n label: kwArgs.label,\n });\n this.options = kwArgs.options;\n kwArgs.options.forEach(option => {\n this.optionsMap.set(option.value as string, option.label);\n });\n }\n\n public getPresentationValue(value?: unknown): string {\n const usedValues = value as string[] ?? this.filterValue;\n return usedValues.map(v => this.optionsMap.get(v)).join(', ');\n }\n\n public matchRowValue(rowValue: string): boolean {\n if (!this.filterValue) {\n return true;\n }\n\n if (!this.filterValue || !isArray(this.filterValue) || this.filterValue.length === 0) {\n return true;\n }\n return (this.filterValue).includes(rowValue);\n }\n\n public toBackendFilter(): CommonDbStringSetFilter {\n if (this.isInitialFilterValue()) {\n return;\n }\n\n return {\n key: this.id,\n members: this.filterValue,\n type: 'STRING_SET',\n };\n }\n}\n"],"mappings":";;;;mCAYaI,IAAb,cAA+BC,EAA6D;CAC1F,cAA+B,CAAC;CAChC,qBAAsC,CAAC;CACvC;CACA,6BAAmD,IAAI,IAAoB;CAE3E,YAAmB,GAAyB;EAS1C,AARA,MAAM;GACJ,mBAAmBC,EAAO;GAC1B,YAAYA,EAAO;GACnB,gBAAgBA,EAAO;GACvB,IAAIA,EAAO;GACX,OAAOA,EAAO;EAChB,CAAC,GACD,KAAK,UAAUA,EAAO,SACtBA,EAAO,QAAQ,SAAQ,MAAU;GAC/B,KAAK,WAAW,IAAIC,EAAO,OAAiBA,EAAO,KAAK;EAC1D,CAAC;CACH;CAEA,qBAA4B,GAAyB;EAEnD,QADmBC,KAAqB,KAAK,YAAA,CAC3B,KAAI,MAAK,KAAK,WAAW,IAAIC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;CAC9D;CAEA,cAAqB,GAA2B;EAQ9C,OAPI,CAAC,KAAK,eAIN,CAAC,KAAK,eAAe,EAAA,GAACT,EAAAA,QAAAA,CAAQ,KAAK,WAAW,KAAK,KAAK,YAAY,WAAW,KAG3E,KAAK,YAAa,SAASU,CAAQ;CAC7C;CAEA,kBAAkD;EAChD,IAAI,MAAK,qBAAqB,GAI9B,OAAO;GACL,KAAK,KAAK;GACV,SAAS,KAAK;GACd,MAAM;EACR;CACF;AACF"}
@@ -1,125 +1,126 @@
1
1
  import { TimeUtil as e } from "../utils/TimeUtil/index.js";
2
2
  import { NotificationService as t } from "../classes/services/NotificationService/index.js";
3
- import { Alert as n, AlertTitle as r, Box as i, Button as a, CircularProgress as o, Divider as s, Drawer as c, IconButton as l, Snackbar as u, Typography as d, useTheme as f } from "@mui/material";
4
- import { useCallback as p, useMemo as m } from "react";
5
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
6
- import { useTranslation as v } from "react-i18next";
7
- import { TestIdUtil as y } from "@gen-epix/ui-core/utils/TestIdUtil";
8
- import { useSubscribable as b } from "@gen-epix/ui-core/hooks/useSubscribable";
9
- import x from "@mui/icons-material/Close";
10
- import S from "@mui/icons-material/Notifications";
3
+ import { container as n } from "tsyringe";
4
+ import { useCallback as r, useMemo as i } from "react";
5
+ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
6
+ import { Alert as c, AlertTitle as l, Box as u, Button as d, CircularProgress as f, Divider as p, Drawer as m, IconButton as h, Snackbar as g, Typography as _, useTheme as v } from "@mui/material";
7
+ import { useTranslation as y } from "react-i18next";
8
+ import { TestIdUtil as b } from "@gen-epix/ui-core/utils/TestIdUtil";
9
+ import { useSubscribable as x } from "@gen-epix/ui-core/hooks/useSubscribable";
10
+ import S from "@mui/icons-material/Close";
11
+ import C from "@mui/icons-material/Notifications";
11
12
  //#region src/components/ui/Notifications/NotificationItem.tsx
12
- var C = ({ allowClose: t, notification: a, onClose: s, showTimestamp: c }) => {
13
- let { t: l } = v(), u = p(() => {
14
- s(a.key);
15
- }, [a.key, s]), d = m(() => (/* @__PURE__ */ new Date()).getTime(), []);
16
- return /* @__PURE__ */ _(n, {
17
- ...y.createAttributes("NotificationItem", { key: a.key }),
18
- closeText: l`Clear notification`,
19
- icon: a.isLoading ? /* @__PURE__ */ g(o, { size: 16 }) : void 0,
20
- onClose: t ? u : void 0,
21
- severity: a.isLoading ? "info" : a.severity,
13
+ var w = ({ allowClose: t, notification: n, onClose: a, showTimestamp: d }) => {
14
+ let { t: p } = y(), m = r(() => {
15
+ a(n.key);
16
+ }, [n.key, a]), h = i(() => (/* @__PURE__ */ new Date()).getTime(), []);
17
+ return /* @__PURE__ */ s(c, {
18
+ ...b.createAttributes("NotificationItem", { key: n.key }),
19
+ closeText: p`Clear notification`,
20
+ icon: n.isLoading ? /* @__PURE__ */ o(f, { size: 16 }) : void 0,
21
+ onClose: t ? m : void 0,
22
+ severity: n.isLoading ? "info" : n.severity,
22
23
  slotProps: { message: { sx: { flexGrow: 1 } } },
23
24
  sx: {
24
25
  backgroundColor: "background.paper",
25
26
  boxShadow: 1,
26
27
  marginBottom: 1
27
28
  },
28
- children: [/* @__PURE__ */ g(r, {
29
+ children: [/* @__PURE__ */ o(l, {
29
30
  sx: { width: "100%" },
30
- children: a.message
31
- }), c && /* @__PURE__ */ _(i, {
31
+ children: n.message
32
+ }), d && /* @__PURE__ */ s(u, {
32
33
  sx: { textAlign: "right" },
33
34
  children: [
34
- e.getReadableTimeRemaining(d - a.timestamp, !0),
35
+ e.getReadableTimeRemaining(h - n.timestamp, !0),
35
36
  " ",
36
- l("ago")
37
+ p("ago")
37
38
  ]
38
39
  })]
39
40
  });
40
- }, w = ({ onDrawerClose: e, open: n }) => {
41
- let { t: r } = v(), o = f(), u = b(t.getInstance()), m = p((e) => {
42
- t.getInstance().clearNotification(e);
43
- }, []), h = p(() => {
44
- t.getInstance().clearNotifications(), e();
41
+ }, T = ({ onDrawerClose: e, open: i }) => {
42
+ let { t: a } = y(), c = v(), l = x(n.resolve(t)), f = r((e) => {
43
+ n.resolve(t).clearNotification(e);
44
+ }, []), g = r(() => {
45
+ n.resolve(t).clearNotifications(), e();
45
46
  }, [e]);
46
- return /* @__PURE__ */ g(c, {
47
+ return /* @__PURE__ */ o(m, {
47
48
  anchor: "right",
48
49
  onClose: e,
49
- open: n,
50
- children: /* @__PURE__ */ _(i, {
50
+ open: i,
51
+ children: /* @__PURE__ */ s(u, {
51
52
  sx: {
52
- padding: o.spacing(2),
53
- [o.breakpoints.up("xl")]: { width: "620px" },
53
+ padding: c.spacing(2),
54
+ [c.breakpoints.up("xl")]: { width: "620px" },
54
55
  width: "520px"
55
56
  },
56
57
  children: [
57
- /* @__PURE__ */ _(i, {
58
+ /* @__PURE__ */ s(u, {
58
59
  sx: {
59
60
  alignItems: "center",
60
61
  display: "flex",
61
62
  justifyContent: "space-between",
62
63
  marginBottom: 2
63
64
  },
64
- children: [/* @__PURE__ */ g(d, {
65
+ children: [/* @__PURE__ */ o(_, {
65
66
  component: "h6",
66
67
  variant: "h3",
67
- children: r`Notifications`
68
- }), /* @__PURE__ */ g(l, {
69
- "aria-label": r`Close notifications drawer`,
68
+ children: a`Notifications`
69
+ }), /* @__PURE__ */ o(h, {
70
+ "aria-label": a`Close notifications drawer`,
70
71
  onClick: e,
71
- children: /* @__PURE__ */ g(x, { sx: {
72
- "&:hover": { color: o.palette.text.primary },
73
- color: o.palette.text.secondary
72
+ children: /* @__PURE__ */ o(S, { sx: {
73
+ "&:hover": { color: c.palette.text.primary },
74
+ color: c.palette.text.secondary
74
75
  } })
75
76
  })]
76
77
  }),
77
- u.length === 0 && /* @__PURE__ */ _(i, { children: [/* @__PURE__ */ g(i, {
78
+ l.length === 0 && /* @__PURE__ */ s(u, { children: [/* @__PURE__ */ o(u, {
78
79
  sx: {
79
80
  display: "flex",
80
81
  justifyContent: "center",
81
82
  marginBottom: 2
82
83
  },
83
- children: /* @__PURE__ */ g(S, { sx: {
84
- color: o.palette.text.disabled,
84
+ children: /* @__PURE__ */ o(C, { sx: {
85
+ color: c.palette.text.disabled,
85
86
  fontSize: 100
86
87
  } })
87
- }), /* @__PURE__ */ g(i, {
88
+ }), /* @__PURE__ */ o(u, {
88
89
  sx: {
89
90
  display: "flex",
90
91
  justifyContent: "center"
91
92
  },
92
- children: /* @__PURE__ */ g(d, { children: r`No new notifications in this session` })
93
+ children: /* @__PURE__ */ o(_, { children: a`No new notifications in this session` })
93
94
  })] }),
94
- u.length > 0 && /* @__PURE__ */ _(i, { children: [
95
- /* @__PURE__ */ g(i, {
95
+ l.length > 0 && /* @__PURE__ */ s(u, { children: [
96
+ /* @__PURE__ */ o(u, {
96
97
  sx: {
97
98
  display: "flex",
98
99
  justifyContent: "flex-end"
99
100
  },
100
- children: /* @__PURE__ */ g(a, {
101
- "aria-label": r`Clear all notifications`,
101
+ children: /* @__PURE__ */ o(d, {
102
+ "aria-label": a`Clear all notifications`,
102
103
  color: "primary",
103
- onClick: h,
104
+ onClick: g,
104
105
  variant: "outlined",
105
- children: r`Clear all notifications`
106
+ children: a`Clear all notifications`
106
107
  })
107
108
  }),
108
- /* @__PURE__ */ g(i, {
109
+ /* @__PURE__ */ o(u, {
109
110
  sx: { marginY: 2 },
110
- children: /* @__PURE__ */ g(s, {})
111
+ children: /* @__PURE__ */ o(p, {})
111
112
  }),
112
- /* @__PURE__ */ g(i, {
113
+ /* @__PURE__ */ o(u, {
113
114
  sx: { overflowY: "hidden" },
114
- children: /* @__PURE__ */ g(i, {
115
+ children: /* @__PURE__ */ o(u, {
115
116
  sx: {
116
117
  maxHeight: "100%",
117
118
  overflowY: "auto"
118
119
  },
119
- children: u.map((e) => /* @__PURE__ */ g(C, {
120
+ children: l.map((e) => /* @__PURE__ */ o(w, {
120
121
  allowClose: !e.isLoading,
121
122
  notification: e,
122
- onClose: m,
123
+ onClose: f,
123
124
  showTimestamp: !0
124
125
  }, e.key))
125
126
  })
@@ -128,25 +129,25 @@ var C = ({ allowClose: t, notification: a, onClose: s, showTimestamp: c }) => {
128
129
  ]
129
130
  })
130
131
  });
131
- }, T = () => {
132
- let e = b(t.getInstance(), { select: (e) => e.filter((e) => e.visible) }), n = p((e) => {
133
- t.getInstance().hideNotification(e);
132
+ }, E = () => {
133
+ let e = x(n.resolve(t), { select: (e) => e.filter((e) => e.visible) }), i = r((e) => {
134
+ n.resolve(t).hideNotification(e);
134
135
  }, []);
135
- return /* @__PURE__ */ g(h, { children: e.length > 0 && /* @__PURE__ */ g(u, {
136
- ...y.createAttributes("NotificationsStack"),
136
+ return /* @__PURE__ */ o(a, { children: e.length > 0 && /* @__PURE__ */ o(g, {
137
+ ...b.createAttributes("NotificationsStack"),
137
138
  anchorOrigin: {
138
139
  horizontal: "right",
139
140
  vertical: "top"
140
141
  },
141
142
  open: !0,
142
- children: /* @__PURE__ */ g(i, { children: e.map((e) => /* @__PURE__ */ g(C, {
143
+ children: /* @__PURE__ */ o(u, { children: e.map((e) => /* @__PURE__ */ o(w, {
143
144
  allowClose: !0,
144
145
  notification: e,
145
- onClose: n
146
+ onClose: i
146
147
  }, e.key)) })
147
148
  }) });
148
149
  };
149
150
  //#endregion
150
- export { w as n, T as t };
151
+ export { T as n, E as t };
151
152
 
152
153
  //# sourceMappingURL=Notifications.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Notifications.js","names":[],"sources":["../../src/components/ui/Notifications/NotificationItem.tsx","../../src/components/ui/Notifications/NotificationsDrawer.tsx","../../src/components/ui/Notifications/NotificationsStack.tsx"],"sourcesContent":["import {\n Alert,\n AlertTitle,\n Box,\n CircularProgress,\n} from '@mui/material';\nimport {\n useCallback,\n useMemo,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nimport { TimeUtil } from '../../../utils/TimeUtil';\nimport type { Notification } from '../../../models/notification';\n\nexport type NotificationItemProps = {\n readonly allowClose: boolean;\n readonly notification: Notification;\n readonly onClose: (key: string) => void;\n readonly showTimestamp?: boolean;\n};\n\nexport const NotificationItem = ({ allowClose, notification, onClose, showTimestamp }: NotificationItemProps) => {\n const { t } = useTranslation();\n\n const onCloseButtonClick = useCallback(() => {\n onClose(notification.key);\n }, [notification.key, onClose]);\n\n const now = useMemo(() => new Date().getTime(), []);\n\n return (\n <Alert\n {...TestIdUtil.createAttributes('NotificationItem', { key: notification.key })}\n closeText={t`Clear notification`}\n icon={notification.isLoading ? <CircularProgress size={16} /> : undefined}\n onClose={allowClose ? onCloseButtonClick : undefined}\n severity={notification.isLoading ? 'info' : notification.severity}\n slotProps={{\n message: {\n sx: {\n flexGrow: 1,\n },\n },\n }}\n sx={{\n backgroundColor: 'background.paper',\n boxShadow: 1,\n marginBottom: 1,\n }}\n >\n <AlertTitle\n sx={{\n width: '100%',\n }}\n >\n {notification.message}\n </AlertTitle>\n {showTimestamp && (\n <Box\n sx={{\n textAlign: 'right',\n }}\n >\n {TimeUtil.getReadableTimeRemaining(now - notification.timestamp, true)}\n {' '}\n {t('ago')}\n </Box>\n )}\n </Alert>\n );\n};\n","import {\n Box,\n Button,\n Divider,\n Drawer,\n IconButton,\n Typography,\n useTheme,\n} from '@mui/material';\nimport CloseIcon from '@mui/icons-material/Close';\nimport NotificationsIcon from '@mui/icons-material/Notifications';\nimport { useCallback } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useSubscribable } from '@gen-epix/ui-core/hooks/useSubscribable';\n\nimport { NotificationService } from '../../../classes/services/NotificationService';\n\nimport { NotificationItem } from './NotificationItem';\n\nexport type NotificationsDrawerProps = {\n readonly onDrawerClose: () => void;\n readonly open: boolean;\n};\n\nexport const NotificationsDrawer = ({ onDrawerClose, open }: NotificationsDrawerProps) => {\n const { t } = useTranslation();\n const theme = useTheme();\n const notifications = useSubscribable(NotificationService.getInstance());\n\n const onNotificationItemClose = useCallback((key: string) => {\n NotificationService.getInstance().clearNotification(key);\n }, []);\n\n const onClearAllButtonClick = useCallback(() => {\n NotificationService.getInstance().clearNotifications();\n onDrawerClose();\n }, [onDrawerClose]);\n\n return (\n <Drawer\n anchor={'right'}\n onClose={onDrawerClose}\n open={open}\n >\n <Box\n sx={{\n padding: theme.spacing(2),\n [theme.breakpoints.up('xl')]: {\n width: '620px',\n },\n width: '520px',\n }}\n >\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'space-between',\n marginBottom: 2,\n }}\n >\n <Typography\n component={'h6'}\n variant={'h3'}\n >\n {t`Notifications`}\n </Typography>\n <IconButton\n aria-label={t`Close notifications drawer`}\n onClick={onDrawerClose}\n >\n <CloseIcon\n sx={{\n '&:hover': {\n color: theme.palette.text.primary,\n },\n color: theme.palette.text.secondary,\n }}\n />\n </IconButton>\n </Box>\n {notifications.length === 0 && (\n <Box>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'center',\n marginBottom: 2,\n }}\n >\n <NotificationsIcon\n sx={{\n color: theme.palette.text.disabled,\n fontSize: 100,\n }}\n />\n </Box>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'center',\n }}\n >\n <Typography>\n {t`No new notifications in this session`}\n </Typography>\n </Box>\n </Box>\n )}\n {notifications.length > 0 && (\n <Box>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'flex-end',\n }}\n >\n <Button\n aria-label={t`Clear all notifications`}\n color={'primary'}\n onClick={onClearAllButtonClick}\n variant={'outlined'}\n >\n {t`Clear all notifications`}\n </Button>\n </Box>\n <Box\n sx={{\n marginY: 2,\n }}\n >\n <Divider />\n </Box>\n <Box\n sx={{\n overflowY: 'hidden',\n }}\n >\n <Box\n sx={{\n maxHeight: '100%',\n overflowY: 'auto',\n }}\n >\n {notifications.map(notification => (\n <NotificationItem\n allowClose={!notification.isLoading}\n key={notification.key}\n notification={notification}\n onClose={onNotificationItemClose}\n showTimestamp\n />\n ))}\n </Box>\n </Box>\n </Box>\n )}\n </Box>\n </Drawer>\n );\n};\n","import type { ReactElement } from 'react';\nimport { useCallback } from 'react';\nimport {\n Box,\n Snackbar,\n} from '@mui/material';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { useSubscribable } from '@gen-epix/ui-core/hooks/useSubscribable';\n\nimport { NotificationService } from '../../../classes/services/NotificationService';\n\nimport { NotificationItem } from './NotificationItem';\n\nexport const NotificationsStack = (): ReactElement => {\n const visibleNotifications = useSubscribable(NotificationService.getInstance(), {\n select: (notifications) => notifications.filter(notification => notification.visible),\n });\n\n const onNotificationItemClose = useCallback((key: string) => {\n NotificationService.getInstance().hideNotification(key);\n }, []);\n\n return (\n <>\n {visibleNotifications.length > 0 && (\n <Snackbar\n {...TestIdUtil.createAttributes('NotificationsStack')}\n anchorOrigin={{ horizontal: 'right', vertical: 'top' }}\n open\n >\n <Box>\n {visibleNotifications.map(notification => (\n <NotificationItem\n allowClose\n key={notification.key}\n notification={notification}\n onClose={onNotificationItemClose}\n />\n ))}\n </Box>\n </Snackbar>\n )}\n </>\n );\n};\n"],"mappings":";;;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AI,EACF,WAAW,SACb;MAEA,UAAA,kBAAC,GAAD;OACE,IAAI;QACF,WAAW;QACX,WAAW;OACb;OAEC,UAAA,EAAc,KAAI,MACjB,kBAAC,GAAD;QACE,YAAY,CAAC,EAAa;QAEZ;QACd,SAAS;QACT,eAAA;OACD,GAJM,EAAa,GAInB,CACF;MACE,CAAA;KACF,CAAA;IACF,EAAA,CAAA;GAEJ;;CACC,CAAA;AAEZ,GCnJa,UAAyC;CACpD,IAAM,IAAuB,EAAgB,EAAoB,YAAY,GAAG,EAC9E,SAAS,MAAkB,EAAc,QAAO,MAAgB,EAAa,OAAO,EACtF,CAAC,GAEK,IAA0B,GAAa,MAAgB;EAC3D,EAAoB,YAAY,CAAC,CAAC,iBAAiB,CAAG;CACxD,GAAG,CAAC,CAAC;CAEL,OACE,kBAAA,GAAA,EAAA,UACG,EAAqB,SAAS,KAC7B,kBAAC,GAAD;EACE,GAAI,EAAW,iBAAiB,oBAAoB;EACpD,cAAc;GAAE,YAAY;GAAS,UAAU;EAAM;EACrD,MAAA;EAEA,UAAA,kBAAC,GAAD,EAAA,UACG,EAAqB,KAAI,MACxB,kBAAC,GAAD;GACE,YAAA;GAEc;GACd,SAAS;EACV,GAHM,EAAa,GAGnB,CACF,EACE,CAAA;CACG,CAAA,EAEZ,CAAA;AAEN"}
1
+ {"version":3,"file":"Notifications.js","names":["rootContainer","rootContainer","_Fragment","Fragment$1","CloseIcon","NotificationsIcon","NotificationItem","useTranslation","onCloseButtonClick","useCallback","notification","onClose","now","useMemo","Alert","TestIdUtil","CircularProgress","allowClose","AlertTitle","showTimestamp","Box","TimeUtil","t","NotificationsDrawer","theme","useTheme","notifications","useSubscribable","container","NotificationService","onNotificationItemClose","key","onClearAllButtonClick","onDrawerClose","Drawer","Typography","IconButton","Button","Divider","NotificationsStack","visibleNotifications","Snackbar"],"sources":["../../src/components/ui/Notifications/NotificationItem.tsx","../../src/components/ui/Notifications/NotificationsDrawer.tsx","../../src/components/ui/Notifications/NotificationsStack.tsx"],"sourcesContent":["import {\n Alert,\n AlertTitle,\n Box,\n CircularProgress,\n} from '@mui/material';\nimport {\n useCallback,\n useMemo,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nimport { TimeUtil } from '../../../utils/TimeUtil';\nimport type { Notification } from '../../../models/notification.models';\n\nexport type NotificationItemProps = {\n readonly allowClose: boolean;\n readonly notification: Notification;\n readonly onClose: (key: string) => void;\n readonly showTimestamp?: boolean;\n};\n\nexport const NotificationItem = ({ allowClose, notification, onClose, showTimestamp }: NotificationItemProps) => {\n const { t } = useTranslation();\n\n const onCloseButtonClick = useCallback(() => {\n onClose(notification.key);\n }, [notification.key, onClose]);\n\n const now = useMemo(() => new Date().getTime(), []);\n\n return (\n <Alert\n {...TestIdUtil.createAttributes('NotificationItem', { key: notification.key })}\n closeText={t`Clear notification`}\n icon={notification.isLoading ? <CircularProgress size={16} /> : undefined}\n onClose={allowClose ? onCloseButtonClick : undefined}\n severity={notification.isLoading ? 'info' : notification.severity}\n slotProps={{\n message: {\n sx: {\n flexGrow: 1,\n },\n },\n }}\n sx={{\n backgroundColor: 'background.paper',\n boxShadow: 1,\n marginBottom: 1,\n }}\n >\n <AlertTitle\n sx={{\n width: '100%',\n }}\n >\n {notification.message}\n </AlertTitle>\n {showTimestamp && (\n <Box\n sx={{\n textAlign: 'right',\n }}\n >\n {TimeUtil.getReadableTimeRemaining(now - notification.timestamp, true)}\n {' '}\n {t('ago')}\n </Box>\n )}\n </Alert>\n );\n};\n","import { container as rootContainer } from 'tsyringe';\nimport {\n Box,\n Button,\n Divider,\n Drawer,\n IconButton,\n Typography,\n useTheme,\n} from '@mui/material';\nimport CloseIcon from '@mui/icons-material/Close';\nimport NotificationsIcon from '@mui/icons-material/Notifications';\nimport { useCallback } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useSubscribable } from '@gen-epix/ui-core/hooks/useSubscribable';\n\nimport { NotificationService } from '../../../classes/services/NotificationService';\n\nimport { NotificationItem } from './NotificationItem';\n\nexport type NotificationsDrawerProps = {\n readonly onDrawerClose: () => void;\n readonly open: boolean;\n};\n\nexport const NotificationsDrawer = ({ onDrawerClose, open }: NotificationsDrawerProps) => {\n const { t } = useTranslation();\n const theme = useTheme();\n const notifications = useSubscribable(rootContainer.resolve(NotificationService));\n\n const onNotificationItemClose = useCallback((key: string) => {\n rootContainer.resolve(NotificationService).clearNotification(key);\n }, []);\n\n const onClearAllButtonClick = useCallback(() => {\n rootContainer.resolve(NotificationService).clearNotifications();\n onDrawerClose();\n }, [onDrawerClose]);\n\n return (\n <Drawer\n anchor={'right'}\n onClose={onDrawerClose}\n open={open}\n >\n <Box\n sx={{\n padding: theme.spacing(2),\n [theme.breakpoints.up('xl')]: {\n width: '620px',\n },\n width: '520px',\n }}\n >\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'space-between',\n marginBottom: 2,\n }}\n >\n <Typography\n component={'h6'}\n variant={'h3'}\n >\n {t`Notifications`}\n </Typography>\n <IconButton\n aria-label={t`Close notifications drawer`}\n onClick={onDrawerClose}\n >\n <CloseIcon\n sx={{\n '&:hover': {\n color: theme.palette.text.primary,\n },\n color: theme.palette.text.secondary,\n }}\n />\n </IconButton>\n </Box>\n {notifications.length === 0 && (\n <Box>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'center',\n marginBottom: 2,\n }}\n >\n <NotificationsIcon\n sx={{\n color: theme.palette.text.disabled,\n fontSize: 100,\n }}\n />\n </Box>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'center',\n }}\n >\n <Typography>\n {t`No new notifications in this session`}\n </Typography>\n </Box>\n </Box>\n )}\n {notifications.length > 0 && (\n <Box>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'flex-end',\n }}\n >\n <Button\n aria-label={t`Clear all notifications`}\n color={'primary'}\n onClick={onClearAllButtonClick}\n variant={'outlined'}\n >\n {t`Clear all notifications`}\n </Button>\n </Box>\n <Box\n sx={{\n marginY: 2,\n }}\n >\n <Divider />\n </Box>\n <Box\n sx={{\n overflowY: 'hidden',\n }}\n >\n <Box\n sx={{\n maxHeight: '100%',\n overflowY: 'auto',\n }}\n >\n {notifications.map(notification => (\n <NotificationItem\n allowClose={!notification.isLoading}\n key={notification.key}\n notification={notification}\n onClose={onNotificationItemClose}\n showTimestamp\n />\n ))}\n </Box>\n </Box>\n </Box>\n )}\n </Box>\n </Drawer>\n );\n};\n","import { container as rootContainer } from 'tsyringe';\nimport type { ReactElement } from 'react';\nimport { useCallback } from 'react';\nimport {\n Box,\n Snackbar,\n} from '@mui/material';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { useSubscribable } from '@gen-epix/ui-core/hooks/useSubscribable';\n\nimport { NotificationService } from '../../../classes/services/NotificationService';\n\nimport { NotificationItem } from './NotificationItem';\n\nexport const NotificationsStack = (): ReactElement => {\n const visibleNotifications = useSubscribable(rootContainer.resolve(NotificationService), {\n select: (notifications) => notifications.filter(notification => notification.visible),\n });\n\n const onNotificationItemClose = useCallback((key: string) => {\n rootContainer.resolve(NotificationService).hideNotification(key);\n }, []);\n\n return (\n <>\n {visibleNotifications.length > 0 && (\n <Snackbar\n {...TestIdUtil.createAttributes('NotificationsStack')}\n anchorOrigin={{ horizontal: 'right', vertical: 'top' }}\n open\n >\n <Box>\n {visibleNotifications.map(notification => (\n <NotificationItem\n allowClose\n key={notification.key}\n notification={notification}\n onClose={onNotificationItemClose}\n />\n ))}\n </Box>\n </Snackbar>\n )}\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAuBA,IAAaM,KAAoB,EAAE,eAAY,iBAAc,YAAS,uBAA2C;CAC/G,IAAM,EAAE,SAAMC,EAAe,GAEvBC,IAAqBC,QAAkB;EAC3C,EAAQC,EAAa,GAAG;CAC1B,GAAG,CAACA,EAAa,KAAKC,CAAO,CAAC,GAExBC,IAAMC,yBAAc,IAAI,KAAK,EAAA,CAAE,QA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