@gen-epix/ui-client-common 4.4.2 → 4.5.1
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.
- package/README.md +7 -6
- package/dist/@types/mui.d.ts +13 -5
- package/dist/@types/ui-client-common.d.ts +1 -0
- package/dist/_chunks/ApplicationFooter.js +44 -44
- package/dist/_chunks/ApplicationFooter.js.map +1 -1
- package/dist/_chunks/Breadcrumbs.js +13 -13
- package/dist/_chunks/Breadcrumbs.js.map +1 -1
- package/dist/_chunks/CrudPage.js +300 -300
- package/dist/_chunks/CrudPage.js.map +1 -1
- package/dist/_chunks/Notifications.js +51 -51
- package/dist/_chunks/Notifications.js.map +1 -1
- package/dist/_chunks/OutageList.js +29 -29
- package/dist/_chunks/OutageUtil.js +1 -2
- package/dist/_chunks/OutageUtil.js.map +1 -1
- package/dist/_chunks/QueryClientService.js +96 -388
- package/dist/_chunks/QueryClientService.js.map +1 -1
- package/dist/_chunks/Table.js +518 -512
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/TableUtil.js +8 -16
- package/dist/_chunks/TableUtil.js.map +1 -1
- package/dist/_chunks/TextFilter.js +14 -12
- package/dist/_chunks/TextFilter.js.map +1 -1
- package/dist/_chunks/UserInvitationsAdminPage.js +77 -77
- package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
- package/dist/_chunks/UserManagerUtil.js +210 -209
- package/dist/_chunks/UserManagerUtil.js.map +1 -1
- package/dist/_chunks/_baseFlatten.js +8 -8
- package/dist/_chunks/_baseFlatten.js.map +1 -1
- package/dist/_chunks/_baseGet.js +280 -0
- package/dist/_chunks/_baseGet.js.map +1 -0
- package/dist/_chunks/_baseIteratee.js +274 -0
- package/dist/_chunks/_baseIteratee.js.map +1 -0
- package/dist/_chunks/_baseUnset.js +22 -299
- package/dist/_chunks/_baseUnset.js.map +1 -1
- package/dist/_chunks/last.js +13 -0
- package/dist/_chunks/last.js.map +1 -0
- package/dist/_chunks/omit.js +41 -40
- package/dist/_chunks/omit.js.map +1 -1
- package/dist/_chunks/tableStore.js +190 -183
- package/dist/_chunks/tableStore.js.map +1 -1
- package/dist/_chunks/uniq.js +44 -0
- package/dist/_chunks/uniq.js.map +1 -0
- package/dist/_chunks/useMutation.js +22 -22
- package/dist/_chunks/useMutation.js.map +1 -1
- package/dist/_chunks/useQueryMemo.js +25 -8
- package/dist/_chunks/useQueryMemo.js.map +1 -1
- package/dist/classes/abstracts/FilterAbstract/index.js +3 -1
- package/dist/classes/abstracts/FilterAbstract/index.js.map +1 -1
- package/dist/classes/filters/MultiSelectFilter.d.ts +1 -1
- package/dist/classes/services/AuthenticationService/AuthenticationService.d.ts +1 -1
- package/dist/classes/services/AuthenticationService/index.js +15 -15
- package/dist/classes/services/AuthenticationService/index.js.map +1 -1
- package/dist/classes/services/AuthorizationService/index.js +4 -4
- package/dist/classes/services/AuthorizationService/index.js.map +1 -1
- package/dist/classes/services/BackendVersionService/index.js +3 -2
- package/dist/classes/services/BackendVersionService/index.js.map +1 -1
- package/dist/classes/services/BreadcrumbService/index.js +16 -38
- package/dist/classes/services/BreadcrumbService/index.js.map +1 -1
- package/dist/classes/services/EmotionCacheService/index.js +9 -8
- package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
- package/dist/classes/services/I18nService/index.js +11 -10
- package/dist/classes/services/I18nService/index.js.map +1 -1
- package/dist/classes/services/InactivityService/index.js +12 -12
- package/dist/classes/services/InactivityService/index.js.map +1 -1
- package/dist/classes/services/LogService/index.js +39 -33
- package/dist/classes/services/LogService/index.js.map +1 -1
- package/dist/classes/services/NotificationService/index.js +8 -8
- package/dist/classes/services/NotificationService/index.js.map +1 -1
- package/dist/classes/services/PageEventBusService/index.js +13 -9
- package/dist/classes/services/PageEventBusService/index.js.map +1 -1
- package/dist/classes/services/RouterService/index.js +3 -6
- package/dist/classes/services/RouterService/index.js.map +1 -1
- package/dist/components/app/App/App.d.ts +1 -1
- package/dist/components/app/App/index.js +34 -38
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +28 -28
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +47 -45
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -1
- package/dist/components/app/AuthenticationWrapper/index.js +35 -35
- package/dist/components/app/AuthenticationWrapper/index.js.map +1 -1
- package/dist/components/app/AuthorizationWrapper/index.js +19 -19
- package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
- package/dist/components/app/RouterRoot/index.js +52 -50
- package/dist/components/app/RouterRoot/index.js.map +1 -1
- package/dist/components/epi/EpiContactDetailsDialog/index.js +21 -21
- package/dist/components/epi/EpiContactDetailsDialog/index.js.map +1 -1
- package/dist/components/filters/BooleanFilterField/index.js +5 -5
- package/dist/components/filters/DateFilterField/index.js +3 -3
- package/dist/components/filters/GeoFilterField/index.js +4 -4
- package/dist/components/filters/MultiSelectFilterField/index.js +4 -4
- package/dist/components/filters/NumberRangeFilterField/index.js +3 -3
- package/dist/components/filters/TextFilterField/index.js +3 -3
- package/dist/components/ui/ApplicationBar/index.js +188 -188
- package/dist/components/ui/ApplicationBar/index.js.map +1 -1
- package/dist/components/ui/GenericErrorMessage/index.js +29 -29
- package/dist/components/ui/GenericErrorMessage/index.js.map +1 -1
- package/dist/components/ui/LicensesDialog/index.js +38 -38
- package/dist/components/ui/LicensesDialog/index.js.map +1 -1
- package/dist/components/ui/MyPermissionsDialog/index.js +16 -16
- package/dist/components/ui/MyPermissionsDialog/index.js.map +1 -1
- package/dist/components/ui/NavLink/index.js +6 -6
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +21 -21
- package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
- package/dist/components/ui/PageContainer/index.js +24 -24
- package/dist/components/ui/PageContainer/index.js.map +1 -1
- package/dist/components/ui/Sidebar/index.js +30 -30
- package/dist/components/ui/UserFeedbackDialog/index.js +12 -12
- package/dist/components/ui/UserFeedbackDialog/index.js.map +1 -1
- package/dist/components/ui/UserInactivityConfirmation/index.js.map +1 -1
- package/dist/constants/config.constants.d.ts +0 -2
- package/dist/constants/config.constants.js +2 -2
- package/dist/constants/config.constants.js.map +1 -1
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +12 -12
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js.map +1 -1
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js +14 -14
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js.map +1 -1
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +12 -12
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +13 -13
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js +4 -4
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationsQuery/index.js +13 -13
- package/dist/dataHooks/useOrganizationsQuery/index.js.map +1 -1
- package/dist/dataHooks/useUsersQuery/index.js +10 -10
- package/dist/dataHooks/useUsersQuery/index.js.map +1 -1
- package/dist/hoc/withPermissions/index.js.map +1 -1
- package/dist/hooks/useConfig/index.js +2 -2
- package/dist/hooks/useConfig/index.js.map +1 -1
- package/dist/hooks/useCreateMutation/index.js +12 -12
- package/dist/hooks/useCreateMutation/index.js.map +1 -1
- package/dist/hooks/useDeleteMutation/index.js +16 -9
- package/dist/hooks/useDeleteMutation/index.js.map +1 -1
- package/dist/hooks/useEditMutation/index.js +48 -33
- package/dist/hooks/useEditMutation/index.js.map +1 -1
- package/dist/hooks/useItemQuery/index.js +4 -4
- package/dist/hooks/useItemQuery/index.js.map +1 -1
- package/dist/hooks/useUpdateBreadcrumb/index.js.map +1 -1
- package/dist/locale/en.json +1 -0
- package/dist/locale/nl.json +1 -0
- package/dist/models/config.models.d.ts +1 -5
- package/dist/models/theme.models.d.ts +19 -16
- package/dist/pages/AcceptInvitationPage/index.js +25 -25
- package/dist/pages/AcceptInvitationPage/index.js.map +1 -1
- package/dist/pages/AdminPage/index.js +16 -16
- package/dist/pages/AdminPage/index.js.map +1 -1
- package/dist/pages/ChooseIdentityProviderPage/index.js +21 -21
- package/dist/pages/ChooseIdentityProviderPage/index.js.map +1 -1
- package/dist/pages/IdentifierIssuersAdminPage/index.js +5 -5
- package/dist/pages/IdentifierIssuersAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +5 -5
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationContactsAdminPage/index.js +6 -6
- package/dist/pages/OrganizationContactsAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationSitesAdminPage/index.js +9 -9
- package/dist/pages/OrganizationSitesAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationsAdminPage/index.js +13 -13
- package/dist/pages/OrganizationsAdminPage/index.js.map +1 -1
- package/dist/pages/OutagesAdminPage/index.js +20 -20
- package/dist/pages/OutagesAdminPage/index.js.map +1 -1
- package/dist/pages/PostLoginPage/index.js +6 -6
- package/dist/pages/PostLoginPage/index.js.map +1 -1
- package/dist/pages/PostLogoutPage/index.js +8 -8
- package/dist/pages/PostLogoutPage/index.js.map +1 -1
- package/dist/pages/UsersAdminPage/index.js +39 -39
- package/dist/pages/UsersAdminPage/index.js.map +1 -1
- package/dist/setup/setup.d.ts +1 -1
- package/dist/setup/setup.js +11 -4
- package/dist/setup/setup.js.map +1 -1
- package/dist/theme/demoTheme/index.js +17 -15
- package/dist/theme/demoTheme/index.js.map +1 -1
- package/dist/utils/DataHookUtil/index.js +1 -1
- package/dist/utils/DataHookUtil/index.js.map +1 -1
- package/dist/utils/DependencyContainerUtil/DependencyContainerUtil.d.ts +2 -3
- package/dist/utils/DependencyContainerUtil/index.js +10 -16
- package/dist/utils/DependencyContainerUtil/index.js.map +1 -1
- package/dist/utils/MenuDataUtil/index.js +1 -1
- package/dist/utils/MenuDataUtil/index.js.map +1 -1
- package/dist/utils/StandardConfigUtil/index.js +0 -4
- package/dist/utils/StandardConfigUtil/index.js.map +1 -1
- package/dist/utils/TimeUtil/index.js +1 -1
- package/dist/utils/TimeUtil/index.js.map +1 -1
- package/package.json +11 -14
- package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContext.d.ts +0 -9
- package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContextProvider.d.ts +0 -6
- package/dist/context/uiClientCommonConfigContext/index.d.ts +0 -3
- package/dist/context/uiClientCommonConfigContext/index.js +0 -34
- package/dist/context/uiClientCommonConfigContext/index.js.map +0 -1
- package/dist/context/uiClientCommonConfigContext/useUiClientCommonConfigContext.d.ts +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["useQueryMemo","QueryClientService","useOrganizationsQuery","container","API_ORGANIZATION_TOKEN","COMMON_QUERY_KEY","useOrganizationMapQuery","organizationsQuery","useMemo","DataHookUtil","item","useOrganizationOptionsQuery","StringUtil","a","b"],"sources":["../../../src/dataHooks/useOrganizationsQuery/useOrganizationsQuery.ts"],"sourcesContent":["import { container } from 'tsyringe';\nimport type { UseQueryResult } from '@tanstack/react-query';\nimport { useMemo } from 'react';\nimport type { CommonDbOrganization } from '@gen-epix/api-commondb';\nimport { StringUtil } from '@gen-epix/ui-core/utils/StringUtil';\n\nimport { API_ORGANIZATION_TOKEN } from '../../constants/api.constants';\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';\n\nexport const useOrganizationsQuery = (): UseQueryResult<CommonDbOrganization[]> => {\n return useQueryMemo({\n queryFn: async ({ signal }) => {\n const response = await container.resolve(API_ORGANIZATION_TOKEN).organizationsGetAll(null, null, { signal });\n return response.data;\n },\n queryKey: container.resolve(QueryClientService).getGenericKey(COMMON_QUERY_KEY.ORGANIZATIONS),\n });\n};\n\nexport const useOrganizationMapQuery = (): UseMap<CommonDbOrganization> => {\n const organizationsQuery = useOrganizationsQuery();\n\n return useMemo(() => {\n return DataHookUtil.createUseMapDataHook<CommonDbOrganization>(organizationsQuery, item => item.id);\n }, [organizationsQuery]);\n};\n\nexport const useOrganizationOptionsQuery = (): UseOptions<string> => {\n const organizationsQuery = useOrganizationsQuery();\n\n return useMemo(() => {\n return DataHookUtil.createUseOptionsDataHook<CommonDbOrganization>(organizationsQuery, item => item.id, item => item.name, [], (a, b) => StringUtil.advancedSortComperator(a.name, b.name));\n }, [organizationsQuery]);\n};\n"],"mappings":";;;;;;;;;AAgBA,IAAaE,UACJF,EAAa;CAClB,SAAS,OAAO,EAAE,iBAET,MADgBG,EAAU,QAAQC,CAAsB,CAAC,CAAC,oBAAoB,MAAM,MAAM,EAAE,UAAO,CAAC,EAAA,CAC3F;CAElB,UAAUD,EAAU,QAAQF,CAAkB,CAAC,CAAC,cAAcI,EAAiB,aAAa;AAC9F,CAAC,GAGUC,UAA8D;CACzE,IAAMC,IAAqBL,EAAsB;CAEjD,OAAOM,QACEC,EAAa,qBAA2CF,IAAoB,MAAQG,EAAK,EAAE,GACjG,CAACH,CAAkB,CAAC;AACzB,GAEaI,UAAwD;CACnE,IAAMJ,IAAqBL,EAAsB;CAEjD,OAAOM,QACEC,EAAa,yBAA+CF,IAAoB,MAAQG,EAAK,KAAI,MAAQA,EAAK,MAAM,CAAC,IAAI,GAAG,MAAME,EAAW,uBAAuBC,EAAE,MAAMC,EAAE,IAAI,CAAC,GACzL,CAACP,CAAkB,CAAC;AACzB"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { UserUtil as e } from "../../utils/UserUtil/index.js";
|
|
2
|
-
import { t } from "../../
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { DataHookUtil as t } from "../../utils/DataHookUtil/index.js";
|
|
3
|
+
import { API_ORGANIZATION_TOKEN as n } from "../../constants/api.constants.js";
|
|
4
|
+
import { t as r } from "../../_chunks/useQueryMemo.js";
|
|
5
|
+
import { t as i } from "../../_chunks/QueryClientService.js";
|
|
6
6
|
import { COMMON_QUERY_KEY as a } from "../../constants/query.constants.js";
|
|
7
7
|
import { container as o } from "tsyringe";
|
|
8
8
|
import { useMemo as s } from "react";
|
|
9
9
|
import { useTranslation as c } from "react-i18next";
|
|
10
10
|
//#region src/dataHooks/useUsersQuery/useUsersQuery.ts
|
|
11
|
-
var l = () =>
|
|
12
|
-
queryFn: async ({ signal: e }) => (await o.resolve(
|
|
13
|
-
queryKey: o.resolve(
|
|
11
|
+
var l = () => r({
|
|
12
|
+
queryFn: async ({ signal: e }) => (await o.resolve(n).usersGetAll(null, null, { signal: e })).data,
|
|
13
|
+
queryKey: o.resolve(i).getGenericKey(a.USERS)
|
|
14
14
|
}), u = () => {
|
|
15
15
|
let e = l();
|
|
16
|
-
return s(() =>
|
|
16
|
+
return s(() => t.createUseMapDataHook(e, (e) => e.id), [e]);
|
|
17
17
|
}, d = () => {
|
|
18
|
-
let
|
|
19
|
-
return s(() =>
|
|
18
|
+
let n = l(), { t: r } = c();
|
|
19
|
+
return s(() => t.createUseOptionsDataHook(n, (e) => e.id, (t) => e.getUserDisplayValue(t, r)), [r, n]);
|
|
20
20
|
};
|
|
21
21
|
//#endregion
|
|
22
22
|
export { d as useUserOptionsQuery, u as useUsersMapQuery, l as useUsersQuery };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["useQueryMemo","QueryClientService","useUsersQuery","container","API_ORGANIZATION_TOKEN","COMMON_QUERY_KEY","useUsersMapQuery","usersQuery","useMemo","DataHookUtil","item","useUserOptionsQuery","useTranslation","UserUtil","t"],"sources":["../../../src/dataHooks/useUsersQuery/useUsersQuery.ts"],"sourcesContent":["import { container } 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 '../../constants/api.constants';\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 container.resolve(API_ORGANIZATION_TOKEN).usersGetAll(null, null, { signal });\n return response.data;\n },\n queryKey: container.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,UACJF,EAAa;CAClB,SAAS,OAAO,EAAE,iBAET,MADgBG,EAAU,QAAQC,CAAsB,CAAC,CAAC,YAAY,MAAM,MAAM,EAAE,UAAO,CAAC,EAAA,CACnF;CAElB,UAAUD,EAAU,QAAQF,CAAkB,CAAC,CAAC,cAAcI,EAAiB,KAAK;AACtF,CAAC,GAGUC,UAA+C;CAC1D,IAAMC,IAAaL,EAAc;CAEjC,OAAOM,QACEC,EAAa,qBAAmCF,IAAY,MAAQG,EAAK,EAAE,GACjF,CAACH,CAAU,CAAC;AACjB,GAEaI,UAAgD;CAC3D,IAAMJ,IAAaL,EAAc,GAC3B,EAAE,SAAMU,EAAe;CAE7B,OAAOJ,QACEC,EAAa,yBAAuCF,IAAY,MAAQG,EAAK,KAAI,MAAQG,EAAS,oBAAoBH,GAAMI,CAAC,CAAC,GACpI,CAACA,GAAGP,CAAU,CAAC;AACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["withPermissions","WrappedComponent","useMemo","container","AuthorizationService","options","FallbackComponent","Component","props"],"sources":["../../../src/hoc/withPermissions/withPermissions.tsx"],"sourcesContent":["import { container } 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(() => container.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,IAAaA,KACX,GACA,MACG;CACH,IAAMC,KAAoB,MAAkB;EAG1C,IAAI,CAFyBC,QAAcC,EAAU,QAAQC,CAAoB,GAAG,CAAC,CAEhF,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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DependencyContainerUtil as e } from "../../utils/DependencyContainerUtil/index.js";
|
|
2
2
|
//#region src/hooks/useConfig/useConfig.ts
|
|
3
|
-
var t = () => e()
|
|
3
|
+
var t = () => e.resolveConfig();
|
|
4
4
|
//#endregion
|
|
5
5
|
export { t as useConfig };
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useConfig","
|
|
1
|
+
{"version":3,"file":"index.js","names":["useConfig","DependencyContainerUtil"],"sources":["../../../src/hooks/useConfig/useConfig.ts"],"sourcesContent":["import type { ConfigBase } from '../../models/config.models';\nimport { DependencyContainerUtil } from '../../utils/DependencyContainerUtil';\n\n// eslint-disable-next-line @eslint-react/no-unnecessary-use-prefix\nexport const useConfig = <TConfig extends ConfigBase = ConfigBase>(): TConfig => {\n return DependencyContainerUtil.resolveConfig<TConfig>();\n};\n"],"mappings":";;AAIA,IAAaA,UACJC,EAAwB,cAAuB"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../../_chunks/
|
|
3
|
-
import {
|
|
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";
|
|
4
4
|
import { NotificationService as r } from "../../classes/services/NotificationService/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { container as i } from "tsyringe";
|
|
6
|
+
import { StringUtil as a } from "@gen-epix/ui-core/utils/StringUtil";
|
|
7
7
|
import { useMemo as o } from "react";
|
|
8
8
|
import { ObjectUtil as s } from "@gen-epix/ui-core/utils/ObjectUtil";
|
|
9
9
|
//#region src/hooks/useCreateMutation/useCreateMutation.ts
|
|
10
10
|
var c = ({ associationQueryKeys: c, getErrorNotificationMessage: l, getProgressNotificationMessage: u, getSuccessNotificationMessage: d, onError: f, onSuccess: p, queryFn: m, resourceQueryKey: h }) => {
|
|
11
|
-
let g =
|
|
11
|
+
let g = i.resolve(t).queryClient, _ = n({
|
|
12
12
|
mutationFn: async (e) => m(s.deepNullifyEmptyStrings(e)),
|
|
13
|
-
onError: async (
|
|
14
|
-
h && g.setQueryData(h, (e) => Array.isArray(e) ? [...e.filter((e) => e?.id !== o.temporaryId)] : e), await
|
|
13
|
+
onError: async (n, a, o) => {
|
|
14
|
+
h && g.setQueryData(h, (e) => Array.isArray(e) ? [...e.filter((e) => e?.id !== o.temporaryId)] : e), await i.resolve(t).invalidateQueryKeys(c), f && await f(n, a, o), i.resolve(r).fulfillNotification(o.notificationKey, e.wrapErrorNotificationMessage(l(a, n), n), "error");
|
|
15
15
|
},
|
|
16
16
|
onMutate: async (e) => {
|
|
17
|
-
let t =
|
|
17
|
+
let t = i.resolve(r).showNotification({
|
|
18
18
|
isLoading: !0,
|
|
19
19
|
message: u(e),
|
|
20
20
|
severity: "info"
|
|
@@ -23,7 +23,7 @@ var c = ({ associationQueryKeys: c, getErrorNotificationMessage: l, getProgressN
|
|
|
23
23
|
await g.cancelQueries({ queryKey: h });
|
|
24
24
|
let n = g.getQueryData(h);
|
|
25
25
|
if (Array.isArray(n)) {
|
|
26
|
-
let r =
|
|
26
|
+
let r = a.createUuid();
|
|
27
27
|
return g.setQueryData(h, (t) => [{
|
|
28
28
|
...e,
|
|
29
29
|
id: r
|
|
@@ -36,8 +36,8 @@ var c = ({ associationQueryKeys: c, getErrorNotificationMessage: l, getProgressN
|
|
|
36
36
|
}
|
|
37
37
|
return { notificationKey: t };
|
|
38
38
|
},
|
|
39
|
-
onSuccess: async (
|
|
40
|
-
h && Array.isArray(
|
|
39
|
+
onSuccess: async (e, n, a) => {
|
|
40
|
+
h && Array.isArray(a?.previousData) && !Array.isArray(e) && g.setQueryData(h, (t) => [e, ...t.filter((e) => e.id !== a.temporaryId)]), await i.resolve(t).invalidateQueryKeys(c), p && await p(e, n, a), i.resolve(r).fulfillNotification(a.notificationKey, d(e, a), "success");
|
|
41
41
|
}
|
|
42
42
|
}), v = o(() => _.mutate, [_.mutate]), y = o(() => _.isPending, [_.isPending]);
|
|
43
43
|
return o(() => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["useMutation","useCreateMutation","queryClient","container","QueryClientService","createMutation","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 } 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 = container.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 container.resolve(QueryClientService).invalidateQueryKeys(associationQueryKeys);\n if (onError) {\n await onError(error, variables, context);\n }\n container.resolve(NotificationService).fulfillNotification(context.notificationKey, NotificationUtil.wrapErrorNotificationMessage(getErrorNotificationMessage(variables, error), error), 'error');\n },\n onMutate: async (variables) => {\n const notificationKey = container.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 container.resolve(QueryClientService).invalidateQueryKeys(associationQueryKeys);\n if (onSuccess) {\n await onSuccess(item, variables, context);\n }\n container.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,IAAaC,KAAoF,EAC/F,yBACA,gCACA,mCACA,kCACA,YACA,cACA,YACA,0BAC+C;CAC/C,IAAMC,IAAcC,EAAU,QAAQC,CAAkB,CAAC,CAAC,aAEpDC,IAAiBL,EAAoE;EACzF,YAAY,OAAO,MACVM,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,MAAMP,EAAU,QAAQC,CAAkB,CAAC,CAAC,oBAAoBQ,CAAoB,GAChFC,KACF,MAAMA,EAAQC,GAAOC,GAAWJ,CAAO,GAEzCR,EAAU,QAAQa,CAAmB,CAAC,CAAC,oBAAoBL,EAAQ,iBAAiBM,EAAiB,6BAA6BC,EAA4BH,GAAWD,CAAK,GAAGA,CAAK,GAAG,OAAO;EAClM;EACA,UAAU,OAAO,MAAc;GAC7B,IAAMK,IAAkBhB,EAAU,QAAQa,CAAmB,CAAC,CAAC,iBAAiB;IAC9E,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,MAAMR,EAAU,QAAQC,CAAkB,CAAC,CAAC,oBAAoBQ,CAAoB,GAChFa,KACF,MAAMA,EAAUjB,GAAMO,GAAWJ,CAAO,GAE1CR,EAAU,QAAQa,CAAmB,CAAC,CAAC,oBAAoBL,EAAQ,iBAAiBe,EAA8BlB,GAAMG,CAAO,GAAG,SAAS;EAC7I;CACF,CAAC,GAGKgB,IAASC,QAAcvB,EAAe,QAAQ,CAACA,EAAe,MAAM,CAAC,GACrEwB,IAAaD,QAAcvB,EAAe,WAAW,CAACA,EAAe,SAAS,CAAC;CACrF,OAAOuB,SAAe;EAAE;EAAY;CAAO,IAAI,CAACC,GAAYF,CAAM,CAAC;AACrE"}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../../_chunks/
|
|
3
|
-
import {
|
|
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";
|
|
4
4
|
import { NotificationService as r } from "../../classes/services/NotificationService/index.js";
|
|
5
5
|
import { container as i } from "tsyringe";
|
|
6
6
|
import { useMemo as a } from "react";
|
|
7
7
|
//#region src/hooks/useDeleteMutation/useDeleteMutation.ts
|
|
8
8
|
var o = ({ associationQueryKeys: o, getErrorNotificationMessage: s, getProgressNotificationMessage: c, getSuccessNotificationMessage: l, onError: u, onSuccess: d, queryFn: f, resourceQueryKey: p }) => {
|
|
9
|
-
let m = i.resolve(
|
|
10
|
-
mutationFn: async (e) =>
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
let m = i.resolve(t).queryClient, h = n({
|
|
10
|
+
mutationFn: async (e) => {
|
|
11
|
+
if (!f) throw Error("Delete mutation queryFn is required");
|
|
12
|
+
return f(e);
|
|
13
|
+
},
|
|
14
|
+
onError: async (n, a, c) => {
|
|
15
|
+
p && Array.isArray(c.previousData) && m.setQueryData(p, c.previousData), o && await i.resolve(t).invalidateQueryKeys(o), u && await u(n, a, c);
|
|
16
|
+
let l = s?.(a, n) ?? String(n);
|
|
17
|
+
i.resolve(r).fulfillNotification(c.notificationKey, e.wrapErrorNotificationMessage(l, n), "error");
|
|
13
18
|
},
|
|
14
19
|
onMutate: async (e) => {
|
|
15
20
|
let t = i.resolve(r).showNotification({
|
|
@@ -27,8 +32,10 @@ var o = ({ associationQueryKeys: o, getErrorNotificationMessage: s, getProgressN
|
|
|
27
32
|
}
|
|
28
33
|
return { notificationKey: t };
|
|
29
34
|
},
|
|
30
|
-
onSuccess: async (
|
|
31
|
-
o && await i.resolve(
|
|
35
|
+
onSuccess: async (e, n, a) => {
|
|
36
|
+
o && await i.resolve(t).invalidateQueryKeys(o), d && await d(n, a);
|
|
37
|
+
let s = l?.(n, a) ?? "Deleted successfully";
|
|
38
|
+
i.resolve(r).fulfillNotification(a.notificationKey, s, "success");
|
|
32
39
|
}
|
|
33
40
|
}), g = a(() => h.mutate, [h.mutate]), _ = a(() => h.isPending, [h.isPending]);
|
|
34
41
|
return a(() => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["useMutation","useDeleteMutation","queryClient","container","QueryClientService","deleteMutation","queryFn","item","resourceQueryKey","context","associationQueryKeys","onError","error","errorMessage","getErrorNotificationMessage","NotificationService","NotificationUtil","notificationKey","getProgressNotificationMessage","previousData","oldItems","i","onSuccess","successMessage","getSuccessNotificationMessage","mutate","useMemo","isMutating"],"sources":["../../../src/hooks/useDeleteMutation/useDeleteMutation.ts"],"sourcesContent":["import { container } 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 = container.resolve(QueryClientService).queryClient;\n\n const deleteMutation = useMutation<unknown, Error, TData, MutationContextDelete<TData>>({\n mutationFn: async (item) => {\n if (!queryFn) {\n throw new Error('Delete mutation queryFn is required');\n }\n return queryFn(item);\n },\n onError: async (error, item, context) => {\n if (resourceQueryKey && Array.isArray(context.previousData)) {\n queryClient.setQueryData<TData[]>(resourceQueryKey, context.previousData);\n }\n if (associationQueryKeys) {\n await container.resolve(QueryClientService).invalidateQueryKeys(associationQueryKeys);\n }\n if (onError) {\n await onError(error, item, context);\n }\n const errorMessage = getErrorNotificationMessage?.(item, error) ?? String(error);\n container.resolve(NotificationService).fulfillNotification(context.notificationKey, NotificationUtil.wrapErrorNotificationMessage(errorMessage, error), 'error');\n },\n onMutate: async (item) => {\n const notificationKey = container.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 container.resolve(QueryClientService).invalidateQueryKeys(associationQueryKeys);\n }\n if (onSuccess) {\n await onSuccess(item, context);\n }\n const successMessage = getSuccessNotificationMessage?.(item, context) ?? 'Deleted successfully';\n container.resolve(NotificationService).fulfillNotification(context.notificationKey, successMessage, '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,IAAaC,KAAgE,EAC3E,yBACA,gCACA,mCACA,kCACA,YACA,cACA,YACA,0BACmC;CACnC,IAAMC,IAAcC,EAAU,QAAQC,CAAkB,CAAC,CAAC,aAEpDC,IAAiBL,EAAiE;EACtF,YAAY,OAAO,MAAS;GAC1B,IAAI,CAACM,GACH,MAAU,MAAM,qCAAqC;GAEvD,OAAOA,EAAQC,CAAI;EACrB;EACA,SAAS,OAAO,GAAO,GAAM,MAAY;GAOvC,AANIC,KAAoB,MAAM,QAAQC,EAAQ,YAAY,KACxDP,EAAY,aAAsBM,GAAkBC,EAAQ,YAAY,GAEtEC,KACF,MAAMP,EAAU,QAAQC,CAAkB,CAAC,CAAC,oBAAoBM,CAAoB,GAElFC,KACF,MAAMA,EAAQC,GAAOL,GAAME,CAAO;GAEpC,IAAMI,IAAeC,IAA8BP,GAAMK,CAAK,KAAK,OAAOA,CAAK;GAC/E,EAAU,QAAQG,CAAmB,CAAC,CAAC,oBAAoBN,EAAQ,iBAAiBO,EAAiB,6BAA6BH,GAAcD,CAAK,GAAG,OAAO;EACjK;EACA,UAAU,OAAO,MAAS;GACxB,IAAMK,IAAkBd,EAAU,QAAQY,CAAmB,CAAC,CAAC,iBAAiB;IAC9E,WAAW;IACX,SAASG,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,MAClDY,EAAS,QAAO,MAAKC,EAAE,OAAOd,EAAK,EAAE,CAC7C,GACM;KAAE;KAAiB;IAAa;GAE3C;GACA,OAAO,EAAE,mBAAgB;EAC3B;EACA,WAAW,OAAO,GAAO,GAAM,MAAY;GAIzC,AAHIG,KACF,MAAMP,EAAU,QAAQC,CAAkB,CAAC,CAAC,oBAAoBM,CAAoB,GAElFY,KACF,MAAMA,EAAUf,GAAME,CAAO;GAE/B,IAAMc,IAAiBC,IAAgCjB,GAAME,CAAO,KAAK;GACzE,EAAU,QAAQM,CAAmB,CAAC,CAAC,oBAAoBN,EAAQ,iBAAiBc,GAAgB,SAAS;EAC/G;CACF,CAAC,GAGKE,IAASC,QAAcrB,EAAe,QAAQ,CAACA,EAAe,MAAM,CAAC,GACrEsB,IAAaD,QAAcrB,EAAe,WAAW,CAACA,EAAe,SAAS,CAAC;CACrF,OAAOqB,SAAe;EAAE;EAAY;CAAO,IAAI,CAACC,GAAYF,CAAM,CAAC;AACrE"}
|
|
@@ -1,58 +1,73 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../../_chunks/
|
|
3
|
-
import {
|
|
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";
|
|
4
4
|
import { NotificationService as r } from "../../classes/services/NotificationService/index.js";
|
|
5
5
|
import { container as i } from "tsyringe";
|
|
6
6
|
import { useCallback as a, useMemo as o, useRef as s } from "react";
|
|
7
7
|
import { ObjectUtil as c } from "@gen-epix/ui-core/utils/ObjectUtil";
|
|
8
8
|
//#region src/hooks/useEditMutation/useEditMutation.ts
|
|
9
|
-
var l = ({ associationQueryKeys:
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
}, []),
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
var l = (e) => !Array.isArray(e), u = ({ associationQueryKeys: u, getErrorNotificationMessage: d, getIntermediateItem: f, getProgressNotificationMessage: p, getSuccessNotificationMessage: m, onError: h, onSuccess: g, queryFn: _, resourceQueryKey: v }) => {
|
|
10
|
+
let y = i.resolve(t).queryClient, b = s(void 0), x = a((e) => {
|
|
11
|
+
b.current = e;
|
|
12
|
+
}, []), S = a(async (e) => {
|
|
13
|
+
if (!_) throw Error("Edit mutation queryFn is required");
|
|
14
|
+
return _(c.deepNullifyEmptyStrings(e), b.current);
|
|
15
|
+
}, [b, _]), C = n({
|
|
16
|
+
mutationFn: S,
|
|
17
|
+
onError: async (n, a, o) => {
|
|
18
|
+
b.current = void 0;
|
|
19
|
+
let s = o ?? {};
|
|
20
|
+
v && Array.isArray(s.previousData) && y.setQueryData(v, s.previousData), await i.resolve(t).invalidateQueryKeys(u), h && await h(n, a, s);
|
|
21
|
+
let c = s.item ? d(s.item, a, n) : String(n);
|
|
22
|
+
s.notificationKey && i.resolve(r).fulfillNotification(s.notificationKey, e.wrapErrorNotificationMessage(c, n), "error");
|
|
16
23
|
},
|
|
17
24
|
onMutate: async (e) => {
|
|
18
|
-
let t =
|
|
25
|
+
let t = b.current;
|
|
26
|
+
if (!t) throw Error("previousItem is not set");
|
|
27
|
+
let n = i.resolve(r).showNotification({
|
|
19
28
|
isLoading: !0,
|
|
20
|
-
message:
|
|
29
|
+
message: p(t, e),
|
|
21
30
|
severity: "info"
|
|
22
31
|
});
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
let r = d ? d(e, y.current) : {
|
|
32
|
+
if (v) {
|
|
33
|
+
await y.cancelQueries({ queryKey: v });
|
|
34
|
+
let r = y.getQueryData(v);
|
|
35
|
+
if (Array.isArray(r) && !Array.isArray(e)) {
|
|
36
|
+
let i = f ? f(e, t) : {
|
|
29
37
|
...e,
|
|
30
|
-
id:
|
|
38
|
+
id: t.id
|
|
31
39
|
};
|
|
32
|
-
return
|
|
33
|
-
item:
|
|
34
|
-
notificationKey:
|
|
35
|
-
previousData:
|
|
40
|
+
return y.setQueryData(v, (e) => e.map((e) => e.id === t.id ? i : e)), {
|
|
41
|
+
item: t,
|
|
42
|
+
notificationKey: n,
|
|
43
|
+
previousData: r
|
|
36
44
|
};
|
|
37
45
|
}
|
|
38
46
|
}
|
|
39
|
-
return {
|
|
47
|
+
return {
|
|
48
|
+
item: t,
|
|
49
|
+
notificationKey: n
|
|
50
|
+
};
|
|
40
51
|
},
|
|
41
|
-
onSuccess: async (
|
|
42
|
-
|
|
52
|
+
onSuccess: async (e, n, a) => {
|
|
53
|
+
if (b.current = void 0, v && Array.isArray(a?.previousData) && l(e)) {
|
|
54
|
+
let t = a.item?.id;
|
|
55
|
+
y.setQueryData(v, (n) => Array.isArray(n) ? n.map((n) => n.id === t ? e : n) : n);
|
|
56
|
+
}
|
|
57
|
+
await i.resolve(t).invalidateQueryKeys(u), g && await g(e, n, a), i.resolve(r).fulfillNotification(a.notificationKey, m(e, a), "success");
|
|
43
58
|
}
|
|
44
|
-
}),
|
|
59
|
+
}), w = o(() => C.mutate, [C.mutate]), T = o(() => C.isPending, [C.isPending]);
|
|
45
60
|
return o(() => ({
|
|
46
|
-
isMutating:
|
|
47
|
-
mutate:
|
|
48
|
-
setPreviousItem:
|
|
61
|
+
isMutating: T,
|
|
62
|
+
mutate: w,
|
|
63
|
+
setPreviousItem: x
|
|
49
64
|
}), [
|
|
65
|
+
T,
|
|
50
66
|
w,
|
|
51
|
-
|
|
52
|
-
b
|
|
67
|
+
x
|
|
53
68
|
]);
|
|
54
69
|
};
|
|
55
70
|
//#endregion
|
|
56
|
-
export {
|
|
71
|
+
export { u as useEditMutation };
|
|
57
72
|
|
|
58
73
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["useMutation","isSingleGenericData","item","useEditMutation","queryClient","container","QueryClientService","previousItemRef","useRef","setPreviousItem","useCallback","mutationFn","queryFn","ObjectUtil","variables","editMutation","safeContext","context","resourceQueryKey","associationQueryKeys","onError","error","errorMessage","getErrorNotificationMessage","NotificationService","NotificationUtil","previousItem","notificationKey","getProgressNotificationMessage","previousData","intermediateItem","getIntermediateItem","oldItems","x","previousItemId","oldItem","onSuccess","getSuccessNotificationMessage","mutate","useMemo","isMutating"],"sources":["../../../src/hooks/useEditMutation/useEditMutation.ts"],"sourcesContent":["import { container } 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\nconst isSingleGenericData = (item: GenericData | GenericData[]): item is GenericData => !Array.isArray(item);\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 = container.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 if (!queryFn) {\n throw new Error('Edit mutation queryFn is required');\n }\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 const safeContext: MutationContextEdit<TData> = context ?? {};\n if (resourceQueryKey && Array.isArray(safeContext.previousData)) {\n queryClient.setQueryData<TData[]>(resourceQueryKey, safeContext.previousData);\n }\n await container.resolve(QueryClientService).invalidateQueryKeys(associationQueryKeys);\n if (onError) {\n await onError(error, variables, safeContext);\n }\n const errorMessage = safeContext.item\n ? getErrorNotificationMessage(safeContext.item, variables, error)\n : String(error);\n if (safeContext.notificationKey) {\n container.resolve(NotificationService).fulfillNotification(safeContext.notificationKey, NotificationUtil.wrapErrorNotificationMessage(errorMessage, error), 'error');\n }\n },\n onMutate: async (variables) => {\n const previousItem = previousItemRef.current;\n if (!previousItem) {\n throw new Error('previousItem is not set');\n }\n const notificationKey = container.resolve(NotificationService).showNotification({\n isLoading: true,\n message: getProgressNotificationMessage(previousItem, variables),\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(variables)) {\n const intermediateItem = getIntermediateItem ? getIntermediateItem(variables, previousItem) : {\n ...variables,\n id: (previousItem as GenericData).id,\n } as GenericData;\n queryClient.setQueryData<GenericData[]>(resourceQueryKey, (oldItems) => {\n return oldItems.map(x => x.id === (previousItem as GenericData).id ? intermediateItem : x) as GenericData[];\n });\n return { item: previousItem, notificationKey, previousData };\n }\n }\n return { item: previousItem, notificationKey };\n },\n onSuccess: async (item, variables, context) => {\n previousItemRef.current = undefined;\n if (resourceQueryKey && Array.isArray(context?.previousData) && isSingleGenericData(item)) {\n const previousItemId = (context.item as GenericData)?.id;\n queryClient.setQueryData<GenericData[]>(resourceQueryKey, (oldItems) => {\n if (!Array.isArray(oldItems)) {\n return oldItems;\n }\n return oldItems.map(oldItem => oldItem.id === previousItemId ? item : oldItem);\n });\n }\n await container.resolve(QueryClientService).invalidateQueryKeys(associationQueryKeys);\n if (onSuccess) {\n await onSuccess(item, variables, context);\n }\n container.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,IAAMC,KAAuB,MAA2D,CAAC,MAAM,QAAQC,CAAI,GAE9FC,KAAkF,EAC7F,yBACA,gCACA,wBACA,mCACA,kCACA,YACA,cACA,YACA,0BAC6C;CAC7C,IAAMC,IAAcC,EAAU,QAAQC,CAAkB,CAAC,CAAC,aACpDC,IAAkBC,EAAc,KAAA,CAAS,GAEzCC,IAAkBC,GAAa,MAAgB;EACnD,EAAgB,UAAUR;CAC5B,GAAG,CAAC,CAAC,GAECS,IAAaD,EAAY,OAAO,MAA0B;EAC9D,IAAI,CAACE,GACH,MAAU,MAAM,mCAAmC;EAErD,OAAOA,EAAQC,EAAW,wBAAwBC,CAAS,GAAGP,EAAgB,OAAO;CACvF,GAAG,CAACA,GAAiBK,CAAO,CAAC,GAEvBG,IAAef,EAAkE;EACrF;EACA,SAAS,OAAO,GAAO,GAAW,MAAY;GAC5C,EAAgB,UAAU,KAAA;GAC1B,IAAMgB,IAA0CC,KAAW,CAAC;GAK5D,AAJIC,KAAoB,MAAM,QAAQF,EAAY,YAAY,KAC5DZ,EAAY,aAAsBc,GAAkBF,EAAY,YAAY,GAE9E,MAAMX,EAAU,QAAQC,CAAkB,CAAC,CAAC,oBAAoBa,CAAoB,GAChFC,KACF,MAAMA,EAAQC,GAAOP,GAAWE,CAAW;GAE7C,IAAMM,IAAeN,EAAY,OAC7BO,EAA4BP,EAAY,MAAMF,GAAWO,CAAK,IAC9D,OAAOA,CAAK;GAChB,AAAIL,EAAY,mBACdX,EAAU,QAAQmB,CAAmB,CAAC,CAAC,oBAAoBR,EAAY,iBAAiBS,EAAiB,6BAA6BH,GAAcD,CAAK,GAAG,OAAO;EAEvK;EACA,UAAU,OAAO,MAAc;GAC7B,IAAMK,IAAenB,EAAgB;GACrC,IAAI,CAACmB,GACH,MAAU,MAAM,yBAAyB;GAE3C,IAAMC,IAAkBtB,EAAU,QAAQmB,CAAmB,CAAC,CAAC,iBAAiB;IAC9E,WAAW;IACX,SAASI,EAA+BF,GAAcZ,CAAS;IAC/D,UAAU;GACZ,CAAC;GACD,IAAII,GAAkB;IACpB,MAAMd,EAAY,cAAc,EAAE,UAAUc,EAAiB,CAAC;IAC9D,IAAMW,IAAezB,EAAY,aAAsBc,CAAgB;IAEvE,IAAI,MAAM,QAAQW,CAAY,KAAK,CAAC,MAAM,QAAQf,CAAS,GAAG;KAC5D,IAAMgB,IAAmBC,IAAsBA,EAAoBjB,GAAWY,CAAY,IAAI;MAC5F,GAAGZ;MACH,IAAKY,EAA6B;KACpC;KAIA,OAHAtB,EAAY,aAA4Bc,IAAmB,MAClDc,EAAS,KAAI,MAAKC,EAAE,OAAQP,EAA6B,KAAKI,IAAmBG,CAAC,CAC1F,GACM;MAAE,MAAMP;MAAc;MAAiB;KAAa;IAC7D;GACF;GACA,OAAO;IAAE,MAAMA;IAAc;GAAgB;EAC/C;EACA,WAAW,OAAO,GAAM,GAAW,MAAY;GAE7C,IADA,EAAgB,UAAU,KAAA,GACtBR,KAAoB,MAAM,QAAQD,GAAS,YAAY,KAAKhB,EAAoBC,CAAI,GAAG;IACzF,IAAMgC,IAAkBjB,EAAQ,MAAsB;IACtD,EAAY,aAA4BC,IAAmB,MACpD,MAAM,QAAQc,CAAQ,IAGpBA,EAAS,KAAI,MAAWG,EAAQ,OAAOD,IAAiBhC,IAAOiC,CAAO,IAFpEH,CAGV;GACH;GAKA,AAJA,MAAM3B,EAAU,QAAQC,CAAkB,CAAC,CAAC,oBAAoBa,CAAoB,GAChFiB,KACF,MAAMA,EAAUlC,GAAMY,GAAWG,CAAO,GAE1CZ,EAAU,QAAQmB,CAAmB,CAAC,CAAC,oBAAoBP,EAAQ,iBAAiBoB,EAA8BnC,GAAMe,CAAO,GAAG,SAAS;EAC7I;CACF,CAAC,GAGKqB,IAASC,QAAcxB,EAAa,QAAQ,CAACA,EAAa,MAAM,CAAC,GACjEyB,IAAaD,QAAcxB,EAAa,WAAW,CAACA,EAAa,SAAS,CAAC;CACjF,OAAOwB,SAAe;EAAE;EAAY;EAAQ;CAAgB,IAAI;EAACC;EAAYF;EAAQ7B;CAAe,CAAC;AACvG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "../../_chunks/
|
|
2
|
-
import { t } from "../../_chunks/
|
|
1
|
+
import { t as e } from "../../_chunks/useQueryMemo.js";
|
|
2
|
+
import { t } from "../../_chunks/QueryClientService.js";
|
|
3
3
|
import { container as n } from "tsyringe";
|
|
4
4
|
import { useEffect as r, useMemo as i, useState as a } from "react";
|
|
5
5
|
//#region src/hooks/useItemQuery/useItemQuery.ts
|
|
@@ -8,10 +8,10 @@ var o = [
|
|
|
8
8
|
"removed",
|
|
9
9
|
"updated"
|
|
10
10
|
], s = ({ baseQueryKey: s, itemId: c, useQueryOptions: l }) => {
|
|
11
|
-
let { queryCache: u } = n.resolve(
|
|
11
|
+
let { queryCache: u } = n.resolve(t), [d, f] = a(n.resolve(t).getItemFromCache(s, c)), p = e({
|
|
12
12
|
...l,
|
|
13
13
|
enabled: !d && l.enabled,
|
|
14
|
-
queryKey: n.resolve(
|
|
14
|
+
queryKey: n.resolve(t).getGenericKey(s, c)
|
|
15
15
|
});
|
|
16
16
|
return r(() => {
|
|
17
17
|
let e = u.subscribe((e) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["useQueryMemo","eventTypes","useItemQuery","container","QueryClientService","itemFromCache","setItemFromCache","useState","baseQueryKey","itemId","useQueryResult","useQueryOptions","useEffect","removeListener","queryCache","event","list","newValue","item","useMemo"],"sources":["../../../src/hooks/useItemQuery/useItemQuery.ts"],"sourcesContent":["import { container } from 'tsyringe';\nimport {\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport type {\n QueryCacheNotifyEvent,\n UseQueryOptions,\n} from '@tanstack/react-query';\n\nimport type { GenericData } from '../../models/data.models';\nimport { useQueryMemo } from '../useQueryMemo';\nimport { QueryClientService } from '../../classes/services/QueryClientService';\n\nexport type UseItemQueryProps<T extends GenericData, TQueryKey extends string = string> = {\n readonly baseQueryKey: TQueryKey;\n readonly itemId: string;\n readonly useQueryOptions: Omit<UseQueryOptions<T>, 'queryKey'>;\n};\n\nconst eventTypes: QueryCacheNotifyEvent['type'][] = ['added', 'removed', 'updated'];\n\nexport const useItemQuery = <T extends GenericData>({\n baseQueryKey,\n itemId,\n useQueryOptions,\n}: UseItemQueryProps<T>) => {\n const { queryCache } = container.resolve(QueryClientService);\n const [itemFromCache, setItemFromCache] = useState<T>(container.resolve(QueryClientService).getItemFromCache<T>(baseQueryKey, itemId));\n\n const useQueryResult = useQueryMemo({\n ...useQueryOptions,\n enabled: !itemFromCache && useQueryOptions.enabled,\n queryKey: container.resolve(QueryClientService).getGenericKey(baseQueryKey, itemId),\n });\n\n useEffect(() => {\n const handleQueryCacheEvent = (event: QueryCacheNotifyEvent) => {\n if (Array.isArray(event.query.queryKey) && event.query.queryKey[0] === baseQueryKey && eventTypes.includes(event.type)) {\n if (event.query.queryKey.length === 1) {\n const list = (event.query.state.data as T[]);\n if (event.type === 'removed') {\n setItemFromCache(undefined);\n return;\n }\n if (!list) {\n return;\n }\n const newValue = list?.find(item => item.id === itemId);\n if (JSON.stringify(itemFromCache) !== JSON.stringify(newValue)) {\n setItemFromCache(newValue);\n }\n } else if (event.query.queryKey.length === 2 && (event.query.state.data as T)?.id === itemId) {\n const newValue = event.query.state.data as T;\n if (JSON.stringify(itemFromCache) !== JSON.stringify(newValue)) {\n setItemFromCache(newValue);\n }\n }\n }\n };\n\n const removeListener = queryCache.subscribe(handleQueryCacheEvent);\n return () => {\n removeListener();\n };\n }, [baseQueryKey, itemId, queryCache, itemFromCache]);\n\n\n const result = useMemo(() => {\n return {\n data: itemFromCache || useQueryResult.data,\n error: itemFromCache ? false : useQueryResult.error,\n isEnabled: itemFromCache ? true : useQueryResult.isEnabled,\n isFetching: itemFromCache ? false : useQueryResult.isFetching,\n isLoading: itemFromCache ? false : useQueryResult.isLoading,\n isPending: itemFromCache ? false : useQueryResult.isPending,\n };\n }, [itemFromCache, useQueryResult.data, useQueryResult.isLoading, useQueryResult.isPending, useQueryResult.isFetching, useQueryResult.isEnabled, useQueryResult.error]);\n\n return result;\n};\n"],"mappings":";;;;;AAqBA,IAAMC,IAA8C;CAAC;CAAS;CAAW;AAAS,GAErEC,KAAuC,EAClD,iBACA,WACA,yBAC0B;CAC1B,IAAM,EAAE,kBAAeC,EAAU,QAAQC,CAAkB,GACrD,CAACC,GAAeC,KAAoBC,EAAYJ,EAAU,QAAQC,CAAkB,CAAC,CAAC,iBAAoBI,GAAcC,CAAM,CAAC,GAE/HC,IAAiBV,EAAa;EAClC,GAAGW;EACH,SAAS,CAACN,KAAiBM,EAAgB;EAC3C,UAAUR,EAAU,QAAQC,CAAkB,CAAC,CAAC,cAAcI,GAAcC,CAAM;CACpF,CAAC;CA6CD,OA3CAG,QAAgB;EAyBd,IAAMC,IAAiBC,EAAW,WAxBH,MAAiC;GAC9D,IAAI,MAAM,QAAQC,EAAM,MAAM,QAAQ,KAAKA,EAAM,MAAM,SAAS,OAAOP,KAAgBP,EAAW,SAASc,EAAM,IAAI,GAAG;IACtH,IAAIA,EAAM,MAAM,SAAS,WAAW,GAAG;KACrC,IAAMC,IAAQD,EAAM,MAAM,MAAM;KAChC,IAAIA,EAAM,SAAS,WAAW;MAC5B,EAAiB,KAAA,CAAS;MAC1B;KACF;KACA,IAAI,CAACC,GACH;KAEF,IAAMC,IAAWD,GAAM,MAAK,MAAQE,EAAK,OAAOT,CAAM;KACtD,AAAI,KAAK,UAAUJ,CAAa,MAAM,KAAK,UAAUY,CAAQ,KAC3DX,EAAiBW,CAAQ;IAE7B,OAAO,IAAIF,EAAM,MAAM,SAAS,WAAW,KAAMA,EAAM,MAAM,MAAM,MAAY,OAAON,GAAQ;KAC5F,IAAMQ,IAAWF,EAAM,MAAM,MAAM;KACnC,AAAI,KAAK,UAAUV,CAAa,MAAM,KAAK,UAAUY,CAAQ,KAC3DX,EAAiBW,CAAQ;IAE7B;GACF;EACF,CAEiE;EACjE,aAAa;GACX,EAAe;EACjB;CACF,GAAG;EAACT;EAAcC;EAAQK;EAAYT;CAAa,CAAC,GAGrCc,SACN;EACL,MAAMd,KAAiBK,EAAe;EACtC,OAAO,MAAwBA,EAAe;EAC9C,WAAWL,IAAgB,KAAOK,EAAe;EACjD,YAAY,MAAwBA,EAAe;EACnD,WAAW,MAAwBA,EAAe;EAClD,WAAW,MAAwBA,EAAe;CACpD,IACC;EAACL;EAAeK,EAAe;EAAMA,EAAe;EAAWA,EAAe;EAAWA,EAAe;EAAYA,EAAe;EAAWA,EAAe;CAAK,CAE9J;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useUpdateBreadcrumb","update","useCallback","BreadcrumbService","position","title","useEffect"],"sources":["../../../src/hooks/useUpdateBreadcrumb/useUpdateBreadcrumb.ts"],"sourcesContent":["import { container
|
|
1
|
+
{"version":3,"file":"index.js","names":["useUpdateBreadcrumb","update","useCallback","BreadcrumbService","position","title","useEffect"],"sources":["../../../src/hooks/useUpdateBreadcrumb/useUpdateBreadcrumb.ts"],"sourcesContent":["import { container } from 'tsyringe';\nimport {\n useCallback,\n useEffect,\n} from 'react';\n\nimport { BreadcrumbService } from '../../classes/services/BreadcrumbService';\n\n\nexport const useUpdateBreadcrumb = (position: string) => {\n const update = useCallback((title: string) => {\n container.resolve(BreadcrumbService).update(position, title);\n }, [position]);\n\n useEffect(() => {\n return () => {\n container.resolve(BreadcrumbService).remove(position);\n };\n }, [position]);\n\n return update;\n};\n"],"mappings":";;;;AASA,IAAaA,KAAuB,MAAqB;CACvD,IAAMC,IAASC,GAAa,MAAkB;EAC5C,EAAU,QAAQC,CAAiB,CAAC,CAAC,OAAOC,GAAUC,CAAK;CAC7D,GAAG,CAACD,CAAQ,CAAC;CAQb,OANAE,cACe;EACX,EAAU,QAAQH,CAAiB,CAAC,CAAC,OAAOC,CAAQ;CACtD,GACC,CAACA,CAAQ,CAAC,GAENH;AACT"}
|
package/dist/locale/en.json
CHANGED
|
@@ -114,6 +114,7 @@
|
|
|
114
114
|
"Enable all with data": "Enable all with data",
|
|
115
115
|
"Error": "Error",
|
|
116
116
|
"Error anonymizing user: {{userName}}": "Error anonymizing user: {{userName}}",
|
|
117
|
+
"Error loading organization admins": "Error loading organization admins",
|
|
117
118
|
"Execute": "Execute",
|
|
118
119
|
"Expected end: ": "Expected end: ",
|
|
119
120
|
"Expected start: ": "Expected start: ",
|
package/dist/locale/nl.json
CHANGED
|
@@ -114,6 +114,7 @@
|
|
|
114
114
|
"Enable all with data": "Alles met data inschakelen",
|
|
115
115
|
"Error": "Fout",
|
|
116
116
|
"Error anonymizing user: {{userName}}": "Fout bij anonimiseren van gebruiker: {{userName}}",
|
|
117
|
+
"Error loading organization admins": "Fout bij het laden van de organisatiebeheerders",
|
|
117
118
|
"Execute": "Uitvoeren",
|
|
118
119
|
"Expected end: ": "Verwacht einde: ",
|
|
119
120
|
"Expected start: ": "Verwachte start: ",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Theme } from '@mui/material';
|
|
3
3
|
export type ApplicationHeaderProps = {
|
|
4
4
|
readonly fullHeight?: boolean;
|
|
5
5
|
readonly fullWidth?: boolean;
|
|
@@ -45,10 +45,6 @@ export interface ConfigBase {
|
|
|
45
45
|
retry: (failureCount: number, error: unknown) => boolean;
|
|
46
46
|
retryDelay: (attempt: number) => number;
|
|
47
47
|
};
|
|
48
|
-
spinner: {
|
|
49
|
-
DEFAULT_CIRCULAR_PROGRESS_SIZE: CircularProgressProps['size'];
|
|
50
|
-
DEFAULT_TAKING_LONGER_TIMEOUT_MS: number;
|
|
51
|
-
};
|
|
52
48
|
table: {
|
|
53
49
|
CONDENSED_WIDTH_PX: number;
|
|
54
50
|
DEFAULT_OVERSCAN_MAIN: number;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { GenEpixCoreComponentsTheme } from '@gen-epix/ui-core-components/models/theme.models';
|
|
2
|
+
export interface GenEpixUiClientCommonFooterTheme {
|
|
3
|
+
background: string;
|
|
4
|
+
color: string;
|
|
5
|
+
sectionBorderColor: string;
|
|
6
|
+
}
|
|
7
|
+
export interface GenEpixUiClientCommonNavbarTheme {
|
|
8
|
+
activeBackground: string;
|
|
9
|
+
activeColor: string;
|
|
10
|
+
background: string;
|
|
11
|
+
environmentMessageColor: string;
|
|
12
|
+
primaryColor: string;
|
|
13
|
+
secondaryColor: string;
|
|
14
|
+
}
|
|
15
|
+
export interface GenEpixUiClientCommonTheme extends GenEpixCoreComponentsTheme {
|
|
16
|
+
components: {
|
|
17
|
+
GenEpixUiClientCommonFooter: GenEpixUiClientCommonFooterTheme;
|
|
18
|
+
GenEpixUiClientCommonNavbar: GenEpixUiClientCommonNavbarTheme;
|
|
19
|
+
} & GenEpixCoreComponentsTheme['components'];
|
|
17
20
|
}
|