@gen-epix/ui-client-common 4.3.1 → 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 (419) 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 +406 -117
  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/AppRouterProvider/AppRouterProvider.d.ts +1 -1
  127. package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +50 -49
  128. package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
  129. package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +42 -41
  130. package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -1
  131. package/dist/components/app/AuthenticationWrapper/AuthenticationWrapper.d.ts +1 -1
  132. package/dist/components/app/AuthenticationWrapper/index.js +68 -67
  133. package/dist/components/app/AuthenticationWrapper/index.js.map +1 -1
  134. package/dist/components/app/AuthorizationWrapper/index.js +33 -32
  135. package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
  136. package/dist/components/app/RouterRoot/RouterRoot.d.ts +1 -1
  137. package/dist/components/app/RouterRoot/index.js +62 -61
  138. package/dist/components/app/RouterRoot/index.js.map +1 -1
  139. package/dist/components/epi/EpiContactDetailsDialog/index.js +38 -37
  140. package/dist/components/epi/EpiContactDetailsDialog/index.js.map +1 -1
  141. package/dist/components/filters/BooleanFilterField/BooleanFilterField.d.ts +1 -1
  142. package/dist/components/filters/BooleanFilterField/index.js +5 -5
  143. package/dist/components/filters/BooleanFilterField/index.js.map +1 -1
  144. package/dist/components/filters/DateFilterField/DateFilterField.d.ts +1 -1
  145. package/dist/components/filters/DateFilterField/index.js +3 -3
  146. package/dist/components/filters/DateFilterField/index.js.map +1 -1
  147. package/dist/components/filters/GeoFilterField/GeoFilterField.d.ts +1 -1
  148. package/dist/components/filters/GeoFilterField/index.js +4 -4
  149. package/dist/components/filters/GeoFilterField/index.js.map +1 -1
  150. package/dist/components/filters/MultiSelectFilterField/MultiSelectFilterField.d.ts +1 -1
  151. package/dist/components/filters/MultiSelectFilterField/index.js +4 -4
  152. package/dist/components/filters/MultiSelectFilterField/index.js.map +1 -1
  153. package/dist/components/filters/NumberRangeFilterField/NumberRangeFilterField.d.ts +1 -1
  154. package/dist/components/filters/NumberRangeFilterField/index.js +3 -3
  155. package/dist/components/filters/NumberRangeFilterField/index.js.map +1 -1
  156. package/dist/components/filters/TextFilterField/TextFilterField.d.ts +1 -1
  157. package/dist/components/filters/TextFilterField/index.js +3 -3
  158. package/dist/components/filters/TextFilterField/index.js.map +1 -1
  159. package/dist/components/ui/ApplicationBar/ApplicationBar.d.ts +1 -1
  160. package/dist/components/ui/ApplicationBar/ApplicationBarActions.d.ts +1 -1
  161. package/dist/components/ui/ApplicationBar/ApplicationBarActionsFeedbackItem.d.ts +1 -1
  162. package/dist/components/ui/ApplicationBar/ApplicationBarActionsInfotem.d.ts +1 -1
  163. package/dist/components/ui/ApplicationBar/ApplicationBarActionsNotificationsItem.d.ts +1 -1
  164. package/dist/components/ui/ApplicationBar/ApplicationBarActionsOrganizationSwitcherItem.d.ts +1 -1
  165. package/dist/components/ui/ApplicationBar/ApplicationBarActionsOutagesItem.d.ts +1 -1
  166. package/dist/components/ui/ApplicationBar/ApplicationBarActionsUserItem.d.ts +1 -1
  167. package/dist/components/ui/ApplicationBar/ApplicationBarNavigationMenu.d.ts +1 -1
  168. package/dist/components/ui/ApplicationBar/UserOrganizationAdminMenuItem.d.ts +1 -1
  169. package/dist/components/ui/ApplicationBar/UserOwnOrganizationMenuItem.d.ts +1 -1
  170. package/dist/components/ui/ApplicationBar/index.js +242 -241
  171. package/dist/components/ui/ApplicationBar/index.js.map +1 -1
  172. package/dist/components/ui/ApplicationFooter/ApplicationFooter.d.ts +1 -1
  173. package/dist/components/ui/ApplicationFooter/ApplicationFooterLink.d.ts +1 -1
  174. package/dist/components/ui/ApplicationFooter/ApplicationFooterLinkSection.d.ts +1 -1
  175. package/dist/components/ui/ApplicationFooter/index.js +1 -2
  176. package/dist/components/ui/Breadcrumbs/Breadcrumb.d.ts +1 -1
  177. package/dist/components/ui/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  178. package/dist/components/ui/Breadcrumbs/index.js +1 -2
  179. package/dist/components/ui/ConsentDialog/index.js +11 -6
  180. package/dist/components/ui/ConsentDialog/index.js.map +1 -1
  181. package/dist/components/ui/GenericErrorMessage/GenericErrorMessage.d.ts +1 -1
  182. package/dist/components/ui/GenericErrorMessage/index.js +51 -50
  183. package/dist/components/ui/GenericErrorMessage/index.js.map +1 -1
  184. package/dist/components/ui/LicensesDialog/index.js +66 -69
  185. package/dist/components/ui/LicensesDialog/index.js.map +1 -1
  186. package/dist/components/ui/MyPermissionsDialog/index.js +26 -25
  187. package/dist/components/ui/MyPermissionsDialog/index.js.map +1 -1
  188. package/dist/components/ui/NavLink/NavLink.d.ts +1 -1
  189. package/dist/components/ui/NavLink/index.js +6 -6
  190. package/dist/components/ui/NavLink/index.js.map +1 -1
  191. package/dist/components/ui/Notifications/NotificationItem.d.ts +2 -2
  192. package/dist/components/ui/Notifications/NotificationsDrawer.d.ts +1 -1
  193. package/dist/components/ui/Notifications/index.js +1 -2
  194. package/dist/components/ui/OrganizationSwitcherDialog/index.js +69 -76
  195. package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
  196. package/dist/components/ui/OutageList/OutageItem.d.ts +1 -1
  197. package/dist/components/ui/OutageList/OutageList.d.ts +1 -1
  198. package/dist/components/ui/OutageList/OutageSection.d.ts +1 -1
  199. package/dist/components/ui/OutageList/index.js +1 -2
  200. package/dist/components/ui/OutagesDialog/index.js.map +1 -1
  201. package/dist/components/ui/PageContainer/PageContainer.d.ts +1 -1
  202. package/dist/components/ui/PageContainer/index.js +57 -52
  203. package/dist/components/ui/PageContainer/index.js.map +1 -1
  204. package/dist/components/ui/ResponseHandler/ResponseHandler.d.ts +1 -1
  205. package/dist/components/ui/ResponseHandler/index.js.map +1 -1
  206. package/dist/components/ui/Sidebar/SidebarItem.d.ts +2 -2
  207. package/dist/components/ui/Sidebar/SidebarMenu.d.ts +1 -1
  208. package/dist/components/ui/Sidebar/SidebarMenuItem.d.ts +2 -2
  209. package/dist/components/ui/Sidebar/index.js +45 -45
  210. package/dist/components/ui/Sidebar/index.js.map +1 -1
  211. package/dist/components/ui/SortableList/SortableList.d.ts +1 -1
  212. package/dist/components/ui/SortableList/SortableListItem.d.ts +1 -1
  213. package/dist/components/ui/SortableList/SortableListItemDragHandle.d.ts +1 -1
  214. package/dist/components/ui/SortableList/SortableOverlay.d.ts +1 -1
  215. package/dist/components/ui/SortableList/context/SortableListItemContextProvider.d.ts +1 -1
  216. package/dist/components/ui/Table/Table.d.ts +2 -2
  217. package/dist/components/ui/Table/TableActionsCell.d.ts +2 -2
  218. package/dist/components/ui/Table/TableCaption.d.ts +1 -1
  219. package/dist/components/ui/Table/TableCell.d.ts +2 -2
  220. package/dist/components/ui/Table/TableCellAsyncContent.d.ts +1 -1
  221. package/dist/components/ui/Table/TableCheckboxCell.d.ts +2 -2
  222. package/dist/components/ui/Table/TableCheckboxHeader.d.ts +2 -2
  223. package/dist/components/ui/Table/TableColumnsEditorDialog.d.ts +1 -1
  224. package/dist/components/ui/Table/TableFilter.d.ts +3 -3
  225. package/dist/components/ui/Table/TableFiltersSidebarItem.d.ts +2 -2
  226. package/dist/components/ui/Table/TableHeader.d.ts +1 -1
  227. package/dist/components/ui/Table/TableHeaderCell.d.ts +2 -2
  228. package/dist/components/ui/Table/TableHeaderFilter.d.ts +3 -3
  229. package/dist/components/ui/Table/TableMenu.d.ts +1 -1
  230. package/dist/components/ui/Table/TableReadableIndexCell.d.ts +2 -2
  231. package/dist/components/ui/Table/TableSidebarMenu.d.ts +1 -1
  232. package/dist/components/ui/Table/index.js +1 -2
  233. package/dist/components/ui/UserFeedbackDialog/index.js +65 -64
  234. package/dist/components/ui/UserFeedbackDialog/index.js.map +1 -1
  235. package/dist/components/ui/UserInactivityConfirmation/UserInactivityConfirmation.d.ts +1 -1
  236. package/dist/components/ui/UserInactivityConfirmation/index.js +26 -25
  237. package/dist/components/ui/UserInactivityConfirmation/index.js.map +1 -1
  238. package/dist/constants/config.constants.d.ts +5 -0
  239. package/dist/constants/config.constants.js +6 -0
  240. package/dist/constants/config.constants.js.map +1 -0
  241. package/dist/constants/{query.js → query.constants.js} +2 -2
  242. package/dist/constants/query.constants.js.map +1 -0
  243. package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContext.d.ts +6 -2
  244. package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContextProvider.d.ts +3 -3
  245. package/dist/context/uiClientCommonConfigContext/index.js +28 -12
  246. package/dist/context/uiClientCommonConfigContext/index.js.map +1 -1
  247. package/dist/context/uiClientCommonConfigContext/useUiClientCommonConfigContext.d.ts +2 -1
  248. package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +17 -16
  249. package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js.map +1 -1
  250. package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/useIdentifierIssuerOwnOrganizationQuery.d.ts +1 -1
  251. package/dist/dataHooks/useIdentifierIssuerQuery/index.js +18 -17
  252. package/dist/dataHooks/useIdentifierIssuerQuery/index.js.map +1 -1
  253. package/dist/dataHooks/useIdentifierIssuerQuery/useIdentifierIssuerQuery.d.ts +1 -1
  254. package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +11 -10
  255. package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -1
  256. package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +22 -21
  257. package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js.map +1 -1
  258. package/dist/dataHooks/useOrganizationAdminPoliciesQuery/useOrganizationAdminPoliciesQuery.d.ts +1 -1
  259. package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js +8 -7
  260. package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js.map +1 -1
  261. package/dist/dataHooks/useOrganizationsQuery/index.js +17 -16
  262. package/dist/dataHooks/useOrganizationsQuery/index.js.map +1 -1
  263. package/dist/dataHooks/useOrganizationsQuery/useOrganizationsQuery.d.ts +1 -1
  264. package/dist/dataHooks/useUsersQuery/index.js +18 -17
  265. package/dist/dataHooks/useUsersQuery/index.js.map +1 -1
  266. package/dist/dataHooks/useUsersQuery/useUsersQuery.d.ts +1 -1
  267. package/dist/hoc/withPermissions/index.js +12 -11
  268. package/dist/hoc/withPermissions/index.js.map +1 -1
  269. package/dist/hoc/withPermissions/withPermissions.d.ts +1 -1
  270. package/dist/hooks/useColumnsMenu/index.js +1 -2
  271. package/dist/hooks/useColumnsMenu/useColumnsMenu.d.ts +2 -2
  272. package/dist/hooks/useConfig/index.d.ts +1 -0
  273. package/dist/hooks/useConfig/index.js +7 -0
  274. package/dist/hooks/useConfig/index.js.map +1 -0
  275. package/dist/hooks/useConfig/useConfig.d.ts +2 -0
  276. package/dist/hooks/useCreateMutation/index.js +25 -24
  277. package/dist/hooks/useCreateMutation/index.js.map +1 -1
  278. package/dist/hooks/useCreateMutation/useCreateMutation.d.ts +1 -1
  279. package/dist/hooks/useDeleteMutation/index.js +24 -23
  280. package/dist/hooks/useDeleteMutation/index.js.map +1 -1
  281. package/dist/hooks/useDeleteMutation/useDeleteMutation.d.ts +1 -1
  282. package/dist/hooks/useEditMutation/index.js +33 -32
  283. package/dist/hooks/useEditMutation/index.js.map +1 -1
  284. package/dist/hooks/useEditMutation/useEditMutation.d.ts +1 -1
  285. package/dist/hooks/useInitializeTableStore/index.js.map +1 -1
  286. package/dist/hooks/useInitializeTableStore/useInitializeTableStore.d.ts +1 -1
  287. package/dist/hooks/useItemQuery/index.js +36 -35
  288. package/dist/hooks/useItemQuery/index.js.map +1 -1
  289. package/dist/hooks/useItemQuery/useItemQuery.d.ts +1 -1
  290. package/dist/hooks/useQueryMemo/index.js +1 -2
  291. package/dist/hooks/useUpdateBreadcrumb/index.js +10 -9
  292. package/dist/hooks/useUpdateBreadcrumb/index.js.map +1 -1
  293. package/dist/hooks/useUpdateDocumentTitle/index.js +4 -3
  294. package/dist/hooks/useUpdateDocumentTitle/index.js.map +1 -1
  295. package/dist/models/{admin.js → admin.models.js} +2 -2
  296. package/dist/models/admin.models.js.map +1 -0
  297. package/dist/models/api.models.d.ts +16 -0
  298. package/dist/models/api.models.js +6 -0
  299. package/dist/models/api.models.js.map +1 -0
  300. package/dist/models/{dataHooks.d.ts → data-hooks.models.d.ts} +1 -1
  301. package/dist/models/{table.d.ts → table.models.d.ts} +2 -2
  302. package/dist/models/{table.js → table.models.js} +2 -2
  303. package/dist/models/table.models.js.map +1 -0
  304. package/dist/pages/AcceptInvitationPage/AcceptInvitationPage.d.ts +1 -1
  305. package/dist/pages/AcceptInvitationPage/index.js +40 -39
  306. package/dist/pages/AcceptInvitationPage/index.js.map +1 -1
  307. package/dist/pages/AdminPage/AdminPage.d.ts +1 -1
  308. package/dist/pages/AdminPage/index.js +39 -38
  309. package/dist/pages/AdminPage/index.js.map +1 -1
  310. package/dist/pages/ChooseIdentityProviderPage/ChooseIdentityProviderPage.d.ts +2 -2
  311. package/dist/pages/ChooseIdentityProviderPage/index.js +38 -37
  312. package/dist/pages/ChooseIdentityProviderPage/index.js.map +1 -1
  313. package/dist/pages/CrudPage/CrudPage.d.ts +7 -7
  314. package/dist/pages/CrudPage/CrudPageDeleteDialog.d.ts +1 -1
  315. package/dist/pages/CrudPage/CrudPageEditDialog.d.ts +2 -2
  316. package/dist/pages/CrudPage/index.js +1 -2
  317. package/dist/pages/ErrorPage/ErrorPage.d.ts +1 -1
  318. package/dist/pages/ErrorPage/index.js.map +1 -1
  319. package/dist/pages/IdentifierIssuersAdminPage/IdentifierIssuersAdminPage.d.ts +1 -1
  320. package/dist/pages/IdentifierIssuersAdminPage/index.js +41 -40
  321. package/dist/pages/IdentifierIssuersAdminPage/index.js.map +1 -1
  322. package/dist/pages/OrganizationAdminPoliciesAdminPage/OrganizationAdminPoliciesAdminPage.d.ts +1 -1
  323. package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +58 -57
  324. package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js.map +1 -1
  325. package/dist/pages/OrganizationContactsAdminPage/OrganizationContactsAdminPage.d.ts +1 -1
  326. package/dist/pages/OrganizationContactsAdminPage/index.js +49 -48
  327. package/dist/pages/OrganizationContactsAdminPage/index.js.map +1 -1
  328. package/dist/pages/OrganizationSitesAdminPage/OrganizationSitesAdminPage.d.ts +1 -1
  329. package/dist/pages/OrganizationSitesAdminPage/index.js +44 -43
  330. package/dist/pages/OrganizationSitesAdminPage/index.js.map +1 -1
  331. package/dist/pages/OrganizationsAdminPage/OrganizationsAdminPage.d.ts +1 -1
  332. package/dist/pages/OrganizationsAdminPage/index.js +57 -56
  333. package/dist/pages/OrganizationsAdminPage/index.js.map +1 -1
  334. package/dist/pages/OutagesAdminPage/OutagesAdminPage.d.ts +1 -1
  335. package/dist/pages/OutagesAdminPage/index.js +63 -62
  336. package/dist/pages/OutagesAdminPage/index.js.map +1 -1
  337. package/dist/pages/PostLoginPage/PostLoginPage.d.ts +1 -1
  338. package/dist/pages/PostLoginPage/index.js +14 -13
  339. package/dist/pages/PostLoginPage/index.js.map +1 -1
  340. package/dist/pages/PostLogoutPage/PostLogoutPage.d.ts +1 -1
  341. package/dist/pages/PostLogoutPage/index.js +19 -18
  342. package/dist/pages/PostLogoutPage/index.js.map +1 -1
  343. package/dist/pages/RouterErrorPage/RouterErrorPage.d.ts +1 -1
  344. package/dist/pages/RouterErrorPage/index.js.map +1 -1
  345. package/dist/pages/UserInvitationsAdminPage/UserInvitationsAdminPage.d.ts +1 -1
  346. package/dist/pages/UserInvitationsAdminPage/index.js +1 -2
  347. package/dist/pages/UsersAdminPage/UsersAdminPage.d.ts +2 -2
  348. package/dist/pages/UsersAdminPage/index.js +110 -109
  349. package/dist/pages/UsersAdminPage/index.js.map +1 -1
  350. package/dist/routes/adminRoutes.d.ts +1 -1
  351. package/dist/routes/index.js +1 -1
  352. package/dist/routes/index.js.map +1 -1
  353. package/dist/routes/routes.d.ts +1 -1
  354. package/dist/setup/setup.js.map +1 -1
  355. package/dist/stores/oidcStore/index.js.map +1 -1
  356. package/dist/stores/outagesStore/index.js.map +1 -1
  357. package/dist/stores/outagesStore/outagesStore.d.ts +1 -1
  358. package/dist/stores/tableStore/TableStoreContextProvider.d.ts +1 -1
  359. package/dist/stores/tableStore/index.js +1 -2
  360. package/dist/stores/tableStore/tableStore.d.ts +2 -2
  361. package/dist/theme/demoTheme/index.js.map +1 -1
  362. package/dist/utils/AxiosUtil/index.js.map +1 -1
  363. package/dist/utils/DataHookUtil/DataHookUtil.d.ts +1 -1
  364. package/dist/utils/DataHookUtil/index.js.map +1 -1
  365. package/dist/utils/LoadableUtil/LoadableUtil.d.ts +1 -1
  366. package/dist/utils/LoadableUtil/index.js.map +1 -1
  367. package/dist/utils/MenuDataUtil/MenuDataUtil.d.ts +1 -1
  368. package/dist/utils/MenuDataUtil/index.js.map +1 -1
  369. package/dist/utils/NotificationUtil/index.js.map +1 -1
  370. package/dist/utils/OutageUtil/OutageUtil.d.ts +1 -1
  371. package/dist/utils/OutageUtil/index.js +1 -2
  372. package/dist/utils/StandardConfigUtil/StandardConfigUtil.d.ts +1 -1
  373. package/dist/utils/StandardConfigUtil/index.js.map +1 -1
  374. package/dist/utils/TableUtil/TableUtil.d.ts +4 -4
  375. package/dist/utils/TableUtil/index.js +1 -2
  376. package/dist/utils/TimeUtil/index.js.map +1 -1
  377. package/dist/utils/UserManagerUtil/index.js +1 -2
  378. package/dist/utils/UserUtil/index.js.map +1 -1
  379. package/package.json +93 -87
  380. package/dist/_chunks/_baseGet.js +0 -280
  381. package/dist/_chunks/_baseGet.js.map +0 -1
  382. package/dist/_chunks/_baseIteratee.js +0 -274
  383. package/dist/_chunks/_baseIteratee.js.map +0 -1
  384. package/dist/_chunks/last.js +0 -13
  385. package/dist/_chunks/last.js.map +0 -1
  386. package/dist/_chunks/uniq.js +0 -44
  387. package/dist/_chunks/uniq.js.map +0 -1
  388. package/dist/classes/services/ApiService/ApiService.d.ts +0 -19
  389. package/dist/classes/services/ApiService/index.d.ts +0 -1
  390. package/dist/classes/services/ApiService/index.js +0 -21
  391. package/dist/classes/services/ApiService/index.js.map +0 -1
  392. package/dist/classes/services/ConfigService/ConfigService.d.ts +0 -9
  393. package/dist/classes/services/ConfigService/index.d.ts +0 -1
  394. package/dist/classes/services/ConfigService/index.js +0 -21
  395. package/dist/classes/services/ConfigService/index.js.map +0 -1
  396. package/dist/constants/query.js.map +0 -1
  397. package/dist/models/admin.js.map +0 -1
  398. package/dist/models/api.d.ts +0 -9
  399. package/dist/models/table.js.map +0 -1
  400. package/dist/models/theme.js +0 -0
  401. /package/dist/constants/{query.d.ts → query.constants.d.ts} +0 -0
  402. /package/dist/models/{admin.d.ts → admin.models.d.ts} +0 -0
  403. /package/dist/models/{auth.d.ts → auth.models.d.ts} +0 -0
  404. /package/dist/models/{api.js → auth.models.js} +0 -0
  405. /package/dist/models/{config.d.ts → config.models.d.ts} +0 -0
  406. /package/dist/models/{auth.js → config.models.js} +0 -0
  407. /package/dist/models/{config.js → data-hooks.models.js} +0 -0
  408. /package/dist/models/{data.d.ts → data.models.d.ts} +0 -0
  409. /package/dist/models/{data.js → data.models.js} +0 -0
  410. /package/dist/models/{filter.d.ts → filter.models.d.ts} +0 -0
  411. /package/dist/models/{dataHooks.js → filter.models.js} +0 -0
  412. /package/dist/models/{notification.d.ts → notification.models.d.ts} +0 -0
  413. /package/dist/models/{filter.js → notification.models.js} +0 -0
  414. /package/dist/models/{outage.d.ts → outage.models.d.ts} +0 -0
  415. /package/dist/models/{notification.js → outage.models.js} +0 -0
  416. /package/dist/models/{reactRouter.d.ts → react-router.models.d.ts} +0 -0
  417. /package/dist/models/{outage.js → react-router.models.js} +0 -0
  418. /package/dist/models/{theme.d.ts → theme.models.d.ts} +0 -0
  419. /package/dist/models/{reactRouter.js → theme.models.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/dataHooks/useUsersQuery/useUsersQuery.ts"],"sourcesContent":["import type { UseQueryResult } from '@tanstack/react-query';\nimport { useTranslation } from 'react-i18next';\nimport { useMemo } from 'react';\nimport type { CommonDbUser } from '@gen-epix/api-commondb';\n\nimport type {\n UseMap,\n UseOptions,\n} from '../../models/dataHooks';\nimport { DataHookUtil } from '../../utils/DataHookUtil';\nimport { useQueryMemo } from '../../hooks/useQueryMemo';\nimport { QueryClientService } from '../../classes/services/QueryClientService';\nimport { COMMON_QUERY_KEY } from '../../constants/query';\nimport { ApiService } from '../../classes/services/ApiService';\nimport { UserUtil } from '../../utils/UserUtil';\n\nexport const useUsersQuery = (): UseQueryResult<CommonDbUser[]> => {\n return useQueryMemo({\n queryFn: async ({ signal }) => {\n const response = await ApiService.getInstance().organizationApi.usersGetAll(null, null, { signal });\n return response.data;\n },\n queryKey: QueryClientService.getInstance().getGenericKey(COMMON_QUERY_KEY.USERS),\n });\n};\n\nexport const useUsersMapQuery = (): UseMap<CommonDbUser> => {\n const usersQuery = useUsersQuery();\n\n return useMemo(() => {\n return DataHookUtil.createUseMapDataHook<CommonDbUser>(usersQuery, item => item.id);\n }, [usersQuery]);\n};\n\nexport const useUserOptionsQuery = (): UseOptions<string> => {\n const usersQuery = useUsersQuery();\n const { t } = useTranslation();\n\n return useMemo(() => {\n return DataHookUtil.createUseOptionsDataHook<CommonDbUser>(usersQuery, item => item.id, item => UserUtil.getUserDisplayValue(item, t));\n }, [t, usersQuery]);\n};\n"],"mappings":";;;;;;;;;AAgBA,IAAa,UACJ,EAAa;CAClB,SAAS,OAAO,EAAE,iBAET,MADgB,EAAW,YAAY,CAAC,CAAC,gBAAgB,YAAY,MAAM,MAAM,EAAE,UAAO,CAAC,EAAA,CAClF;CAElB,UAAU,EAAmB,YAAY,CAAC,CAAC,cAAc,EAAiB,KAAK;AACjF,CAAC,GAGU,UAA+C;CAC1D,IAAM,IAAa,EAAc;CAEjC,OAAO,QACE,EAAa,qBAAmC,IAAY,MAAQ,EAAK,EAAE,GACjF,CAAC,CAAU,CAAC;AACjB,GAEa,UAAgD;CAC3D,IAAM,IAAa,EAAc,GAC3B,EAAE,SAAM,EAAe;CAE7B,OAAO,QACE,EAAa,yBAAuC,IAAY,MAAQ,EAAK,KAAI,MAAQ,EAAS,oBAAoB,GAAM,CAAC,CAAC,GACpI,CAAC,GAAG,CAAU,CAAC;AACpB"}
1
+ {"version":3,"file":"index.js","names":["rootContainer","useQueryMemo","useUsersQuery","container","API_ORGANIZATION_TOKEN","QueryClientService","COMMON_QUERY_KEY","useUsersMapQuery","usersQuery","useMemo","DataHookUtil","item","useUserOptionsQuery","useTranslation","UserUtil","t"],"sources":["../../../src/dataHooks/useUsersQuery/useUsersQuery.ts"],"sourcesContent":["import { container as rootContainer } from 'tsyringe';\nimport type { UseQueryResult } from '@tanstack/react-query';\nimport { useTranslation } from 'react-i18next';\nimport { useMemo } from 'react';\nimport type { CommonDbUser } from '@gen-epix/api-commondb';\n\nimport { API_ORGANIZATION_TOKEN } from '../../models/api.models';\nimport type {\n UseMap,\n UseOptions,\n} from '../../models/data-hooks.models';\nimport { DataHookUtil } from '../../utils/DataHookUtil';\nimport { useQueryMemo } from '../../hooks/useQueryMemo';\nimport { QueryClientService } from '../../classes/services/QueryClientService';\nimport { COMMON_QUERY_KEY } from '../../constants/query.constants';\nimport { UserUtil } from '../../utils/UserUtil';\n\nexport const useUsersQuery = (): UseQueryResult<CommonDbUser[]> => {\n return useQueryMemo({\n queryFn: async ({ signal }) => {\n const response = await rootContainer.resolve(API_ORGANIZATION_TOKEN).usersGetAll(null, null, { signal });\n return response.data;\n },\n queryKey: rootContainer.resolve(QueryClientService).getGenericKey(COMMON_QUERY_KEY.USERS),\n });\n};\n\nexport const useUsersMapQuery = (): UseMap<CommonDbUser> => {\n const usersQuery = useUsersQuery();\n\n return useMemo(() => {\n return DataHookUtil.createUseMapDataHook<CommonDbUser>(usersQuery, item => item.id);\n }, [usersQuery]);\n};\n\nexport const useUserOptionsQuery = (): UseOptions<string> => {\n const usersQuery = useUsersQuery();\n const { t } = useTranslation();\n\n return useMemo(() => {\n return DataHookUtil.createUseOptionsDataHook<CommonDbUser>(usersQuery, item => item.id, item => UserUtil.getUserDisplayValue(item, t));\n }, [t, usersQuery]);\n};\n"],"mappings":";;;;;;;;;;AAiBA,IAAaE,UACJD,EAAa;CAClB,SAAS,OAAO,EAAE,iBAET,MADgBD,EAAc,QAAQI,CAAsB,CAAC,CAAC,YAAY,MAAM,MAAM,EAAE,UAAO,CAAC,EAAA,CACvF;CAElB,UAAUJ,EAAc,QAAQK,CAAkB,CAAC,CAAC,cAAcC,EAAiB,KAAK;AAC1F,CAAC,GAGUC,UAA+C;CAC1D,IAAMC,IAAaN,EAAc;CAEjC,OAAOO,QACEC,EAAa,qBAAmCF,IAAY,MAAQG,EAAK,EAAE,GACjF,CAACH,CAAU,CAAC;AACjB,GAEaI,UAAgD;CAC3D,IAAMJ,IAAaN,EAAc,GAC3B,EAAE,SAAMW,EAAe;CAE7B,OAAOJ,QACEC,EAAa,yBAAuCF,IAAY,MAAQG,EAAK,KAAI,MAAQG,EAAS,oBAAoBH,GAAMI,CAAC,CAAC,GACpI,CAACA,GAAGP,CAAU,CAAC;AACpB"}
@@ -1,6 +1,6 @@
1
1
  import { UseQueryResult } from '@tanstack/react-query';
2
2
  import { CommonDbUser } from '@gen-epix/api-commondb';
3
- import { UseMap, UseOptions } from '../../models/dataHooks';
3
+ import { UseMap, UseOptions } from '../../models/data-hooks.models';
4
4
  export declare const useUsersQuery: () => UseQueryResult<CommonDbUser[]>;
5
5
  export declare const useUsersMapQuery: () => UseMap<CommonDbUser>;
6
6
  export declare const useUserOptionsQuery: () => UseOptions<string>;
@@ -1,21 +1,22 @@
1
1
  import { AuthorizationService as e } from "../../classes/services/AuthorizationService/index.js";
2
- import { useMemo as t } from "react";
3
- import { jsx as n } from "react/jsx-runtime";
2
+ import { container as t } from "tsyringe";
3
+ import { useMemo as n } from "react";
4
+ import { jsx as r } from "react/jsx-runtime";
4
5
  //#region src/hoc/withPermissions/withPermissions.tsx
5
- var r = (r, i) => {
6
- let a = (a) => {
7
- if (!t(() => e.getInstance(), []).doesUserHavePermission(i.requiredPermissions)) {
8
- if (i.fallback) {
9
- let e = i.fallback;
10
- return /* @__PURE__ */ n(e, {});
6
+ var i = (i, a) => {
7
+ let o = (o) => {
8
+ if (!n(() => t.resolve(e), []).doesUserHavePermission(a.requiredPermissions)) {
9
+ if (a.fallback) {
10
+ let e = a.fallback;
11
+ return /* @__PURE__ */ r(e, {});
11
12
  }
12
13
  return null;
13
14
  }
14
- return /* @__PURE__ */ n(r, { ...a });
15
+ return /* @__PURE__ */ r(i, { ...o });
15
16
  };
16
- return a.displayName = `withPermissions(${r.displayName || r.name})`, a;
17
+ return o.displayName = `withPermissions(${i.displayName || i.name})`, o;
17
18
  };
18
19
  //#endregion
19
- export { r as withPermissions };
20
+ export { i as withPermissions };
20
21
 
21
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/hoc/withPermissions/withPermissions.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport type { ComponentType } from 'react';\nimport type { CommonDbApiPermission } from '@gen-epix/api-commondb';\n\nimport { AuthorizationService } from '../../classes/services/AuthorizationService';\n\nexport interface WithPermissionsOptions<TApiPermission = CommonDbApiPermission> {\n readonly fallback?: ComponentType | null;\n readonly requiredPermissions: TApiPermission[];\n}\n\nexport const withPermissions = <TApiPermission = CommonDbApiPermission, TProps extends object = Record<string, never>>(\n Component: ComponentType<TProps>,\n options: WithPermissionsOptions<TApiPermission>,\n) => {\n const WrappedComponent = (props: TProps) => {\n const authorizationService = useMemo(() => AuthorizationService.getInstance(), []);\n\n if (!authorizationService.doesUserHavePermission(options.requiredPermissions as CommonDbApiPermission[])) {\n if (options.fallback) {\n const FallbackComponent = options.fallback;\n return <FallbackComponent />;\n }\n return null;\n }\n\n return <Component {...props} />;\n };\n\n // Set display name for better debugging\n WrappedComponent.displayName = `withPermissions(${Component.displayName || Component.name})`;\n\n return WrappedComponent;\n};\n"],"mappings":";;;;AAWA,IAAa,KACX,GACA,MACG;CACH,IAAM,KAAoB,MAAkB;EAG1C,IAAI,CAFyB,QAAc,EAAqB,YAAY,GAAG,CAAC,CAE3E,CAAA,CAAqB,uBAAuB,EAAQ,mBAA8C,GAAG;GACxG,IAAI,EAAQ,UAAU;IACpB,IAAM,IAAoB,EAAQ;IAClC,OAAO,kBAAC,GAAD,CAAoB,CAAA;GAC7B;GACA,OAAO;EACT;EAEA,OAAO,kBAAC,GAAD,EAAW,GAAI,EAAQ,CAAA;CAChC;CAKA,OAFA,EAAiB,cAAc,mBAAmB,EAAU,eAAe,EAAU,KAAK,IAEnF;AACT"}
1
+ {"version":3,"file":"index.js","names":["rootContainer","withPermissions","WrappedComponent","useMemo","container","AuthorizationService","options","FallbackComponent","Component","props"],"sources":["../../../src/hoc/withPermissions/withPermissions.tsx"],"sourcesContent":["import { container as rootContainer } from 'tsyringe';\nimport { useMemo } from 'react';\nimport type { ComponentType } from 'react';\nimport type { CommonDbApiPermission } from '@gen-epix/api-commondb';\n\nimport { AuthorizationService } from '../../classes/services/AuthorizationService';\n\nexport interface WithPermissionsOptions<TApiPermission = CommonDbApiPermission> {\n readonly fallback?: ComponentType | null;\n readonly requiredPermissions: TApiPermission[];\n}\n\nexport const withPermissions = <TApiPermission = CommonDbApiPermission, TProps extends object = Record<string, never>>(\n Component: ComponentType<TProps>,\n options: WithPermissionsOptions<TApiPermission>,\n) => {\n const WrappedComponent = (props: TProps) => {\n const authorizationService = useMemo(() => rootContainer.resolve(AuthorizationService), []);\n\n if (!authorizationService.doesUserHavePermission(options.requiredPermissions as CommonDbApiPermission[])) {\n if (options.fallback) {\n const FallbackComponent = options.fallback;\n return <FallbackComponent />;\n }\n return null;\n }\n\n return <Component {...props} />;\n };\n\n // Set display name for better debugging\n WrappedComponent.displayName = `withPermissions(${Component.displayName || Component.name})`;\n\n return WrappedComponent;\n};\n"],"mappings":";;;;;AAYA,IAAaC,KACX,GACA,MACG;CACH,IAAMC,KAAoB,MAAkB;EAG1C,IAAI,CAFyBC,QAAcH,EAAc,QAAQK,CAAoB,GAAG,CAAC,CAEpF,CAAA,CAAqB,uBAAuBC,EAAQ,mBAA8C,GAAG;GACxG,IAAIA,EAAQ,UAAU;IACpB,IAAMC,IAAoBD,EAAQ;IAClC,OAAO,kBAACC,GAAD,CAAoB,CAAA;GAC7B;GACA,OAAO;EACT;EAEA,OAAO,kBAACC,GAAD,EAAW,GAAIC,EAAQ,CAAA;CAChC;CAKA,OAFA,EAAiB,cAAc,mBAAmBD,EAAU,eAAeA,EAAU,KAAK,IAEnFN;AACT"}
@@ -5,6 +5,6 @@ export interface WithPermissionsOptions<TApiPermission = CommonDbApiPermission>
5
5
  readonly requiredPermissions: TApiPermission[];
6
6
  }
7
7
  export declare const withPermissions: <TApiPermission = CommonDbApiPermission, TProps extends object = Record<string, never>>(Component: ComponentType<TProps>, options: WithPermissionsOptions<TApiPermission>) => {
8
- (props: TProps): import("react").JSX.Element;
8
+ (props: TProps): import('react').JSX.Element;
9
9
  displayName: string;
10
10
  };
@@ -1,2 +1 @@
1
- import { t as e } from "../../_chunks/useColumnsMenu.js";
2
- export { e as useColumnsMenu };
1
+ export { t as useColumnsMenu } from "../../_chunks/useColumnsMenu.js";
@@ -1,5 +1,5 @@
1
- import { MenuItemData } from '@gen-epix/ui-core-components/models/nestedMenu';
2
- import { HasCellDataFn } from '../../models/table';
1
+ import { MenuItemData } from '@gen-epix/ui-core-components/models/nested-menu.models';
2
+ import { HasCellDataFn } from '../../models/table.models';
3
3
  export type UseColumnsMenuProps<TRowData, TDataContext = null> = {
4
4
  readonly hasCellData?: HasCellDataFn<TRowData, TDataContext>;
5
5
  };
@@ -0,0 +1 @@
1
+ export * from './useConfig';
@@ -0,0 +1,7 @@
1
+ import { useUiClientCommonConfigContext as e } from "../../context/uiClientCommonConfigContext/index.js";
2
+ //#region src/hooks/useConfig/useConfig.ts
3
+ var t = () => e().config;
4
+ //#endregion
5
+ export { t as useConfig };
6
+
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["useConfig","useUiClientCommonConfigContext"],"sources":["../../../src/hooks/useConfig/useConfig.ts"],"sourcesContent":["import type { ConfigBase } from '../../models/config.models';\nimport { useUiClientCommonConfigContext } from '../../context/uiClientCommonConfigContext';\n\nexport const useConfig = <TConfig extends ConfigBase = ConfigBase>(): TConfig => {\n return useUiClientCommonConfigContext<TConfig>().config;\n};\n"],"mappings":";;AAGA,IAAaA,UACJC,EAAwC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ConfigBase } from '../../models/config.models';
2
+ export declare const useConfig: <TConfig extends ConfigBase = ConfigBase>() => TConfig;
@@ -1,29 +1,30 @@
1
- import { NotificationUtil as e } from "../../utils/NotificationUtil/index.js";
2
- import { t } from "../../_chunks/QueryClientService.js";
3
- import { t as n } from "../../_chunks/useMutation.js";
1
+ import { t as e } from "../../_chunks/QueryClientService.js";
2
+ import { t } from "../../_chunks/useMutation.js";
3
+ import { NotificationUtil as n } from "../../utils/NotificationUtil/index.js";
4
4
  import { NotificationService as r } from "../../classes/services/NotificationService/index.js";
5
5
  import { StringUtil as i } from "@gen-epix/ui-core/utils/StringUtil";
6
- import { useMemo as a } from "react";
7
- import { ObjectUtil as o } from "@gen-epix/ui-core/utils/ObjectUtil";
6
+ import { container as a } from "tsyringe";
7
+ import { useMemo as o } from "react";
8
+ import { ObjectUtil as s } from "@gen-epix/ui-core/utils/ObjectUtil";
8
9
  //#region src/hooks/useCreateMutation/useCreateMutation.ts
9
- var s = ({ associationQueryKeys: s, getErrorNotificationMessage: c, getProgressNotificationMessage: l, getSuccessNotificationMessage: u, onError: d, onSuccess: f, queryFn: p, resourceQueryKey: m }) => {
10
- let h = t.getInstance().queryClient, g = n({
11
- mutationFn: async (e) => p(o.deepNullifyEmptyStrings(e)),
12
- onError: async (n, i, a) => {
13
- m && h.setQueryData(m, (e) => Array.isArray(e) ? [...e.filter((e) => e?.id !== a.temporaryId)] : e), await t.getInstance().invalidateQueryKeys(s), d && await d(n, i, a), r.getInstance().fulfillNotification(a.notificationKey, e.wrapErrorNotificationMessage(c(i, n), n), "error");
10
+ var c = ({ associationQueryKeys: c, getErrorNotificationMessage: l, getProgressNotificationMessage: u, getSuccessNotificationMessage: d, onError: f, onSuccess: p, queryFn: m, resourceQueryKey: h }) => {
11
+ let g = a.resolve(e).queryClient, _ = t({
12
+ mutationFn: async (e) => m(s.deepNullifyEmptyStrings(e)),
13
+ onError: async (t, i, o) => {
14
+ h && g.setQueryData(h, (e) => Array.isArray(e) ? [...e.filter((e) => e?.id !== o.temporaryId)] : e), await a.resolve(e).invalidateQueryKeys(c), f && await f(t, i, o), a.resolve(r).fulfillNotification(o.notificationKey, n.wrapErrorNotificationMessage(l(i, t), t), "error");
14
15
  },
15
16
  onMutate: async (e) => {
16
- let t = r.getInstance().showNotification({
17
+ let t = a.resolve(r).showNotification({
17
18
  isLoading: !0,
18
- message: l(e),
19
+ message: u(e),
19
20
  severity: "info"
20
21
  });
21
- if (m) {
22
- await h.cancelQueries({ queryKey: m });
23
- let n = h.getQueryData(m);
22
+ if (h) {
23
+ await g.cancelQueries({ queryKey: h });
24
+ let n = g.getQueryData(h);
24
25
  if (Array.isArray(n)) {
25
26
  let r = i.createUuid();
26
- return h.setQueryData(m, (t) => [{
27
+ return g.setQueryData(h, (t) => [{
27
28
  ...e,
28
29
  id: r
29
30
  }, ...t]), {
@@ -35,16 +36,16 @@ var s = ({ associationQueryKeys: s, getErrorNotificationMessage: c, getProgressN
35
36
  }
36
37
  return { notificationKey: t };
37
38
  },
38
- onSuccess: async (e, n, i) => {
39
- m && Array.isArray(i?.previousData) && !Array.isArray(e) && h.setQueryData(m, (t) => [e, ...t.filter((e) => e.id !== i.temporaryId)]), await t.getInstance().invalidateQueryKeys(s), f && await f(e, n, i), r.getInstance().fulfillNotification(i.notificationKey, u(e, i), "success");
39
+ onSuccess: async (t, n, i) => {
40
+ h && Array.isArray(i?.previousData) && !Array.isArray(t) && g.setQueryData(h, (e) => [t, ...e.filter((e) => e.id !== i.temporaryId)]), await a.resolve(e).invalidateQueryKeys(c), p && await p(t, n, i), a.resolve(r).fulfillNotification(i.notificationKey, d(t, i), "success");
40
41
  }
41
- }), _ = a(() => g.mutate, [g.mutate]), v = a(() => g.isPending, [g.isPending]);
42
- return a(() => ({
43
- isMutating: v,
44
- mutate: _
45
- }), [v, _]);
42
+ }), v = o(() => _.mutate, [_.mutate]), y = o(() => _.isPending, [_.isPending]);
43
+ return o(() => ({
44
+ isMutating: y,
45
+ mutate: v
46
+ }), [y, v]);
46
47
  };
47
48
  //#endregion
48
- export { s as useCreateMutation };
49
+ export { c as useCreateMutation };
49
50
 
50
51
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/hooks/useCreateMutation/useCreateMutation.ts"],"sourcesContent":["import { useMutation } from '@tanstack/react-query';\nimport type { ReactElement } from 'react';\nimport { useMemo } from 'react';\nimport { StringUtil } from '@gen-epix/ui-core/utils/StringUtil';\nimport { ObjectUtil } from '@gen-epix/ui-core/utils/ObjectUtil';\n\nimport { NotificationService } from '../../classes/services/NotificationService';\nimport type { GenericData } from '../../models/data';\nimport { NotificationUtil } from '../../utils/NotificationUtil';\nimport { QueryClientService } from '../../classes/services/QueryClientService';\n\n\nexport type MutationContextCreate<TData> = { notificationKey?: string; previousData?: TData[]; temporaryId?: string };\n\nexport type UseCreateMutationProps<TData extends GenericData | GenericData[], TVariables = TData> = {\n readonly associationQueryKeys?: string[][];\n readonly getErrorNotificationMessage: (data: TVariables, error: unknown) => ReactElement | string;\n readonly getProgressNotificationMessage: (data: TVariables) => ReactElement | string;\n readonly getSuccessNotificationMessage: (data: TData, context: MutationContextCreate<TData>) => ReactElement | string;\n readonly onError?: (error: unknown, variables: TVariables, context: MutationContextCreate<TData>) => Promise<void> | void;\n readonly onSuccess?: (item: TData, variables: TVariables, context: MutationContextCreate<TData>) => Promise<void> | void;\n readonly queryFn?: (item: TVariables) => Promise<TData>;\n readonly resourceQueryKey?: string[];\n};\n\nexport const useCreateMutation = <TData extends GenericData | GenericData[], TVariables = TData>({\n associationQueryKeys,\n getErrorNotificationMessage,\n getProgressNotificationMessage,\n getSuccessNotificationMessage,\n onError,\n onSuccess,\n queryFn,\n resourceQueryKey,\n}: UseCreateMutationProps<TData, TVariables>) => {\n const queryClient = QueryClientService.getInstance().queryClient;\n\n const createMutation = useMutation<TData, Error, TVariables, MutationContextCreate<TData>>({\n mutationFn: async (item) => {\n return queryFn(ObjectUtil.deepNullifyEmptyStrings(item));\n },\n onError: async (error, variables, context) => {\n if (resourceQueryKey) {\n queryClient.setQueryData<TData[]>(resourceQueryKey, (oldItems: TData[]) => {\n if (!Array.isArray(oldItems)) {\n return oldItems;\n }\n return [...oldItems.filter(item => (item as GenericData)?.id !== context.temporaryId)];\n });\n }\n await QueryClientService.getInstance().invalidateQueryKeys(associationQueryKeys);\n if (onError) {\n await onError(error, variables, context);\n }\n NotificationService.getInstance().fulfillNotification(context.notificationKey, NotificationUtil.wrapErrorNotificationMessage(getErrorNotificationMessage(variables, error), error), 'error');\n },\n onMutate: async (variables) => {\n const notificationKey = NotificationService.getInstance().showNotification({\n isLoading: true,\n message: getProgressNotificationMessage(variables),\n severity: 'info',\n });\n if (resourceQueryKey) {\n await queryClient.cancelQueries({ queryKey: resourceQueryKey });\n const previousData = queryClient.getQueryData<TData[]>(resourceQueryKey);\n if (Array.isArray(previousData)) {\n const temporaryId = StringUtil.createUuid();\n queryClient.setQueryData<TData[]>(resourceQueryKey, (oldItems: TData[]) => {\n return [\n {\n ...variables,\n id: temporaryId,\n },\n ...oldItems,\n ] as TData[];\n });\n return { notificationKey, previousData, temporaryId };\n }\n }\n return { notificationKey };\n },\n onSuccess: async (item, variables, context) => {\n if (resourceQueryKey && Array.isArray(context?.previousData) && !Array.isArray(item)) {\n queryClient.setQueryData<GenericData[]>(resourceQueryKey, (oldItems) => {\n return [\n item,\n ...oldItems.filter(x => x.id !== context.temporaryId),\n ];\n });\n }\n await QueryClientService.getInstance().invalidateQueryKeys(associationQueryKeys);\n if (onSuccess) {\n await onSuccess(item, variables, context);\n }\n NotificationService.getInstance().fulfillNotification(context.notificationKey, getSuccessNotificationMessage(item, context), 'success');\n },\n });\n\n // Note: must be done in useMemo to avoid render loops (useMutation returns a new object every time)\n const mutate = useMemo(() => createMutation.mutate, [createMutation.mutate]);\n const isMutating = useMemo(() => createMutation.isPending, [createMutation.isPending]);\n return useMemo(() => ({ isMutating, mutate }), [isMutating, mutate]);\n};\n"],"mappings":";;;;;;;;AAyBA,IAAa,KAAoF,EAC/F,yBACA,gCACA,mCACA,kCACA,YACA,cACA,YACA,0BAC+C;CAC/C,IAAM,IAAc,EAAmB,YAAY,CAAC,CAAC,aAE/C,IAAiB,EAAoE;EACzF,YAAY,OAAO,MACV,EAAQ,EAAW,wBAAwB,CAAI,CAAC;EAEzD,SAAS,OAAO,GAAO,GAAW,MAAY;GAa5C,AAZI,KACF,EAAY,aAAsB,IAAmB,MAC9C,MAAM,QAAQ,CAAQ,IAGpB,CAAC,GAAG,EAAS,QAAO,MAAS,GAAsB,OAAO,EAAQ,WAAW,CAAC,IAF5E,CAGV,GAEH,MAAM,EAAmB,YAAY,CAAC,CAAC,oBAAoB,CAAoB,GAC3E,KACF,MAAM,EAAQ,GAAO,GAAW,CAAO,GAEzC,EAAoB,YAAY,CAAC,CAAC,oBAAoB,EAAQ,iBAAiB,EAAiB,6BAA6B,EAA4B,GAAW,CAAK,GAAG,CAAK,GAAG,OAAO;EAC7L;EACA,UAAU,OAAO,MAAc;GAC7B,IAAM,IAAkB,EAAoB,YAAY,CAAC,CAAC,iBAAiB;IACzE,WAAW;IACX,SAAS,EAA+B,CAAS;IACjD,UAAU;GACZ,CAAC;GACD,IAAI,GAAkB;IACpB,MAAM,EAAY,cAAc,EAAE,UAAU,EAAiB,CAAC;IAC9D,IAAM,IAAe,EAAY,aAAsB,CAAgB;IACvE,IAAI,MAAM,QAAQ,CAAY,GAAG;KAC/B,IAAM,IAAc,EAAW,WAAW;KAU1C,OATA,EAAY,aAAsB,IAAmB,MAC5C,CACL;MACE,GAAG;MACH,IAAI;KACN,GACA,GAAG,CACL,CACD,GACM;MAAE;MAAiB;MAAc;KAAY;IACtD;GACF;GACA,OAAO,EAAE,mBAAgB;EAC3B;EACA,WAAW,OAAO,GAAM,GAAW,MAAY;GAa7C,AAZI,KAAoB,MAAM,QAAQ,GAAS,YAAY,KAAK,CAAC,MAAM,QAAQ,CAAI,KACjF,EAAY,aAA4B,IAAmB,MAClD,CACL,GACA,GAAG,EAAS,QAAO,MAAK,EAAE,OAAO,EAAQ,WAAW,CACtD,CACD,GAEH,MAAM,EAAmB,YAAY,CAAC,CAAC,oBAAoB,CAAoB,GAC3E,KACF,MAAM,EAAU,GAAM,GAAW,CAAO,GAE1C,EAAoB,YAAY,CAAC,CAAC,oBAAoB,EAAQ,iBAAiB,EAA8B,GAAM,CAAO,GAAG,SAAS;EACxI;CACF,CAAC,GAGK,IAAS,QAAc,EAAe,QAAQ,CAAC,EAAe,MAAM,CAAC,GACrE,IAAa,QAAc,EAAe,WAAW,CAAC,EAAe,SAAS,CAAC;CACrF,OAAO,SAAe;EAAE;EAAY;CAAO,IAAI,CAAC,GAAY,CAAM,CAAC;AACrE"}
1
+ {"version":3,"file":"index.js","names":["rootContainer","QueryClientService","useCreateMutation","queryClient","container","createMutation","useMutation","queryFn","ObjectUtil","item","resourceQueryKey","oldItems","context","associationQueryKeys","onError","error","variables","NotificationService","NotificationUtil","getErrorNotificationMessage","notificationKey","getProgressNotificationMessage","previousData","temporaryId","StringUtil","x","onSuccess","getSuccessNotificationMessage","mutate","useMemo","isMutating"],"sources":["../../../src/hooks/useCreateMutation/useCreateMutation.ts"],"sourcesContent":["import { container as rootContainer } from 'tsyringe';\nimport { useMutation } from '@tanstack/react-query';\nimport type { ReactElement } from 'react';\nimport { useMemo } from 'react';\nimport { StringUtil } from '@gen-epix/ui-core/utils/StringUtil';\nimport { ObjectUtil } from '@gen-epix/ui-core/utils/ObjectUtil';\n\nimport { NotificationService } from '../../classes/services/NotificationService';\nimport type { GenericData } from '../../models/data.models';\nimport { NotificationUtil } from '../../utils/NotificationUtil';\nimport { QueryClientService } from '../../classes/services/QueryClientService';\n\n\nexport type MutationContextCreate<TData> = { notificationKey?: string; previousData?: TData[]; temporaryId?: string };\n\nexport type UseCreateMutationProps<TData extends GenericData | GenericData[], TVariables = TData> = {\n readonly associationQueryKeys?: string[][];\n readonly getErrorNotificationMessage: (data: TVariables, error: unknown) => ReactElement | string;\n readonly getProgressNotificationMessage: (data: TVariables) => ReactElement | string;\n readonly getSuccessNotificationMessage: (data: TData, context: MutationContextCreate<TData>) => ReactElement | string;\n readonly onError?: (error: unknown, variables: TVariables, context: MutationContextCreate<TData>) => Promise<void> | void;\n readonly onSuccess?: (item: TData, variables: TVariables, context: MutationContextCreate<TData>) => Promise<void> | void;\n readonly queryFn?: (item: TVariables) => Promise<TData>;\n readonly resourceQueryKey?: string[];\n};\n\nexport const useCreateMutation = <TData extends GenericData | GenericData[], TVariables = TData>({\n associationQueryKeys,\n getErrorNotificationMessage,\n getProgressNotificationMessage,\n getSuccessNotificationMessage,\n onError,\n onSuccess,\n queryFn,\n resourceQueryKey,\n}: UseCreateMutationProps<TData, TVariables>) => {\n const queryClient = rootContainer.resolve(QueryClientService).queryClient;\n\n const createMutation = useMutation<TData, Error, TVariables, MutationContextCreate<TData>>({\n mutationFn: async (item) => {\n return queryFn(ObjectUtil.deepNullifyEmptyStrings(item));\n },\n onError: async (error, variables, context) => {\n if (resourceQueryKey) {\n queryClient.setQueryData<TData[]>(resourceQueryKey, (oldItems: TData[]) => {\n if (!Array.isArray(oldItems)) {\n return oldItems;\n }\n return [...oldItems.filter(item => (item as GenericData)?.id !== context.temporaryId)];\n });\n }\n await rootContainer.resolve(QueryClientService).invalidateQueryKeys(associationQueryKeys);\n if (onError) {\n await onError(error, variables, context);\n }\n rootContainer.resolve(NotificationService).fulfillNotification(context.notificationKey, NotificationUtil.wrapErrorNotificationMessage(getErrorNotificationMessage(variables, error), error), 'error');\n },\n onMutate: async (variables) => {\n const notificationKey = rootContainer.resolve(NotificationService).showNotification({\n isLoading: true,\n message: getProgressNotificationMessage(variables),\n severity: 'info',\n });\n if (resourceQueryKey) {\n await queryClient.cancelQueries({ queryKey: resourceQueryKey });\n const previousData = queryClient.getQueryData<TData[]>(resourceQueryKey);\n if (Array.isArray(previousData)) {\n const temporaryId = StringUtil.createUuid();\n queryClient.setQueryData<TData[]>(resourceQueryKey, (oldItems: TData[]) => {\n return [\n {\n ...variables,\n id: temporaryId,\n },\n ...oldItems,\n ] as TData[];\n });\n return { notificationKey, previousData, temporaryId };\n }\n }\n return { notificationKey };\n },\n onSuccess: async (item, variables, context) => {\n if (resourceQueryKey && Array.isArray(context?.previousData) && !Array.isArray(item)) {\n queryClient.setQueryData<GenericData[]>(resourceQueryKey, (oldItems) => {\n return [\n item,\n ...oldItems.filter(x => x.id !== context.temporaryId),\n ];\n });\n }\n await rootContainer.resolve(QueryClientService).invalidateQueryKeys(associationQueryKeys);\n if (onSuccess) {\n await onSuccess(item, variables, context);\n }\n rootContainer.resolve(NotificationService).fulfillNotification(context.notificationKey, getSuccessNotificationMessage(item, context), 'success');\n },\n });\n\n // Note: must be done in useMemo to avoid render loops (useMutation returns a new object every time)\n const mutate = useMemo(() => createMutation.mutate, [createMutation.mutate]);\n const isMutating = useMemo(() => createMutation.isPending, [createMutation.isPending]);\n return useMemo(() => ({ isMutating, mutate }), [isMutating, mutate]);\n};\n"],"mappings":";;;;;;;;;AA0BA,IAAaE,KAAoF,EAC/F,yBACA,gCACA,mCACA,kCACA,YACA,cACA,YACA,0BAC+C;CAC/C,IAAMC,IAAcH,EAAc,QAAQC,CAAkB,CAAC,CAAC,aAExDI,IAAiBC,EAAoE;EACzF,YAAY,OAAO,MACVC,EAAQC,EAAW,wBAAwBC,CAAI,CAAC;EAEzD,SAAS,OAAO,GAAO,GAAW,MAAY;GAa5C,AAZIC,KACFP,EAAY,aAAsBO,IAAmB,MAC9C,MAAM,QAAQC,CAAQ,IAGpB,CAAC,GAAGA,EAAS,QAAO,MAASF,GAAsB,OAAOG,EAAQ,WAAW,CAAC,IAF5ED,CAGV,GAEH,MAAMX,EAAc,QAAQC,CAAkB,CAAC,CAAC,oBAAoBY,CAAoB,GACpFC,KACF,MAAMA,EAAQC,GAAOC,GAAWJ,CAAO,GAEzCR,EAAc,QAAQa,CAAmB,CAAC,CAAC,oBAAoBL,EAAQ,iBAAiBM,EAAiB,6BAA6BC,EAA4BH,GAAWD,CAAK,GAAGA,CAAK,GAAG,OAAO;EACtM;EACA,UAAU,OAAO,MAAc;GAC7B,IAAMK,IAAkBpB,EAAc,QAAQiB,CAAmB,CAAC,CAAC,iBAAiB;IAClF,WAAW;IACX,SAASI,EAA+BL,CAAS;IACjD,UAAU;GACZ,CAAC;GACD,IAAIN,GAAkB;IACpB,MAAMP,EAAY,cAAc,EAAE,UAAUO,EAAiB,CAAC;IAC9D,IAAMY,IAAenB,EAAY,aAAsBO,CAAgB;IACvE,IAAI,MAAM,QAAQY,CAAY,GAAG;KAC/B,IAAMC,IAAcC,EAAW,WAAW;KAU1C,OATArB,EAAY,aAAsBO,IAAmB,MAC5C,CACL;MACE,GAAGM;MACH,IAAIO;KACN,GACA,GAAGZ,CACL,CACD,GACM;MAAE;MAAiB;MAAc;KAAY;IACtD;GACF;GACA,OAAO,EAAE,mBAAgB;EAC3B;EACA,WAAW,OAAO,GAAM,GAAW,MAAY;GAa7C,AAZID,KAAoB,MAAM,QAAQE,GAAS,YAAY,KAAK,CAAC,MAAM,QAAQH,CAAI,KACjFN,EAAY,aAA4BO,IAAmB,MAClD,CACLD,GACA,GAAGE,EAAS,QAAO,MAAKc,EAAE,OAAOb,EAAQ,WAAW,CACtD,CACD,GAEH,MAAMZ,EAAc,QAAQC,CAAkB,CAAC,CAAC,oBAAoBY,CAAoB,GACpFa,KACF,MAAMA,EAAUjB,GAAMO,GAAWJ,CAAO,GAE1CR,EAAc,QAAQa,CAAmB,CAAC,CAAC,oBAAoBL,EAAQ,iBAAiBe,EAA8BlB,GAAMG,CAAO,GAAG,SAAS;EACjJ;CACF,CAAC,GAGKgB,IAASC,QAAcxB,EAAe,QAAQ,CAACA,EAAe,MAAM,CAAC,GACrEyB,IAAaD,QAAcxB,EAAe,WAAW,CAACA,EAAe,SAAS,CAAC;CACrF,OAAOwB,SAAe;EAAE;EAAY;CAAO,IAAI,CAACC,GAAYF,CAAM,CAAC;AACrE"}
@@ -1,5 +1,5 @@
1
1
  import { ReactElement } from 'react';
2
- import { GenericData } from '../../models/data';
2
+ import { GenericData } from '../../models/data.models';
3
3
  export type MutationContextCreate<TData> = {
4
4
  notificationKey?: string;
5
5
  previousData?: TData[];
@@ -1,41 +1,42 @@
1
- import { NotificationUtil as e } from "../../utils/NotificationUtil/index.js";
2
- import { t } from "../../_chunks/QueryClientService.js";
3
- import { t as n } from "../../_chunks/useMutation.js";
1
+ import { t as e } from "../../_chunks/QueryClientService.js";
2
+ import { t } from "../../_chunks/useMutation.js";
3
+ import { NotificationUtil as n } from "../../utils/NotificationUtil/index.js";
4
4
  import { NotificationService as r } from "../../classes/services/NotificationService/index.js";
5
- import { useMemo as i } from "react";
5
+ import { container as i } from "tsyringe";
6
+ import { useMemo as a } from "react";
6
7
  //#region src/hooks/useDeleteMutation/useDeleteMutation.ts
7
- var a = ({ associationQueryKeys: a, getErrorNotificationMessage: o, getProgressNotificationMessage: s, getSuccessNotificationMessage: c, onError: l, onSuccess: u, queryFn: d, resourceQueryKey: f }) => {
8
- let p = t.getInstance().queryClient, m = n({
9
- mutationFn: async (e) => d(e),
10
- onError: async (n, i, s) => {
11
- f && p.setQueryData(f, (e) => Array.isArray(e) ? [...e, i] : e), a && await t.getInstance().invalidateQueryKeys(a), l && await l(n, i, s), r.getInstance().fulfillNotification(s.notificationKey, e.wrapErrorNotificationMessage(o(i, n), n), "error");
8
+ var o = ({ associationQueryKeys: o, getErrorNotificationMessage: s, getProgressNotificationMessage: c, getSuccessNotificationMessage: l, onError: u, onSuccess: d, queryFn: f, resourceQueryKey: p }) => {
9
+ let m = i.resolve(e).queryClient, h = t({
10
+ mutationFn: async (e) => f(e),
11
+ onError: async (t, a, c) => {
12
+ p && m.setQueryData(p, (e) => Array.isArray(e) ? [...e, a] : e), o && await i.resolve(e).invalidateQueryKeys(o), u && await u(t, a, c), i.resolve(r).fulfillNotification(c.notificationKey, n.wrapErrorNotificationMessage(s(a, t), t), "error");
12
13
  },
13
14
  onMutate: async (e) => {
14
- let t = r.getInstance().showNotification({
15
+ let t = i.resolve(r).showNotification({
15
16
  isLoading: !0,
16
- message: s(e),
17
+ message: c(e),
17
18
  severity: "info"
18
19
  });
19
- if (f) {
20
- await p.cancelQueries({ queryKey: f });
21
- let n = p.getQueryData(f);
22
- if (Array.isArray(n) && !Array.isArray(e)) return p.setQueryData(f, (t) => t.filter((t) => t.id !== e.id)), {
20
+ if (p) {
21
+ await m.cancelQueries({ queryKey: p });
22
+ let n = m.getQueryData(p);
23
+ if (Array.isArray(n) && !Array.isArray(e)) return m.setQueryData(p, (t) => t.filter((t) => t.id !== e.id)), {
23
24
  notificationKey: t,
24
25
  previousData: n
25
26
  };
26
27
  }
27
28
  return { notificationKey: t };
28
29
  },
29
- onSuccess: async (e, n, i) => {
30
- a && await t.getInstance().invalidateQueryKeys(a), u && await u(n, i), r.getInstance().fulfillNotification(i.notificationKey, c(n, i), "success");
30
+ onSuccess: async (t, n, a) => {
31
+ o && await i.resolve(e).invalidateQueryKeys(o), d && await d(n, a), i.resolve(r).fulfillNotification(a.notificationKey, l(n, a), "success");
31
32
  }
32
- }), h = i(() => m.mutate, [m.mutate]), g = i(() => m.isPending, [m.isPending]);
33
- return i(() => ({
34
- isMutating: g,
35
- mutate: h
36
- }), [g, h]);
33
+ }), g = a(() => h.mutate, [h.mutate]), _ = a(() => h.isPending, [h.isPending]);
34
+ return a(() => ({
35
+ isMutating: _,
36
+ mutate: g
37
+ }), [_, g]);
37
38
  };
38
39
  //#endregion
39
- export { a as useDeleteMutation };
40
+ export { o as useDeleteMutation };
40
41
 
41
42
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/hooks/useDeleteMutation/useDeleteMutation.ts"],"sourcesContent":["import { useMutation } from '@tanstack/react-query';\nimport type { ReactElement } from 'react';\nimport { useMemo } from 'react';\n\nimport { NotificationService } from '../../classes/services/NotificationService';\nimport type { GenericData } from '../../models/data';\nimport { NotificationUtil } from '../../utils/NotificationUtil';\nimport { QueryClientService } from '../../classes/services/QueryClientService';\n\n\nexport type MutationContextDelete<TData> = { notificationKey?: string; previousData?: TData[] };\n\nexport type UseDeleteMutationProps<TData> = {\n readonly associationQueryKeys?: string[][];\n readonly getErrorNotificationMessage?: (data: TData, error: unknown) => ReactElement | string;\n readonly getProgressNotificationMessage: (data: TData) => ReactElement | string;\n readonly getSuccessNotificationMessage?: (data: TData, context: MutationContextDelete<TData>) => ReactElement | string;\n readonly onError?: (error: unknown, item: TData, context: MutationContextDelete<TData>) => Promise<void> | void;\n readonly onSuccess?: (item: TData, context: MutationContextDelete<TData>) => Promise<void> | void;\n readonly queryFn?: (data: TData) => Promise<unknown>;\n readonly resourceQueryKey?: string[];\n};\n\nexport const useDeleteMutation = <TData extends GenericData | GenericData[]>({\n associationQueryKeys,\n getErrorNotificationMessage,\n getProgressNotificationMessage,\n getSuccessNotificationMessage,\n onError,\n onSuccess,\n queryFn,\n resourceQueryKey,\n}: UseDeleteMutationProps<TData>) => {\n const queryClient = QueryClientService.getInstance().queryClient;\n\n const deleteMutation = useMutation<unknown, Error, TData, MutationContextDelete<TData>>({\n mutationFn: async (item) => {\n return queryFn(item);\n },\n onError: async (error, item, context) => {\n if (resourceQueryKey) {\n queryClient.setQueryData(resourceQueryKey, (oldItems: TData[]) => {\n if (!Array.isArray(oldItems)) {\n return oldItems;\n }\n return [...oldItems, item];\n });\n }\n if (associationQueryKeys) {\n await QueryClientService.getInstance().invalidateQueryKeys(associationQueryKeys);\n }\n if (onError) {\n await onError(error, item, context);\n }\n NotificationService.getInstance().fulfillNotification(context.notificationKey, NotificationUtil.wrapErrorNotificationMessage(getErrorNotificationMessage(item, error), error), 'error');\n },\n onMutate: async (item) => {\n const notificationKey = NotificationService.getInstance().showNotification({\n isLoading: true,\n message: getProgressNotificationMessage(item),\n severity: 'info',\n });\n if (resourceQueryKey) {\n await queryClient.cancelQueries({ queryKey: resourceQueryKey });\n const previousData = queryClient.getQueryData<TData[]>(resourceQueryKey);\n\n if (Array.isArray(previousData) && !Array.isArray(item)) {\n queryClient.setQueryData<GenericData[]>(resourceQueryKey, (oldItems) => {\n return oldItems.filter(i => i.id !== item.id);\n });\n return { notificationKey, previousData };\n }\n }\n return { notificationKey };\n },\n onSuccess: async (_data, item, context) => {\n if (associationQueryKeys) {\n await QueryClientService.getInstance().invalidateQueryKeys(associationQueryKeys);\n }\n if (onSuccess) {\n await onSuccess(item, context);\n }\n NotificationService.getInstance().fulfillNotification(context.notificationKey, getSuccessNotificationMessage(item, context), 'success');\n },\n });\n\n // Note: must be done in useMemo to avoid render loops (useMutation returns a new object every time)\n const mutate = useMemo(() => deleteMutation.mutate, [deleteMutation.mutate]);\n const isMutating = useMemo(() => deleteMutation.isPending, [deleteMutation.isPending]);\n return useMemo(() => ({ isMutating, mutate }), [isMutating, mutate]);\n};\n"],"mappings":";;;;;;AAuBA,IAAa,KAAgE,EAC3E,yBACA,gCACA,mCACA,kCACA,YACA,cACA,YACA,0BACmC;CACnC,IAAM,IAAc,EAAmB,YAAY,CAAC,CAAC,aAE/C,IAAiB,EAAiE;EACtF,YAAY,OAAO,MACV,EAAQ,CAAI;EAErB,SAAS,OAAO,GAAO,GAAM,MAAY;GAevC,AAdI,KACF,EAAY,aAAa,IAAmB,MACrC,MAAM,QAAQ,CAAQ,IAGpB,CAAC,GAAG,GAAU,CAAI,IAFhB,CAGV,GAEC,KACF,MAAM,EAAmB,YAAY,CAAC,CAAC,oBAAoB,CAAoB,GAE7E,KACF,MAAM,EAAQ,GAAO,GAAM,CAAO,GAEpC,EAAoB,YAAY,CAAC,CAAC,oBAAoB,EAAQ,iBAAiB,EAAiB,6BAA6B,EAA4B,GAAM,CAAK,GAAG,CAAK,GAAG,OAAO;EACxL;EACA,UAAU,OAAO,MAAS;GACxB,IAAM,IAAkB,EAAoB,YAAY,CAAC,CAAC,iBAAiB;IACzE,WAAW;IACX,SAAS,EAA+B,CAAI;IAC5C,UAAU;GACZ,CAAC;GACD,IAAI,GAAkB;IACpB,MAAM,EAAY,cAAc,EAAE,UAAU,EAAiB,CAAC;IAC9D,IAAM,IAAe,EAAY,aAAsB,CAAgB;IAEvE,IAAI,MAAM,QAAQ,CAAY,KAAK,CAAC,MAAM,QAAQ,CAAI,GAIpD,OAHA,EAAY,aAA4B,IAAmB,MAClD,EAAS,QAAO,MAAK,EAAE,OAAO,EAAK,EAAE,CAC7C,GACM;KAAE;KAAiB;IAAa;GAE3C;GACA,OAAO,EAAE,mBAAgB;EAC3B;EACA,WAAW,OAAO,GAAO,GAAM,MAAY;GAOzC,AANI,KACF,MAAM,EAAmB,YAAY,CAAC,CAAC,oBAAoB,CAAoB,GAE7E,KACF,MAAM,EAAU,GAAM,CAAO,GAE/B,EAAoB,YAAY,CAAC,CAAC,oBAAoB,EAAQ,iBAAiB,EAA8B,GAAM,CAAO,GAAG,SAAS;EACxI;CACF,CAAC,GAGK,IAAS,QAAc,EAAe,QAAQ,CAAC,EAAe,MAAM,CAAC,GACrE,IAAa,QAAc,EAAe,WAAW,CAAC,EAAe,SAAS,CAAC;CACrF,OAAO,SAAe;EAAE;EAAY;CAAO,IAAI,CAAC,GAAY,CAAM,CAAC;AACrE"}
1
+ {"version":3,"file":"index.js","names":["rootContainer","QueryClientService","useDeleteMutation","queryClient","container","deleteMutation","useMutation","queryFn","item","resourceQueryKey","oldItems","associationQueryKeys","onError","error","context","NotificationService","NotificationUtil","getErrorNotificationMessage","notificationKey","getProgressNotificationMessage","previousData","i","onSuccess","getSuccessNotificationMessage","mutate","useMemo","isMutating"],"sources":["../../../src/hooks/useDeleteMutation/useDeleteMutation.ts"],"sourcesContent":["import { container as rootContainer } from 'tsyringe';\nimport { useMutation } from '@tanstack/react-query';\nimport type { ReactElement } from 'react';\nimport { useMemo } from 'react';\n\nimport { NotificationService } from '../../classes/services/NotificationService';\nimport type { GenericData } from '../../models/data.models';\nimport { NotificationUtil } from '../../utils/NotificationUtil';\nimport { QueryClientService } from '../../classes/services/QueryClientService';\n\n\nexport type MutationContextDelete<TData> = { notificationKey?: string; previousData?: TData[] };\n\nexport type UseDeleteMutationProps<TData> = {\n readonly associationQueryKeys?: string[][];\n readonly getErrorNotificationMessage?: (data: TData, error: unknown) => ReactElement | string;\n readonly getProgressNotificationMessage: (data: TData) => ReactElement | string;\n readonly getSuccessNotificationMessage?: (data: TData, context: MutationContextDelete<TData>) => ReactElement | string;\n readonly onError?: (error: unknown, item: TData, context: MutationContextDelete<TData>) => Promise<void> | void;\n readonly onSuccess?: (item: TData, context: MutationContextDelete<TData>) => Promise<void> | void;\n readonly queryFn?: (data: TData) => Promise<unknown>;\n readonly resourceQueryKey?: string[];\n};\n\nexport const useDeleteMutation = <TData extends GenericData | GenericData[]>({\n associationQueryKeys,\n getErrorNotificationMessage,\n getProgressNotificationMessage,\n getSuccessNotificationMessage,\n onError,\n onSuccess,\n queryFn,\n resourceQueryKey,\n}: UseDeleteMutationProps<TData>) => {\n const queryClient = rootContainer.resolve(QueryClientService).queryClient;\n\n const deleteMutation = useMutation<unknown, Error, TData, MutationContextDelete<TData>>({\n mutationFn: async (item) => {\n return queryFn(item);\n },\n onError: async (error, item, context) => {\n if (resourceQueryKey) {\n queryClient.setQueryData(resourceQueryKey, (oldItems: TData[]) => {\n if (!Array.isArray(oldItems)) {\n return oldItems;\n }\n return [...oldItems, item];\n });\n }\n if (associationQueryKeys) {\n await rootContainer.resolve(QueryClientService).invalidateQueryKeys(associationQueryKeys);\n }\n if (onError) {\n await onError(error, item, context);\n }\n rootContainer.resolve(NotificationService).fulfillNotification(context.notificationKey, NotificationUtil.wrapErrorNotificationMessage(getErrorNotificationMessage(item, error), error), 'error');\n },\n onMutate: async (item) => {\n const notificationKey = rootContainer.resolve(NotificationService).showNotification({\n isLoading: true,\n message: getProgressNotificationMessage(item),\n severity: 'info',\n });\n if (resourceQueryKey) {\n await queryClient.cancelQueries({ queryKey: resourceQueryKey });\n const previousData = queryClient.getQueryData<TData[]>(resourceQueryKey);\n\n if (Array.isArray(previousData) && !Array.isArray(item)) {\n queryClient.setQueryData<GenericData[]>(resourceQueryKey, (oldItems) => {\n return oldItems.filter(i => i.id !== item.id);\n });\n return { notificationKey, previousData };\n }\n }\n return { notificationKey };\n },\n onSuccess: async (_data, item, context) => {\n if (associationQueryKeys) {\n await rootContainer.resolve(QueryClientService).invalidateQueryKeys(associationQueryKeys);\n }\n if (onSuccess) {\n await onSuccess(item, context);\n }\n rootContainer.resolve(NotificationService).fulfillNotification(context.notificationKey, getSuccessNotificationMessage(item, context), 'success');\n },\n });\n\n // Note: must be done in useMemo to avoid render loops (useMutation returns a new object every time)\n const mutate = useMemo(() => deleteMutation.mutate, [deleteMutation.mutate]);\n const isMutating = useMemo(() => deleteMutation.isPending, [deleteMutation.isPending]);\n return useMemo(() => ({ isMutating, mutate }), [isMutating, mutate]);\n};\n"],"mappings":";;;;;;;AAwBA,IAAaE,KAAgE,EAC3E,yBACA,gCACA,mCACA,kCACA,YACA,cACA,YACA,0BACmC;CACnC,IAAMC,IAAcH,EAAc,QAAQC,CAAkB,CAAC,CAAC,aAExDI,IAAiBC,EAAiE;EACtF,YAAY,OAAO,MACVC,EAAQC,CAAI;EAErB,SAAS,OAAO,GAAO,GAAM,MAAY;GAevC,AAdIC,KACFN,EAAY,aAAaM,IAAmB,MACrC,MAAM,QAAQC,CAAQ,IAGpB,CAAC,GAAGA,GAAUF,CAAI,IAFhBE,CAGV,GAECC,KACF,MAAMX,EAAc,QAAQC,CAAkB,CAAC,CAAC,oBAAoBU,CAAoB,GAEtFC,KACF,MAAMA,EAAQC,GAAOL,GAAMM,CAAO,GAEpCV,EAAc,QAAQW,CAAmB,CAAC,CAAC,oBAAoBD,EAAQ,iBAAiBE,EAAiB,6BAA6BC,EAA4BT,GAAMK,CAAK,GAAGA,CAAK,GAAG,OAAO;EACjM;EACA,UAAU,OAAO,MAAS;GACxB,IAAMK,IAAkBlB,EAAc,QAAQe,CAAmB,CAAC,CAAC,iBAAiB;IAClF,WAAW;IACX,SAASI,EAA+BX,CAAI;IAC5C,UAAU;GACZ,CAAC;GACD,IAAIC,GAAkB;IACpB,MAAMN,EAAY,cAAc,EAAE,UAAUM,EAAiB,CAAC;IAC9D,IAAMW,IAAejB,EAAY,aAAsBM,CAAgB;IAEvE,IAAI,MAAM,QAAQW,CAAY,KAAK,CAAC,MAAM,QAAQZ,CAAI,GAIpD,OAHAL,EAAY,aAA4BM,IAAmB,MAClDC,EAAS,QAAO,MAAKW,EAAE,OAAOb,EAAK,EAAE,CAC7C,GACM;KAAE;KAAiB;IAAa;GAE3C;GACA,OAAO,EAAE,mBAAgB;EAC3B;EACA,WAAW,OAAO,GAAO,GAAM,MAAY;GAOzC,AANIG,KACF,MAAMX,EAAc,QAAQC,CAAkB,CAAC,CAAC,oBAAoBU,CAAoB,GAEtFW,KACF,MAAMA,EAAUd,GAAMM,CAAO,GAE/BV,EAAc,QAAQW,CAAmB,CAAC,CAAC,oBAAoBD,EAAQ,iBAAiBS,EAA8Bf,GAAMM,CAAO,GAAG,SAAS;EACjJ;CACF,CAAC,GAGKU,IAASC,QAAcpB,EAAe,QAAQ,CAACA,EAAe,MAAM,CAAC,GACrEqB,IAAaD,QAAcpB,EAAe,WAAW,CAACA,EAAe,SAAS,CAAC;CACrF,OAAOoB,SAAe;EAAE;EAAY;CAAO,IAAI,CAACC,GAAYF,CAAM,CAAC;AACrE"}
@@ -1,5 +1,5 @@
1
1
  import { ReactElement } from 'react';
2
- import { GenericData } from '../../models/data';
2
+ import { GenericData } from '../../models/data.models';
3
3
  export type MutationContextDelete<TData> = {
4
4
  notificationKey?: string;
5
5
  previousData?: TData[];
@@ -1,35 +1,36 @@
1
- import { NotificationUtil as e } from "../../utils/NotificationUtil/index.js";
2
- import { t } from "../../_chunks/QueryClientService.js";
3
- import { t as n } from "../../_chunks/useMutation.js";
1
+ import { t as e } from "../../_chunks/QueryClientService.js";
2
+ import { t } from "../../_chunks/useMutation.js";
3
+ import { NotificationUtil as n } from "../../utils/NotificationUtil/index.js";
4
4
  import { NotificationService as r } from "../../classes/services/NotificationService/index.js";
5
- import { useCallback as i, useMemo as a, useRef as o } from "react";
6
- import { ObjectUtil as s } from "@gen-epix/ui-core/utils/ObjectUtil";
5
+ import { container as i } from "tsyringe";
6
+ import { useCallback as a, useMemo as o, useRef as s } from "react";
7
+ import { ObjectUtil as c } from "@gen-epix/ui-core/utils/ObjectUtil";
7
8
  //#region src/hooks/useEditMutation/useEditMutation.ts
8
- var c = ({ associationQueryKeys: c, getErrorNotificationMessage: l, getIntermediateItem: u, getProgressNotificationMessage: d, getSuccessNotificationMessage: f, onError: p, onSuccess: m, queryFn: h, resourceQueryKey: g }) => {
9
- let _ = t.getInstance().queryClient, v = o(void 0), y = i((e) => {
10
- v.current = e;
11
- }, []), b = i(async (e) => h(s.deepNullifyEmptyStrings(e), v.current), [v, h]), x = n({
12
- mutationFn: b,
13
- onError: async (n, i, a) => {
14
- v.current = void 0, g && Array.isArray(a.previousData) && _.setQueryData(g, (e) => Array.isArray(e) ? [...e.filter((e) => e.id !== a.item.id), a.item] : e), await t.getInstance().invalidateQueryKeys(c), p && await p(n, i, a), r.getInstance().fulfillNotification(a.notificationKey, e.wrapErrorNotificationMessage(l(a.item, i, n), n), "error");
9
+ var l = ({ associationQueryKeys: l, getErrorNotificationMessage: u, getIntermediateItem: d, getProgressNotificationMessage: f, getSuccessNotificationMessage: p, onError: m, onSuccess: h, queryFn: g, resourceQueryKey: _ }) => {
10
+ let v = i.resolve(e).queryClient, y = s(void 0), b = a((e) => {
11
+ y.current = e;
12
+ }, []), x = a(async (e) => g(c.deepNullifyEmptyStrings(e), y.current), [y, g]), S = t({
13
+ mutationFn: x,
14
+ onError: async (t, a, o) => {
15
+ y.current = void 0, _ && Array.isArray(o.previousData) && v.setQueryData(_, (e) => Array.isArray(e) ? [...e.filter((e) => e.id !== o.item.id), o.item] : e), await i.resolve(e).invalidateQueryKeys(l), m && await m(t, a, o), i.resolve(r).fulfillNotification(o.notificationKey, n.wrapErrorNotificationMessage(u(o.item, a, t), t), "error");
15
16
  },
16
17
  onMutate: async (e) => {
17
- let t = r.getInstance().showNotification({
18
+ let t = i.resolve(r).showNotification({
18
19
  isLoading: !0,
19
- message: d(v.current, e),
20
+ message: f(y.current, e),
20
21
  severity: "info"
21
22
  });
22
- if (g) {
23
- if (!v.current) throw Error("previousItem is not set");
24
- await _.cancelQueries({ queryKey: g });
25
- let n = _.getQueryData(g);
23
+ if (_) {
24
+ if (!y.current) throw Error("previousItem is not set");
25
+ await v.cancelQueries({ queryKey: _ });
26
+ let n = v.getQueryData(_);
26
27
  if (Array.isArray(n) && !Array.isArray(e)) {
27
- let r = u ? u(e, v.current) : {
28
+ let r = d ? d(e, y.current) : {
28
29
  ...e,
29
- id: v.current.id
30
+ id: y.current.id
30
31
  };
31
- return _.setQueryData(g, (e) => [...e.filter((e) => e.id !== v.current.id), r]), {
32
- item: v.current,
32
+ return v.setQueryData(_, (e) => [...e.filter((e) => e.id !== y.current.id), r]), {
33
+ item: y.current,
33
34
  notificationKey: t,
34
35
  previousData: n
35
36
  };
@@ -37,21 +38,21 @@ var c = ({ associationQueryKeys: c, getErrorNotificationMessage: l, getIntermedi
37
38
  }
38
39
  return { notificationKey: t };
39
40
  },
40
- onSuccess: async (e, n, i) => {
41
- v.current = void 0, await t.getInstance().invalidateQueryKeys(c), m && await m(e, n, i), r.getInstance().fulfillNotification(i.notificationKey, f(e, i), "success");
41
+ onSuccess: async (t, n, a) => {
42
+ y.current = void 0, await i.resolve(e).invalidateQueryKeys(l), h && await h(t, n, a), i.resolve(r).fulfillNotification(a.notificationKey, p(t, a), "success");
42
43
  }
43
- }), S = a(() => x.mutate, [x.mutate]), C = a(() => x.isPending, [x.isPending]);
44
- return a(() => ({
45
- isMutating: C,
46
- mutate: S,
47
- setPreviousItem: y
44
+ }), C = o(() => S.mutate, [S.mutate]), w = o(() => S.isPending, [S.isPending]);
45
+ return o(() => ({
46
+ isMutating: w,
47
+ mutate: C,
48
+ setPreviousItem: b
48
49
  }), [
50
+ w,
49
51
  C,
50
- S,
51
- y
52
+ b
52
53
  ]);
53
54
  };
54
55
  //#endregion
55
- export { c as useEditMutation };
56
+ export { l as useEditMutation };
56
57
 
57
58
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/hooks/useEditMutation/useEditMutation.ts"],"sourcesContent":["import { useMutation } from '@tanstack/react-query';\nimport type { ReactElement } from 'react';\nimport {\n useCallback,\n useMemo,\n useRef,\n} from 'react';\nimport { ObjectUtil } from '@gen-epix/ui-core/utils/ObjectUtil';\n\nimport { NotificationService } from '../../classes/services/NotificationService';\nimport { QueryClientService } from '../../classes/services/QueryClientService';\nimport type { GenericData } from '../../models/data';\nimport { NotificationUtil } from '../../utils/NotificationUtil';\n\nexport type MutationContextEdit<TData> = { item?: TData; notificationKey?: string; previousData?: TData[] };\n\nexport type UseEditMutationProps<TData, TVariables = TData> = {\n readonly associationQueryKeys?: string[][];\n readonly getErrorNotificationMessage: (data: TData, variables: TVariables, error: unknown) => ReactElement | string;\n // Optional function to get an intermediate item to be set in the query cache before the mutation is completed.\n // This is useful for optimistic updates where you want to show a temporary state before the mutation is confirmed.\n // The function receives the variables and the previous item, and should return the intermediate item.\n // Only needed if the variables are different from the previous item.\n readonly getIntermediateItem?: (variables: TVariables, previousItem: TData) => TData;\n readonly getProgressNotificationMessage: (data: TData, variables: TVariables) => ReactElement | string;\n readonly getSuccessNotificationMessage: (data: TData, context: MutationContextEdit<TData>) => ReactElement | string;\n readonly onError?: (error: unknown, variables: TVariables, context: MutationContextEdit<TData>) => Promise<void> | void;\n readonly onSuccess?: (item: TData, variables: TVariables, context: MutationContextEdit<TData>) => Promise<void> | void;\n readonly queryFn?: (variables: TVariables, previousData: TData) => Promise<TData>;\n readonly resourceQueryKey?: string[];\n};\n\nexport const useEditMutation = <TData extends GenericData | GenericData[], TVariables = TData>({\n associationQueryKeys,\n getErrorNotificationMessage,\n getIntermediateItem,\n getProgressNotificationMessage,\n getSuccessNotificationMessage,\n onError,\n onSuccess,\n queryFn,\n resourceQueryKey,\n}: UseEditMutationProps<TData, TVariables>) => {\n const queryClient = QueryClientService.getInstance().queryClient;\n const previousItemRef = useRef<TData>(undefined);\n\n const setPreviousItem = useCallback((item: TData) => {\n previousItemRef.current = item;\n }, []);\n\n const mutationFn = useCallback(async (variables: TVariables) => {\n return queryFn(ObjectUtil.deepNullifyEmptyStrings(variables), previousItemRef.current);\n }, [previousItemRef, queryFn]);\n\n const editMutation = useMutation<TData, Error, TVariables, MutationContextEdit<TData>>({\n mutationFn,\n onError: async (error, variables, context) => {\n previousItemRef.current = undefined;\n if (resourceQueryKey && Array.isArray(context.previousData)) {\n queryClient.setQueryData(resourceQueryKey, (oldItems: TData[]) => {\n if (!Array.isArray(oldItems)) {\n return oldItems;\n }\n return [...oldItems.filter(x => (x as GenericData).id !== (context.item as GenericData).id), context.item];\n });\n }\n await QueryClientService.getInstance().invalidateQueryKeys(associationQueryKeys);\n if (onError) {\n await onError(error, variables, context);\n }\n NotificationService.getInstance().fulfillNotification(context.notificationKey, NotificationUtil.wrapErrorNotificationMessage(getErrorNotificationMessage(context.item, variables, error), error), 'error');\n },\n onMutate: async (variables) => {\n const notificationKey = NotificationService.getInstance().showNotification({\n isLoading: true,\n message: getProgressNotificationMessage(previousItemRef.current, variables),\n severity: 'info',\n });\n if (resourceQueryKey) {\n if (!previousItemRef.current) {\n throw new Error('previousItem is not set');\n }\n await queryClient.cancelQueries({ queryKey: resourceQueryKey });\n const previousData = queryClient.getQueryData<TData[]>(resourceQueryKey);\n if (Array.isArray(previousData) && !Array.isArray(variables)) {\n const intermediateItem = getIntermediateItem ? getIntermediateItem(variables, previousItemRef.current) : {\n ...variables,\n id: (previousItemRef.current as GenericData).id,\n } as GenericData;\n queryClient.setQueryData<GenericData[]>(resourceQueryKey, (oldItems) => {\n return [...oldItems.filter(x => x.id !== (previousItemRef.current as GenericData).id), intermediateItem] as GenericData[];\n });\n return { item: previousItemRef.current, notificationKey, previousData };\n }\n }\n return { notificationKey };\n },\n onSuccess: async (item, variables, context) => {\n previousItemRef.current = undefined;\n await QueryClientService.getInstance().invalidateQueryKeys(associationQueryKeys);\n if (onSuccess) {\n await onSuccess(item, variables, context);\n }\n NotificationService.getInstance().fulfillNotification(context.notificationKey, getSuccessNotificationMessage(item, context), 'success');\n },\n });\n\n // Note: must be done in useMemo to avoid render loops (useMutation returns a new object every time)\n const mutate = useMemo(() => editMutation.mutate, [editMutation.mutate]);\n const isMutating = useMemo(() => editMutation.isPending, [editMutation.isPending]);\n return useMemo(() => ({ isMutating, mutate, setPreviousItem }), [isMutating, mutate, setPreviousItem]);\n};\n"],"mappings":";;;;;;;AAgCA,IAAa,KAAkF,EAC7F,yBACA,gCACA,wBACA,mCACA,kCACA,YACA,cACA,YACA,0BAC6C;CAC7C,IAAM,IAAc,EAAmB,YAAY,CAAC,CAAC,aAC/C,IAAkB,EAAc,KAAA,CAAS,GAEzC,IAAkB,GAAa,MAAgB;EACnD,EAAgB,UAAU;CAC5B,GAAG,CAAC,CAAC,GAEC,IAAa,EAAY,OAAO,MAC7B,EAAQ,EAAW,wBAAwB,CAAS,GAAG,EAAgB,OAAO,GACpF,CAAC,GAAiB,CAAO,CAAC,GAEvB,IAAe,EAAkE;EACrF;EACA,SAAS,OAAO,GAAO,GAAW,MAAY;GAc5C,AAbA,EAAgB,UAAU,KAAA,GACtB,KAAoB,MAAM,QAAQ,EAAQ,YAAY,KACxD,EAAY,aAAa,IAAmB,MACrC,MAAM,QAAQ,CAAQ,IAGpB,CAAC,GAAG,EAAS,QAAO,MAAM,EAAkB,OAAQ,EAAQ,KAAqB,EAAE,GAAG,EAAQ,IAAI,IAFhG,CAGV,GAEH,MAAM,EAAmB,YAAY,CAAC,CAAC,oBAAoB,CAAoB,GAC3E,KACF,MAAM,EAAQ,GAAO,GAAW,CAAO,GAEzC,EAAoB,YAAY,CAAC,CAAC,oBAAoB,EAAQ,iBAAiB,EAAiB,6BAA6B,EAA4B,EAAQ,MAAM,GAAW,CAAK,GAAG,CAAK,GAAG,OAAO;EAC3M;EACA,UAAU,OAAO,MAAc;GAC7B,IAAM,IAAkB,EAAoB,YAAY,CAAC,CAAC,iBAAiB;IACzE,WAAW;IACX,SAAS,EAA+B,EAAgB,SAAS,CAAS;IAC1E,UAAU;GACZ,CAAC;GACD,IAAI,GAAkB;IACpB,IAAI,CAAC,EAAgB,SACnB,MAAU,MAAM,yBAAyB;IAE3C,MAAM,EAAY,cAAc,EAAE,UAAU,EAAiB,CAAC;IAC9D,IAAM,IAAe,EAAY,aAAsB,CAAgB;IACvE,IAAI,MAAM,QAAQ,CAAY,KAAK,CAAC,MAAM,QAAQ,CAAS,GAAG;KAC5D,IAAM,IAAmB,IAAsB,EAAoB,GAAW,EAAgB,OAAO,IAAI;MACvG,GAAG;MACH,IAAK,EAAgB,QAAwB;KAC/C;KAIA,OAHA,EAAY,aAA4B,IAAmB,MAClD,CAAC,GAAG,EAAS,QAAO,MAAK,EAAE,OAAQ,EAAgB,QAAwB,EAAE,GAAG,CAAgB,CACxG,GACM;MAAE,MAAM,EAAgB;MAAS;MAAiB;KAAa;IACxE;GACF;GACA,OAAO,EAAE,mBAAgB;EAC3B;EACA,WAAW,OAAO,GAAM,GAAW,MAAY;GAM7C,AALA,EAAgB,UAAU,KAAA,GAC1B,MAAM,EAAmB,YAAY,CAAC,CAAC,oBAAoB,CAAoB,GAC3E,KACF,MAAM,EAAU,GAAM,GAAW,CAAO,GAE1C,EAAoB,YAAY,CAAC,CAAC,oBAAoB,EAAQ,iBAAiB,EAA8B,GAAM,CAAO,GAAG,SAAS;EACxI;CACF,CAAC,GAGK,IAAS,QAAc,EAAa,QAAQ,CAAC,EAAa,MAAM,CAAC,GACjE,IAAa,QAAc,EAAa,WAAW,CAAC,EAAa,SAAS,CAAC;CACjF,OAAO,SAAe;EAAE;EAAY;EAAQ;CAAgB,IAAI;EAAC;EAAY;EAAQ;CAAe,CAAC;AACvG"}
1
+ {"version":3,"file":"index.js","names":["rootContainer","QueryClientService","useEditMutation","queryClient","container","previousItemRef","useRef","setPreviousItem","useCallback","item","mutationFn","queryFn","ObjectUtil","variables","editMutation","useMutation","resourceQueryKey","context","oldItems","x","associationQueryKeys","onError","error","NotificationService","NotificationUtil","getErrorNotificationMessage","notificationKey","getProgressNotificationMessage","previousData","intermediateItem","getIntermediateItem","onSuccess","getSuccessNotificationMessage","mutate","useMemo","isMutating"],"sources":["../../../src/hooks/useEditMutation/useEditMutation.ts"],"sourcesContent":["import { container as rootContainer } from 'tsyringe';\nimport { useMutation } from '@tanstack/react-query';\nimport type { ReactElement } from 'react';\nimport {\n useCallback,\n useMemo,\n useRef,\n} from 'react';\nimport { ObjectUtil } from '@gen-epix/ui-core/utils/ObjectUtil';\n\nimport { NotificationService } from '../../classes/services/NotificationService';\nimport { QueryClientService } from '../../classes/services/QueryClientService';\nimport type { GenericData } from '../../models/data.models';\nimport { NotificationUtil } from '../../utils/NotificationUtil';\n\nexport type MutationContextEdit<TData> = { item?: TData; notificationKey?: string; previousData?: TData[] };\n\nexport type UseEditMutationProps<TData, TVariables = TData> = {\n readonly associationQueryKeys?: string[][];\n readonly getErrorNotificationMessage: (data: TData, variables: TVariables, error: unknown) => ReactElement | string;\n // Optional function to get an intermediate item to be set in the query cache before the mutation is completed.\n // This is useful for optimistic updates where you want to show a temporary state before the mutation is confirmed.\n // The function receives the variables and the previous item, and should return the intermediate item.\n // Only needed if the variables are different from the previous item.\n readonly getIntermediateItem?: (variables: TVariables, previousItem: TData) => TData;\n readonly getProgressNotificationMessage: (data: TData, variables: TVariables) => ReactElement | string;\n readonly getSuccessNotificationMessage: (data: TData, context: MutationContextEdit<TData>) => ReactElement | string;\n readonly onError?: (error: unknown, variables: TVariables, context: MutationContextEdit<TData>) => Promise<void> | void;\n readonly onSuccess?: (item: TData, variables: TVariables, context: MutationContextEdit<TData>) => Promise<void> | void;\n readonly queryFn?: (variables: TVariables, previousData: TData) => Promise<TData>;\n readonly resourceQueryKey?: string[];\n};\n\nexport const useEditMutation = <TData extends GenericData | GenericData[], TVariables = TData>({\n associationQueryKeys,\n getErrorNotificationMessage,\n getIntermediateItem,\n getProgressNotificationMessage,\n getSuccessNotificationMessage,\n onError,\n onSuccess,\n queryFn,\n resourceQueryKey,\n}: UseEditMutationProps<TData, TVariables>) => {\n const queryClient = rootContainer.resolve(QueryClientService).queryClient;\n const previousItemRef = useRef<TData>(undefined);\n\n const setPreviousItem = useCallback((item: TData) => {\n previousItemRef.current = item;\n }, []);\n\n const mutationFn = useCallback(async (variables: TVariables) => {\n return queryFn(ObjectUtil.deepNullifyEmptyStrings(variables), previousItemRef.current);\n }, [previousItemRef, queryFn]);\n\n const editMutation = useMutation<TData, Error, TVariables, MutationContextEdit<TData>>({\n mutationFn,\n onError: async (error, variables, context) => {\n previousItemRef.current = undefined;\n if (resourceQueryKey && Array.isArray(context.previousData)) {\n queryClient.setQueryData(resourceQueryKey, (oldItems: TData[]) => {\n if (!Array.isArray(oldItems)) {\n return oldItems;\n }\n return [...oldItems.filter(x => (x as GenericData).id !== (context.item as GenericData).id), context.item];\n });\n }\n await rootContainer.resolve(QueryClientService).invalidateQueryKeys(associationQueryKeys);\n if (onError) {\n await onError(error, variables, context);\n }\n rootContainer.resolve(NotificationService).fulfillNotification(context.notificationKey, NotificationUtil.wrapErrorNotificationMessage(getErrorNotificationMessage(context.item, variables, error), error), 'error');\n },\n onMutate: async (variables) => {\n const notificationKey = rootContainer.resolve(NotificationService).showNotification({\n isLoading: true,\n message: getProgressNotificationMessage(previousItemRef.current, variables),\n severity: 'info',\n });\n if (resourceQueryKey) {\n if (!previousItemRef.current) {\n throw new Error('previousItem is not set');\n }\n await queryClient.cancelQueries({ queryKey: resourceQueryKey });\n const previousData = queryClient.getQueryData<TData[]>(resourceQueryKey);\n if (Array.isArray(previousData) && !Array.isArray(variables)) {\n const intermediateItem = getIntermediateItem ? getIntermediateItem(variables, previousItemRef.current) : {\n ...variables,\n id: (previousItemRef.current as GenericData).id,\n } as GenericData;\n queryClient.setQueryData<GenericData[]>(resourceQueryKey, (oldItems) => {\n return [...oldItems.filter(x => x.id !== (previousItemRef.current as GenericData).id), intermediateItem] as GenericData[];\n });\n return { item: previousItemRef.current, notificationKey, previousData };\n }\n }\n return { notificationKey };\n },\n onSuccess: async (item, variables, context) => {\n previousItemRef.current = undefined;\n await rootContainer.resolve(QueryClientService).invalidateQueryKeys(associationQueryKeys);\n if (onSuccess) {\n await onSuccess(item, variables, context);\n }\n rootContainer.resolve(NotificationService).fulfillNotification(context.notificationKey, getSuccessNotificationMessage(item, context), 'success');\n },\n });\n\n // Note: must be done in useMemo to avoid render loops (useMutation returns a new object every time)\n const mutate = useMemo(() => editMutation.mutate, [editMutation.mutate]);\n const isMutating = useMemo(() => editMutation.isPending, [editMutation.isPending]);\n return useMemo(() => ({ isMutating, mutate, setPreviousItem }), [isMutating, mutate, setPreviousItem]);\n};\n"],"mappings":";;;;;;;;AAiCA,IAAaE,KAAkF,EAC7F,yBACA,gCACA,wBACA,mCACA,kCACA,YACA,cACA,YACA,0BAC6C;CAC7C,IAAMC,IAAcH,EAAc,QAAQC,CAAkB,CAAC,CAAC,aACxDI,IAAkBC,EAAc,KAAA,CAAS,GAEzCC,IAAkBC,GAAa,MAAgB;EACnD,EAAgB,UAAUC;CAC5B,GAAG,CAAC,CAAC,GAECC,IAAaF,EAAY,OAAO,MAC7BG,EAAQC,EAAW,wBAAwBC,CAAS,GAAGR,EAAgB,OAAO,GACpF,CAACA,GAAiBM,CAAO,CAAC,GAEvBG,IAAeC,EAAkE;EACrF;EACA,SAAS,OAAO,GAAO,GAAW,MAAY;GAc5C,AAbA,EAAgB,UAAU,KAAA,GACtBC,KAAoB,MAAM,QAAQC,EAAQ,YAAY,KACxDd,EAAY,aAAaa,IAAmB,MACrC,MAAM,QAAQE,CAAQ,IAGpB,CAAC,GAAGA,EAAS,QAAO,MAAMC,EAAkB,OAAQF,EAAQ,KAAqB,EAAE,GAAGA,EAAQ,IAAI,IAFhGC,CAGV,GAEH,MAAMlB,EAAc,QAAQC,CAAkB,CAAC,CAAC,oBAAoBmB,CAAoB,GACpFC,KACF,MAAMA,EAAQC,GAAOT,GAAWI,CAAO,GAEzCb,EAAc,QAAQmB,CAAmB,CAAC,CAAC,oBAAoBN,EAAQ,iBAAiBO,EAAiB,6BAA6BC,EAA4BR,EAAQ,MAAMJ,GAAWS,CAAK,GAAGA,CAAK,GAAG,OAAO;EACpN;EACA,UAAU,OAAO,MAAc;GAC7B,IAAMI,IAAkB1B,EAAc,QAAQuB,CAAmB,CAAC,CAAC,iBAAiB;IAClF,WAAW;IACX,SAASI,EAA+BtB,EAAgB,SAASQ,CAAS;IAC1E,UAAU;GACZ,CAAC;GACD,IAAIG,GAAkB;IACpB,IAAI,CAACX,EAAgB,SACnB,MAAU,MAAM,yBAAyB;IAE3C,MAAMF,EAAY,cAAc,EAAE,UAAUa,EAAiB,CAAC;IAC9D,IAAMY,IAAezB,EAAY,aAAsBa,CAAgB;IACvE,IAAI,MAAM,QAAQY,CAAY,KAAK,CAAC,MAAM,QAAQf,CAAS,GAAG;KAC5D,IAAMgB,IAAmBC,IAAsBA,EAAoBjB,GAAWR,EAAgB,OAAO,IAAI;MACvG,GAAGQ;MACH,IAAKR,EAAgB,QAAwB;KAC/C;KAIA,OAHAF,EAAY,aAA4Ba,IAAmB,MAClD,CAAC,GAAGE,EAAS,QAAO,MAAKC,EAAE,OAAQd,EAAgB,QAAwB,EAAE,GAAGwB,CAAgB,CACxG,GACM;MAAE,MAAMxB,EAAgB;MAAS;MAAiB;KAAa;IACxE;GACF;GACA,OAAO,EAAE,mBAAgB;EAC3B;EACA,WAAW,OAAO,GAAM,GAAW,MAAY;GAM7C,AALA,EAAgB,UAAU,KAAA,GAC1B,MAAML,EAAc,QAAQC,CAAkB,CAAC,CAAC,oBAAoBmB,CAAoB,GACpFW,KACF,MAAMA,EAAUtB,GAAMI,GAAWI,CAAO,GAE1Cb,EAAc,QAAQmB,CAAmB,CAAC,CAAC,oBAAoBN,EAAQ,iBAAiBe,EAA8BvB,GAAMQ,CAAO,GAAG,SAAS;EACjJ;CACF,CAAC,GAGKgB,IAASC,QAAcpB,EAAa,QAAQ,CAACA,EAAa,MAAM,CAAC,GACjEqB,IAAaD,QAAcpB,EAAa,WAAW,CAACA,EAAa,SAAS,CAAC;CACjF,OAAOoB,SAAe;EAAE;EAAY;EAAQ;CAAgB,IAAI;EAACC;EAAYF;EAAQ1B;CAAe,CAAC;AACvG"}
@@ -1,5 +1,5 @@
1
1
  import { ReactElement } from 'react';
2
- import { GenericData } from '../../models/data';
2
+ import { GenericData } from '../../models/data.models';
3
3
  export type MutationContextEdit<TData> = {
4
4
  item?: TData;
5
5
  notificationKey?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/hooks/useInitializeTableStore/useInitializeTableStore.ts"],"sourcesContent":["import { useStore } from 'zustand';\nimport type { StoreApi } from 'zustand';\nimport { useEffect } from 'react';\n\nimport { DEFAULT_FILTER_GROUP } from '../../classes/abstracts/FilterAbstract';\nimport type { TableColumn } from '../../models/table';\nimport type { TableStore } from '../../stores/tableStore';\nimport { TableUtil } from '../../utils/TableUtil';\n\nexport type UseInitializeTableStoreKWArgs<TData, TDataContext = null> = {\n readonly columns: TableColumn<TData, TDataContext>[];\n readonly context?: TDataContext;\n readonly createFiltersFromColumns?: boolean;\n readonly rows: TData[];\n readonly store: StoreApi<TableStore<TData, TDataContext>>;\n};\n\n\nexport const useInitializeTableStore = <TData, TDataContext = null>({ columns, context, createFiltersFromColumns, rows, store }: UseInitializeTableStoreKWArgs<TData, TDataContext>) => {\n const setColumns = useStore(store, (state) => state.setColumns);\n const setBaseData = useStore(store, (state) => state.setBaseData);\n const setFilters = useStore(store, (state) => state.setFilters);\n const initialize = useStore(store, (state) => state.initialize);\n\n useEffect(() => {\n if (!columns || !rows) {\n return;\n }\n const abortController = new AbortController();\n setColumns(columns);\n setBaseData(rows);\n if (createFiltersFromColumns) {\n setFilters(TableUtil.createFiltersFromColumns(columns, rows, context), [], [DEFAULT_FILTER_GROUP]);\n }\n\n void initialize(abortController.signal);\n return () => {\n abortController.abort();\n };\n }, [columns, initialize, setColumns, setFilters, setBaseData, createFiltersFromColumns, rows, context]);\n};\n"],"mappings":";;;;;AAkBA,IAAa,KAAuD,EAAE,YAAS,YAAS,6BAA0B,SAAM,eAAgE;CACtL,IAAM,IAAa,EAAS,IAAQ,MAAU,EAAM,UAAU,GACxD,IAAc,EAAS,IAAQ,MAAU,EAAM,WAAW,GAC1D,IAAa,EAAS,IAAQ,MAAU,EAAM,UAAU,GACxD,IAAa,EAAS,IAAQ,MAAU,EAAM,UAAU;CAE9D,QAAgB;EACd,IAAI,CAAC,KAAW,CAAC,GACf;EAEF,IAAM,IAAkB,IAAI,gBAAgB;EAQ5C,OAPA,EAAW,CAAO,GAClB,EAAY,CAAI,GACZ,KACF,EAAW,EAAU,yBAAyB,GAAS,GAAM,CAAO,GAAG,CAAC,GAAG,CAAC,CAAoB,CAAC,GAGnG,EAAgB,EAAgB,MAAM,SACzB;GACX,EAAgB,MAAM;EACxB;CACF,GAAG;EAAC;EAAS;EAAY;EAAY;EAAY;EAAa;EAA0B;EAAM;CAAO,CAAC;AACxG"}
1
+ {"version":3,"file":"index.js","names":["TableUtil","useStore","useInitializeTableStore","setColumns","store","state","setBaseData","setFilters","initialize","columns","rows","abortController","createFiltersFromColumns","context","DEFAULT_FILTER_GROUP"],"sources":["../../../src/hooks/useInitializeTableStore/useInitializeTableStore.ts"],"sourcesContent":["import { useStore } from 'zustand';\nimport type { StoreApi } from 'zustand';\nimport { useEffect } from 'react';\n\nimport { DEFAULT_FILTER_GROUP } from '../../classes/abstracts/FilterAbstract';\nimport type { TableColumn } from '../../models/table.models';\nimport type { TableStore } from '../../stores/tableStore';\nimport { TableUtil } from '../../utils/TableUtil';\n\nexport type UseInitializeTableStoreKWArgs<TData, TDataContext = null> = {\n readonly columns: TableColumn<TData, TDataContext>[];\n readonly context?: TDataContext;\n readonly createFiltersFromColumns?: boolean;\n readonly rows: TData[];\n readonly store: StoreApi<TableStore<TData, TDataContext>>;\n};\n\n\nexport const useInitializeTableStore = <TData, TDataContext = null>({ columns, context, createFiltersFromColumns, rows, store }: UseInitializeTableStoreKWArgs<TData, TDataContext>) => {\n const setColumns = useStore(store, (state) => state.setColumns);\n const setBaseData = useStore(store, (state) => state.setBaseData);\n const setFilters = useStore(store, (state) => state.setFilters);\n const initialize = useStore(store, (state) => state.initialize);\n\n useEffect(() => {\n if (!columns || !rows) {\n return;\n }\n const abortController = new AbortController();\n setColumns(columns);\n setBaseData(rows);\n if (createFiltersFromColumns) {\n setFilters(TableUtil.createFiltersFromColumns(columns, rows, context), [], [DEFAULT_FILTER_GROUP]);\n }\n\n void initialize(abortController.signal);\n return () => {\n abortController.abort();\n };\n }, [columns, initialize, setColumns, setFilters, setBaseData, createFiltersFromColumns, rows, context]);\n};\n"],"mappings":";;;;;AAkBA,IAAaE,KAAuD,EAAE,YAAS,YAAS,6BAA0B,SAAM,eAAgE;CACtL,IAAMC,IAAaF,EAASG,IAAQ,MAAUC,EAAM,UAAU,GACxDC,IAAcL,EAASG,IAAQ,MAAUC,EAAM,WAAW,GAC1DE,IAAaN,EAASG,IAAQ,MAAUC,EAAM,UAAU,GACxDG,IAAaP,EAASG,IAAQ,MAAUC,EAAM,UAAU;CAE9D,QAAgB;EACd,IAAI,CAACI,KAAW,CAACC,GACf;EAEF,IAAMC,IAAkB,IAAI,gBAAgB;EAQ5C,OAPAR,EAAWM,CAAO,GAClBH,EAAYI,CAAI,GACZE,KACFL,EAAWP,EAAU,yBAAyBS,GAASC,GAAMG,CAAO,GAAG,CAAC,GAAG,CAACC,CAAoB,CAAC,GAGnGN,EAAgBG,EAAgB,MAAM,SACzB;GACX,EAAgB,MAAM;EACxB;CACF,GAAG;EAACF;EAASD;EAAYL;EAAYI;EAAYD;EAAaM;EAA0BF;EAAMG;CAAO,CAAC;AACxG"}
@@ -1,5 +1,5 @@
1
1
  import { StoreApi } from 'zustand';
2
- import { TableColumn } from '../../models/table';
2
+ import { TableColumn } from '../../models/table.models';
3
3
  import { TableStore } from '../../stores/tableStore';
4
4
  export type UseInitializeTableStoreKWArgs<TData, TDataContext = null> = {
5
5
  readonly columns: TableColumn<TData, TDataContext>[];