@hortiview/modulebase 1.1.0-alpha.8ea7f643.1 → 1.1.1-alpha.3d69639d.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/dist/IsRestoringProvider-SzKJZczp.js +931 -0
- package/dist/{ModuleCore-DuJVrj6v.js → ModuleCore-DRMqZO8r.js} +5947 -5758
- package/dist/assets/ModuleCore.css +1 -1
- package/dist/{chunk-LFPYN7LY-DmQ3La_a.js → chunk-EVOBXE3Y-BoyVF_Ri.js} +2921 -2784
- package/dist/components/ModuleBase.js +28 -19
- package/dist/components/ModuleCore.js +1 -1
- package/dist/constants.js +2 -2
- package/dist/hooks/useBreadcrumbTranslation.js +13 -14
- package/dist/hooks/useCustom.js +1 -1
- package/dist/hooks/useCustomMutation.js +5 -16
- package/dist/hooks/useEntity.js +1 -1
- package/dist/hooks/useOffline.js +1 -1
- package/dist/hooks/useOption.js +1 -1
- package/dist/hooks/useStores.js +1 -1
- package/dist/lib/hooks/useStores.d.ts +2 -33
- package/dist/lib/main.d.ts +2 -4
- package/dist/lib/types/BaseProps.d.ts +3 -6
- package/dist/main.js +174 -181
- package/dist/module-router.js +875 -837
- package/dist/{omit-Do6MFRwA.js → omit-DYPaIq41.js} +121 -128
- package/dist/provider/SignalR/SignalRProvider.js +469 -463
- package/dist/{useMutation-Aoachkw_.js → useCustomMutation-9VUQ7NbQ.js} +40 -20
- package/dist/{useQuery-DEU_AUtf.js → useQuery-DUDyh33-.js} +107 -108
- package/dist/utils/helper.js +1 -1
- package/package.json +24 -24
- package/dist/IsRestoringProvider-CBSZo7ur.js +0 -312
- package/dist/QueryClientProvider-DyiNrPkn.js +0 -514
- package/dist/hooks/useServiceBus.js +0 -25
- package/dist/lib/hooks/useServiceBus.d.ts +0 -19
- package/dist/lib/types/Deprecated.d.ts +0 -103
- package/dist/mutation-CmhiEgfA.js +0 -237
- package/dist/types/Deprecated.js +0 -1
|
@@ -1,21 +1,30 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useEffect as
|
|
3
|
-
import {
|
|
4
|
-
import { SignalRProvider as
|
|
5
|
-
import { useBasePropsStore as
|
|
6
|
-
import { M as
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}, [
|
|
12
|
-
},
|
|
13
|
-
props:
|
|
14
|
-
routes:
|
|
15
|
-
env:
|
|
16
|
-
useSignalR:
|
|
17
|
-
queryClient:
|
|
18
|
-
}) =>
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as s } from "react";
|
|
3
|
+
import { c as u, R as c, O as l, u as m } from "../chunk-EVOBXE3Y-BoyVF_Ri.js";
|
|
4
|
+
import { SignalRProvider as d } from "../provider/SignalR/SignalRProvider.js";
|
|
5
|
+
import { useBasePropsStore as f } from "../stores/BasePropsStore.js";
|
|
6
|
+
import { M as p, a as v } from "../ModuleCore-DRMqZO8r.js";
|
|
7
|
+
const g = () => {
|
|
8
|
+
const e = f((o) => o.currentNavigationPath), t = m();
|
|
9
|
+
s(() => {
|
|
10
|
+
e && t(e, { replace: !0 });
|
|
11
|
+
}, [e, t]);
|
|
12
|
+
}, h = () => (g(), /* @__PURE__ */ r(l, {})), x = ({
|
|
13
|
+
props: e,
|
|
14
|
+
routes: t,
|
|
15
|
+
env: o = void 0,
|
|
16
|
+
useSignalR: a = !1,
|
|
17
|
+
queryClient: i = v
|
|
18
|
+
}) => {
|
|
19
|
+
const n = u([
|
|
20
|
+
{
|
|
21
|
+
path: e.basePath,
|
|
22
|
+
children: t,
|
|
23
|
+
element: /* @__PURE__ */ r(h, {})
|
|
24
|
+
}
|
|
25
|
+
]);
|
|
26
|
+
return /* @__PURE__ */ r(p, { props: e, env: o, queryClient: i, children: /* @__PURE__ */ r(d, { enabled: a, children: /* @__PURE__ */ r(c, { router: n }) }) });
|
|
27
|
+
};
|
|
19
28
|
export {
|
|
20
|
-
|
|
29
|
+
x as ModuleBase
|
|
21
30
|
};
|
package/dist/constants.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { useCallback as
|
|
2
|
-
import { useBasePropsStore as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
return
|
|
6
|
-
(
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
{ key:
|
|
1
|
+
import { useCallback as s } from "react";
|
|
2
|
+
import { useBasePropsStore as c } from "../stores/BasePropsStore.js";
|
|
3
|
+
const d = () => {
|
|
4
|
+
const a = c((r) => r.addBreadcrumbTranslation);
|
|
5
|
+
return s(
|
|
6
|
+
(r, e) => {
|
|
7
|
+
const t = r, o = typeof e == "boolean", n = o ? r : e;
|
|
8
|
+
if (a) {
|
|
9
|
+
a(
|
|
10
|
+
{ key: t, value: n },
|
|
11
11
|
//if boolean hide the translation in the breadcrumb
|
|
12
|
-
|
|
12
|
+
o
|
|
13
13
|
);
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
|
-
t && t({ key: e, value: n }, typeof r == "boolean");
|
|
17
16
|
},
|
|
18
|
-
[
|
|
17
|
+
[a]
|
|
19
18
|
);
|
|
20
19
|
};
|
|
21
20
|
export {
|
|
22
|
-
|
|
21
|
+
d as useBreadcrumbTranslation
|
|
23
22
|
};
|
package/dist/hooks/useCustom.js
CHANGED
|
@@ -1,25 +1,14 @@
|
|
|
1
|
-
import { u as
|
|
1
|
+
import { u as x } from "../useCustomMutation-9VUQ7NbQ.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import "../provider/SignalR/SignalRProvider.js";
|
|
5
5
|
import "../stores/BasePropsStore.js";
|
|
6
|
-
import "../ModuleCore-
|
|
7
|
-
import
|
|
6
|
+
import "../ModuleCore-DRMqZO8r.js";
|
|
7
|
+
import "../utils/fetches.js";
|
|
8
8
|
import "../types/Entities.js";
|
|
9
9
|
import "../api-COabZnyn.js";
|
|
10
|
-
import "../omit-
|
|
10
|
+
import "../omit-DYPaIq41.js";
|
|
11
11
|
import "../stores/EnvironmentStore.js";
|
|
12
|
-
const g = ({
|
|
13
|
-
endpoint: t,
|
|
14
|
-
method: o,
|
|
15
|
-
token: m,
|
|
16
|
-
headers: r,
|
|
17
|
-
noAuth: i,
|
|
18
|
-
...p
|
|
19
|
-
}) => s({
|
|
20
|
-
mutationFn: ({ input: u, replaceEndpointWith: n }) => a(n ?? t, u, o, m, r, i),
|
|
21
|
-
...p
|
|
22
|
-
});
|
|
23
12
|
export {
|
|
24
|
-
|
|
13
|
+
x as useCustomMutation
|
|
25
14
|
};
|
package/dist/hooks/useEntity.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as p } from "../useQuery-
|
|
1
|
+
import { u as p } from "../useQuery-DUDyh33-.js";
|
|
2
2
|
import { useMemo as g, useCallback as Q } from "react";
|
|
3
3
|
import { useBasePropsStore as m } from "../stores/BasePropsStore.js";
|
|
4
4
|
import { AllEntitiesTypeResultMap as v } from "../types/Entities.js";
|
package/dist/hooks/useOffline.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as y } from "../
|
|
1
|
+
import { u as y } from "../IsRestoringProvider-SzKJZczp.js";
|
|
2
2
|
import { useBasePropsStore as i } from "../stores/BasePropsStore.js";
|
|
3
3
|
import { fetchFromCustomApi as f, getFarmOrgEntities as m, getModuleDependedEntities as d } from "../utils/fetches.js";
|
|
4
4
|
import { getModuleQueryKey as o } from "../utils/helper.js";
|
package/dist/hooks/useOption.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as m } from "../useQuery-
|
|
1
|
+
import { u as m } from "../useQuery-DUDyh33-.js";
|
|
2
2
|
import { g as c } from "../api-COabZnyn.js";
|
|
3
3
|
import { useBasePropsStore as n } from "../stores/BasePropsStore.js";
|
|
4
4
|
import { fetchFromCommonApi as i, fetchFromModuleApi as p } from "../utils/fetches.js";
|
package/dist/hooks/useStores.js
CHANGED
|
@@ -1,37 +1,6 @@
|
|
|
1
|
-
export declare const useBaseProps: () => Pick<import('../main').
|
|
2
|
-
isOnline?: boolean;
|
|
3
|
-
modulePermissionToken?: string;
|
|
4
|
-
moduleId?: string;
|
|
5
|
-
organizationId?: string;
|
|
6
|
-
basePath?: string;
|
|
7
|
-
currentNavigationPath?: string;
|
|
8
|
-
sourcePath?: string | null;
|
|
9
|
-
currentLanguage?: string;
|
|
10
|
-
currentLanguageId?: string;
|
|
11
|
-
commonOptions?: import('../main').AllDropdownsData<import('../main').CommonOption>["items"];
|
|
12
|
-
refreshModulePermissionToken?: () => Promise<string | undefined>;
|
|
13
|
-
riseNotification?: (message: import('../main').AlertServiceBusMessage) => Promise<unknown>;
|
|
14
|
-
navigateInHortiview?: (path: string) => void;
|
|
15
|
-
addBreadcrumbTranslation?: (translation: {
|
|
16
|
-
key: string;
|
|
17
|
-
value: string;
|
|
18
|
-
}, hide?: boolean) => void;
|
|
19
|
-
showSnackbar?: (message: string, icon?: string) => void;
|
|
20
|
-
showMessage?: (message: import('../main').SystemMessage) => void;
|
|
21
|
-
pendingActions?: import('../main').ActionItem[];
|
|
22
|
-
getPendingActions?: () => import('../main').ActionItem[];
|
|
23
|
-
resolveAction?: (key: string, result?: string) => void;
|
|
24
|
-
startResolvingAction?: (key: string) => void;
|
|
25
|
-
addAction?: (functionName: string, args: unknown[], key?: string) => void;
|
|
26
|
-
getActions?: () => import('../main').ActionItem[];
|
|
27
|
-
getActionByKey?: (key: string) => import('../main').ActionItem | undefined;
|
|
28
|
-
logEvent?: (event: import('../main').AppInsightsEvent, customProperties?: import('../main').AppInsightsProperties) => void;
|
|
29
|
-
logError?: (exception: import('../main').AppInsightsException) => void;
|
|
30
|
-
throwError?: (message: string, code: number) => void;
|
|
31
|
-
environmentVariables?: import('../main').EnvironmentVariable[];
|
|
32
|
-
} & {
|
|
1
|
+
export declare const useBaseProps: () => Pick<import('../main').BaseProps & {
|
|
33
2
|
setBaseProps: (props: import('../main').BaseProps) => void;
|
|
34
|
-
}, keyof import('../main').
|
|
3
|
+
}, keyof import('../main').BaseProps>;
|
|
35
4
|
export declare const useConfig: () => Pick<{
|
|
36
5
|
environment: import('../main').HortiViewEnvironments;
|
|
37
6
|
setEnvironment: (environment: import('../main').HortiViewEnvironments) => void;
|
package/dist/lib/main.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
export { ModuleBase } from './components/ModuleBase';
|
|
2
2
|
export { ModuleCore } from './components/ModuleCore';
|
|
3
|
+
export type * from './types/ActionStorage';
|
|
3
4
|
export type * from './types/AppInsights';
|
|
4
5
|
export type * from './types/BaseProps';
|
|
5
6
|
export type * from './types/CommonOptions';
|
|
6
|
-
export type * from './types/Deprecated';
|
|
7
7
|
export type * from './types/Environment';
|
|
8
8
|
export type * from './types/EnvironmentVariable';
|
|
9
9
|
export type * from './types/ModuleApi';
|
|
10
10
|
export type * from './types/Requests';
|
|
11
11
|
export type * from './types/ServiceBus';
|
|
12
12
|
export type * from './types/SystemMessage';
|
|
13
|
-
export type * from './types/ActionStorage';
|
|
14
13
|
export * from './enum/ActionStorage';
|
|
15
14
|
export { useBreadcrumbTranslation } from './hooks/useBreadcrumbTranslation';
|
|
16
15
|
export { useOffline } from './hooks/useOffline';
|
|
@@ -22,7 +21,6 @@ export { useCustom } from './hooks/useCustom';
|
|
|
22
21
|
export { useCustomMutation } from './hooks/useCustomMutation';
|
|
23
22
|
export { useEntity } from './hooks/useEntity';
|
|
24
23
|
export { useOption } from './hooks/useOption';
|
|
25
|
-
export {
|
|
26
|
-
export { QueryClient, useInfiniteQuery, useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
24
|
+
export { QueryClient, useInfiniteQuery, useMutation, useQuery, useQueryClient, } from '@tanstack/react-query';
|
|
27
25
|
export { mutateOnCustomApi } from './utils/fetches';
|
|
28
26
|
export * from './utils/helper';
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ActionItem } from './ActionStorage';
|
|
2
2
|
import { AppInsightsEvent, AppInsightsException, AppInsightsProperties } from './AppInsights';
|
|
3
3
|
import { AllDropdownsData, CommonOption } from './CommonOptions';
|
|
4
|
-
import { DeprecatedBaseProps } from './Deprecated';
|
|
5
4
|
import { EnvironmentVariable } from './EnvironmentVariable';
|
|
6
|
-
import { AlertServiceBusMessage } from './ServiceBus';
|
|
7
5
|
import { SystemMessage } from './SystemMessage';
|
|
8
6
|
/**
|
|
9
7
|
* Properties that are passed to the Base component by the host application
|
|
@@ -17,19 +15,19 @@ import { SystemMessage } from './SystemMessage';
|
|
|
17
15
|
* @param addTranslation function to add a translation to the i18n instance of the host application
|
|
18
16
|
* @param currentNavigationPath current path of the route, that is changed, when the host application navigates
|
|
19
17
|
*/
|
|
20
|
-
export type BaseProps =
|
|
18
|
+
export type BaseProps = {
|
|
19
|
+
alertRules?: string;
|
|
21
20
|
isOnline?: boolean;
|
|
22
21
|
modulePermissionToken?: string;
|
|
23
22
|
moduleId?: string;
|
|
24
23
|
organizationId?: string;
|
|
25
24
|
basePath?: string;
|
|
26
25
|
currentNavigationPath?: string;
|
|
27
|
-
sourcePath?: string | null;
|
|
28
26
|
currentLanguage?: string;
|
|
29
27
|
currentLanguageId?: string;
|
|
30
28
|
commonOptions?: AllDropdownsData<CommonOption>['items'];
|
|
29
|
+
environmentVariables?: EnvironmentVariable[];
|
|
31
30
|
refreshModulePermissionToken?: () => Promise<string | undefined>;
|
|
32
|
-
riseNotification?: (message: AlertServiceBusMessage) => Promise<unknown>;
|
|
33
31
|
navigateInHortiview?: (path: string) => void;
|
|
34
32
|
addBreadcrumbTranslation?: (translation: {
|
|
35
33
|
key: string;
|
|
@@ -47,5 +45,4 @@ export type BaseProps = DeprecatedBaseProps & {
|
|
|
47
45
|
logEvent?: (event: AppInsightsEvent, customProperties?: AppInsightsProperties) => void;
|
|
48
46
|
logError?: (exception: AppInsightsException) => void;
|
|
49
47
|
throwError?: (message: string, code: number) => void;
|
|
50
|
-
environmentVariables?: EnvironmentVariable[];
|
|
51
48
|
};
|