@hortiview/modulebase 1.1.2-alpha.870da389.1 → 1.1.2-alpha.a87fc893.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/ModuleCore-DRMqZO8r.js → ModuleCore-C4Z4zObE.js} +3030 -3110
- package/{dist/api-COabZnyn.js → api-CikhPcJj.js} +10 -10
- package/{dist/chunk-EVOBXE3Y-B43QN6RE.js → chunk-KS7C4IRE-CT7Z8Xx_.js} +3866 -3585
- package/components/ModuleBase.js +30 -0
- package/{dist/components → components}/ModuleCore.js +2 -3
- package/{dist/constants.js → constants.js} +8 -8
- package/{dist/hooks → hooks}/useCustom.js +9 -9
- package/{dist/hooks → hooks}/useCustomMutation.js +6 -6
- package/{dist/hooks → hooks}/useEntity.js +5 -5
- package/hooks/useOffline.js +57 -0
- package/{dist/hooks → hooks}/useOption.js +6 -6
- package/{dist/hooks → hooks}/useSignalRMessages.js +1 -1
- package/{dist/hooks → hooks}/useStores.js +1 -1
- package/{dist/isTypedArray-SkhznY1k.js → isTypedArray-T1_r8YHg.js} +33 -33
- package/{dist/lib → lib}/components/ModuleBase.d.ts +1 -1
- package/{dist/lib → lib}/components/ModuleCore.d.ts +1 -2
- package/{dist/lib → lib}/hooks/useCustom.d.ts +1 -1
- package/{dist/lib → lib}/hooks/useCustomMutation.d.ts +1 -1
- package/{dist/lib → lib}/hooks/useOffline.d.ts +5 -5
- package/lib/provider/SignalR/SignalRModuleContext.d.ts +4 -0
- package/lib/provider/SignalR/SignalRProvider.d.ts +9 -0
- package/lib/types/BaseProps.d.ts +98 -0
- package/lib/utils/IndexedDbService.d.ts +6 -0
- package/main.js +228 -0
- package/{dist/module-router.js → module-router.js} +813 -847
- package/{dist/omit-DYPaIq41.js → omit-CiJPWayj.js} +66 -66
- package/package.json +22 -56
- package/provider/SignalR/SignalRModuleContext.js +6205 -0
- package/provider/SignalR/SignalRProvider.js +35 -0
- package/{dist/stores → stores}/BasePropsStore.js +1 -0
- package/{dist/stores → stores}/EnvironmentStore.js +5 -5
- package/{dist/types → types}/Entities.js +5 -5
- package/{dist/useCustomMutation-9VUQ7NbQ.js → useCustomMutation-BX8lKAYe.js} +10 -10
- package/{dist/useQuery-DUDyh33-.js → useQuery-URJEw3ly.js} +128 -126
- package/utils/IndexedDbService.js +43 -0
- package/{dist/utils → utils}/api.js +1 -1
- package/{dist/utils → utils}/baseFetches.js +1 -1
- package/README.md +0 -9
- package/dist/components/ModuleBase.js +0 -21
- package/dist/hooks/useOffline.js +0 -57
- package/dist/lib/provider/SignalR/SignalRProvider.d.ts +0 -13
- package/dist/lib/types/BaseProps.d.ts +0 -48
- package/dist/lib/utils/IndexedDbService.d.ts +0 -33
- package/dist/main.js +0 -228
- package/dist/provider/SignalR/SignalRProvider.js +0 -5979
- package/dist/utils/IndexedDbService.js +0 -43
- package/{dist/IsRestoringProvider-SzKJZczp.js → IsRestoringProvider-SzKJZczp.js} +0 -0
- package/{dist/_commonjsHelpers-ByX85dGu.js → _commonjsHelpers-ByX85dGu.js} +0 -0
- package/{dist/assets → assets}/ModuleCore.css +0 -0
- package/{dist/enum → enum}/ActionStorage.js +0 -0
- package/{dist/hooks → hooks}/useBreadcrumbTranslation.js +0 -0
- package/{dist/lib → lib}/constants.d.ts +8 -8
- /package/{dist/lib → lib}/enum/ActionStorage.d.ts +0 -0
- /package/{dist/lib → lib}/hooks/useBreadcrumbTranslation.d.ts +0 -0
- /package/{dist/lib → lib}/hooks/useEntity.d.ts +0 -0
- /package/{dist/lib → lib}/hooks/useOption.d.ts +0 -0
- /package/{dist/lib → lib}/hooks/useSignalRMessages.d.ts +0 -0
- /package/{dist/lib → lib}/hooks/useStores.d.ts +0 -0
- /package/{dist/lib → lib}/main.d.ts +0 -0
- /package/{dist/lib → lib}/module-router.d.ts +0 -0
- /package/{dist/lib → lib}/provider/SignalR/signalR.d.ts +0 -0
- /package/{dist/lib → lib}/stores/BasePropsStore.d.ts +0 -0
- /package/{dist/lib → lib}/stores/EnvironmentStore.d.ts +0 -0
- /package/{dist/lib → lib}/types/ActionStorage.d.ts +0 -0
- /package/{dist/lib → lib}/types/AppInsights.d.ts +0 -0
- /package/{dist/lib → lib}/types/CommonOptions.d.ts +0 -0
- /package/{dist/lib → lib}/types/Entities.d.ts +0 -0
- /package/{dist/lib → lib}/types/Environment.d.ts +0 -0
- /package/{dist/lib → lib}/types/EnvironmentVariable.d.ts +0 -0
- /package/{dist/lib → lib}/types/ModuleApi.d.ts +0 -0
- /package/{dist/lib → lib}/types/Requests.d.ts +0 -0
- /package/{dist/lib → lib}/types/ServiceBus.d.ts +0 -0
- /package/{dist/lib → lib}/types/SystemMessage.d.ts +0 -0
- /package/{dist/lib → lib}/utils/api.d.ts +0 -0
- /package/{dist/lib → lib}/utils/baseFetches.d.ts +0 -0
- /package/{dist/lib → lib}/utils/fetches.d.ts +0 -0
- /package/{dist/lib → lib}/utils/helper.d.ts +0 -0
- /package/{dist/provider → provider}/SignalR/signalR.js +0 -0
- /package/{dist/react-c9FSfB30.js → react-c9FSfB30.js} +0 -0
- /package/{dist/types → types}/ActionStorage.js +0 -0
- /package/{dist/types → types}/AppInsights.js +0 -0
- /package/{dist/types → types}/BaseProps.js +0 -0
- /package/{dist/types → types}/CommonOptions.js +0 -0
- /package/{dist/types → types}/Environment.js +0 -0
- /package/{dist/types → types}/EnvironmentVariable.js +0 -0
- /package/{dist/types → types}/ModuleApi.js +0 -0
- /package/{dist/types → types}/Requests.js +0 -0
- /package/{dist/types → types}/ServiceBus.js +0 -0
- /package/{dist/types → types}/SystemMessage.js +0 -0
- /package/{dist/utils → utils}/fetches.js +0 -0
- /package/{dist/utils → utils}/helper.js +0 -0
- /package/{dist/vite-env.d.js → vite-env.d.js} +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as t } 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-KS7C4IRE-CT7Z8Xx_.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 } from "../ModuleCore-C4Z4zObE.js";
|
|
7
|
+
const v = () => {
|
|
8
|
+
const e = f((o) => o.currentNavigationPath), r = m();
|
|
9
|
+
s(() => {
|
|
10
|
+
e && r(e, { replace: !0 });
|
|
11
|
+
}, [e, r]);
|
|
12
|
+
}, g = () => (v(), /* @__PURE__ */ t(l, {})), b = ({
|
|
13
|
+
env: e = void 0,
|
|
14
|
+
props: r,
|
|
15
|
+
queryClient: o,
|
|
16
|
+
routes: a,
|
|
17
|
+
useSignalR: i = !1
|
|
18
|
+
}) => {
|
|
19
|
+
const n = u([
|
|
20
|
+
{
|
|
21
|
+
children: a,
|
|
22
|
+
element: /* @__PURE__ */ t(g, {}),
|
|
23
|
+
path: r.basePath
|
|
24
|
+
}
|
|
25
|
+
]);
|
|
26
|
+
return /* @__PURE__ */ t(p, { props: r, env: e, queryClient: o, children: /* @__PURE__ */ t(d, { enabled: i, children: /* @__PURE__ */ t(c, { router: n }) }) });
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
b as ModuleBase
|
|
30
|
+
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import { M as
|
|
2
|
+
import { M as a } from "../ModuleCore-C4Z4zObE.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "../stores/BasePropsStore.js";
|
|
5
5
|
import "../stores/EnvironmentStore.js";
|
|
6
6
|
import "../utils/helper.js";
|
|
7
7
|
import "../utils/IndexedDbService.js";
|
|
8
8
|
export {
|
|
9
|
-
|
|
10
|
-
u as ModuleQueryClient
|
|
9
|
+
a as ModuleCore
|
|
11
10
|
};
|
|
@@ -7,25 +7,25 @@ const a = [
|
|
|
7
7
|
"currentNavigationPath"
|
|
8
8
|
], e = {
|
|
9
9
|
/**
|
|
10
|
-
* The server
|
|
10
|
+
* The server is not ready to handle the request.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
BadGateway: 502,
|
|
13
13
|
/**
|
|
14
|
-
* The
|
|
14
|
+
* The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
GatewayTimeout: 504,
|
|
17
17
|
/**
|
|
18
|
-
* The server
|
|
18
|
+
* The server timed out waiting for the request.
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
RequestTimeout: 408,
|
|
21
21
|
/**
|
|
22
22
|
* The server is not available.
|
|
23
23
|
*/
|
|
24
24
|
ServiceUnavailable: 503,
|
|
25
25
|
/**
|
|
26
|
-
* The
|
|
26
|
+
* The user has sent too many requests in a given amount of time ("rate limiting").
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
TooManyRequests: 429
|
|
29
29
|
};
|
|
30
30
|
export {
|
|
31
31
|
a as REQUIRED_PROPS,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { u as i } from "../useQuery-
|
|
1
|
+
import { u as i } from "../useQuery-URJEw3ly.js";
|
|
2
2
|
import { fetchFromCustomApi as n } from "../utils/fetches.js";
|
|
3
3
|
import { universalSelector as p } from "../utils/helper.js";
|
|
4
4
|
const C = ({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
enabled: o = !0,
|
|
6
|
+
endpoint: t,
|
|
7
|
+
noAuth: u = !1,
|
|
8
|
+
queryKey: m,
|
|
8
9
|
selector: r,
|
|
9
|
-
|
|
10
|
-
noAuth: s = !1,
|
|
10
|
+
token: s,
|
|
11
11
|
...f
|
|
12
12
|
}) => i({
|
|
13
|
-
|
|
14
|
-
queryFn: () => n(
|
|
13
|
+
enabled: o,
|
|
14
|
+
queryFn: () => n(t, s, u),
|
|
15
|
+
queryKey: m,
|
|
15
16
|
select: (e) => r ? r(e) : p(e),
|
|
16
|
-
enabled: m,
|
|
17
17
|
...f
|
|
18
18
|
});
|
|
19
19
|
export {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { u as x } from "../useCustomMutation-
|
|
1
|
+
import { u as x } from "../useCustomMutation-BX8lKAYe.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
|
-
import "../provider/SignalR/SignalRProvider.js";
|
|
5
4
|
import "../stores/BasePropsStore.js";
|
|
6
|
-
import "../
|
|
5
|
+
import "../stores/EnvironmentStore.js";
|
|
6
|
+
import "../provider/SignalR/SignalRModuleContext.js";
|
|
7
|
+
import "../ModuleCore-C4Z4zObE.js";
|
|
7
8
|
import "../utils/fetches.js";
|
|
8
9
|
import "../types/Entities.js";
|
|
9
|
-
import "../api-
|
|
10
|
-
import "../omit-
|
|
11
|
-
import "../stores/EnvironmentStore.js";
|
|
10
|
+
import "../api-CikhPcJj.js";
|
|
11
|
+
import "../omit-CiJPWayj.js";
|
|
12
12
|
export {
|
|
13
13
|
x as useCustomMutation
|
|
14
14
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as p } from "../useQuery-
|
|
1
|
+
import { u as p } from "../useQuery-URJEw3ly.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";
|
|
@@ -27,14 +27,14 @@ const P = (t, e, o = !0, n = !1) => {
|
|
|
27
27
|
}, [e, c, s, n]);
|
|
28
28
|
}, F = (t, e, o, n, a, u = !0) => {
|
|
29
29
|
const s = p({
|
|
30
|
-
queryKey: y([e]),
|
|
31
|
-
queryFn: () => a ? A(t ?? "", e ?? "") : D(t ?? "", e ?? ""),
|
|
32
30
|
enabled: u && n && !!t && !!e && !!o,
|
|
31
|
+
queryFn: () => a ? A(t ?? "", e ?? "") : D(t ?? "", e ?? ""),
|
|
32
|
+
queryKey: y([e]),
|
|
33
33
|
select: (r) => E(r)
|
|
34
34
|
}), i = p({
|
|
35
|
-
queryKey: y([e]),
|
|
36
|
-
queryFn: () => q(t ?? "", e ?? ""),
|
|
37
35
|
enabled: u && !n && !!t && !!e && !!o,
|
|
36
|
+
queryFn: () => q(t ?? "", e ?? ""),
|
|
37
|
+
queryKey: y([e]),
|
|
38
38
|
select: (r) => E(r)
|
|
39
39
|
});
|
|
40
40
|
return n ? s : i;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { u as c } from "../IsRestoringProvider-SzKJZczp.js";
|
|
2
|
+
import { useBasePropsStore as i } from "../stores/BasePropsStore.js";
|
|
3
|
+
import { fetchFromCustomApi as f, getFarmOrgEntities as m, getModuleDependedEntities as p } from "../utils/fetches.js";
|
|
4
|
+
import { getModuleQueryKey as o } from "../utils/helper.js";
|
|
5
|
+
import { useEntityId as d } from "./useEntity.js";
|
|
6
|
+
const I = () => {
|
|
7
|
+
const e = a();
|
|
8
|
+
return {
|
|
9
|
+
prefetch: h(),
|
|
10
|
+
prefetchCustom: e,
|
|
11
|
+
usePrefetchEntity: l
|
|
12
|
+
};
|
|
13
|
+
}, a = () => {
|
|
14
|
+
const e = c();
|
|
15
|
+
return async ({
|
|
16
|
+
endpoint: r,
|
|
17
|
+
noAuth: t = !1,
|
|
18
|
+
queryKey: u,
|
|
19
|
+
token: s
|
|
20
|
+
}) => {
|
|
21
|
+
await e.prefetchQuery({
|
|
22
|
+
queryFn: () => f(r, s, t),
|
|
23
|
+
queryKey: o(u)
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
}, h = () => {
|
|
27
|
+
const e = c();
|
|
28
|
+
return ({
|
|
29
|
+
queryFn: r,
|
|
30
|
+
queryKey: t
|
|
31
|
+
}) => e.prefetchQuery({
|
|
32
|
+
queryFn: r,
|
|
33
|
+
queryKey: o(t)
|
|
34
|
+
});
|
|
35
|
+
}, l = (e, ...r) => {
|
|
36
|
+
const { moduleId: t } = i(), u = c(), s = d(e);
|
|
37
|
+
if (!t) return "Prefetch failed: no moduleId";
|
|
38
|
+
r.forEach(async (y) => {
|
|
39
|
+
const n = s(y);
|
|
40
|
+
if (n) {
|
|
41
|
+
if (e !== "ModuleDepended") {
|
|
42
|
+
await u.prefetchQuery({
|
|
43
|
+
queryFn: () => m(t, n),
|
|
44
|
+
queryKey: o([n])
|
|
45
|
+
});
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
await u.prefetchQuery({
|
|
49
|
+
queryFn: () => p(t, n),
|
|
50
|
+
queryKey: o([n])
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
I as useOffline
|
|
57
|
+
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { u as m } from "../useQuery-
|
|
2
|
-
import { g as c } from "../api-
|
|
1
|
+
import { u as m } from "../useQuery-URJEw3ly.js";
|
|
2
|
+
import { g as c } from "../api-CikhPcJj.js";
|
|
3
3
|
import { useBasePropsStore as n } from "../stores/BasePropsStore.js";
|
|
4
4
|
import { fetchFromCommonApi as i, fetchFromModuleApi as p } from "../utils/fetches.js";
|
|
5
5
|
import { getModuleQueryKey as l, universalSelector as s } from "../utils/helper.js";
|
|
6
6
|
const q = (e) => {
|
|
7
7
|
const t = n((r) => r.commonOptions), o = n((r) => r.currentLanguageId), u = c(t, e);
|
|
8
8
|
return m({
|
|
9
|
-
queryKey: [e, o],
|
|
10
9
|
queryFn: () => u ? Promise.resolve(u) : i(`${e}/dropdown`),
|
|
10
|
+
queryKey: [e, o],
|
|
11
11
|
select: (r) => s(r)
|
|
12
12
|
});
|
|
13
13
|
}, F = (e = !0) => {
|
|
14
14
|
const t = n((o) => o.moduleId);
|
|
15
15
|
return m({
|
|
16
|
-
|
|
16
|
+
enabled: e,
|
|
17
17
|
queryFn: () => p(`ModuleDependencies/${t}`),
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
queryKey: l([]),
|
|
19
|
+
select: (o) => s(o)
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as S } from "./_commonjsHelpers-ByX85dGu.js";
|
|
2
2
|
var G, Qr;
|
|
3
|
-
function
|
|
3
|
+
function Jr() {
|
|
4
4
|
if (Qr) return G;
|
|
5
5
|
Qr = 1;
|
|
6
6
|
var r = Array.isArray;
|
|
@@ -87,7 +87,7 @@ var U, se;
|
|
|
87
87
|
function It() {
|
|
88
88
|
if (se) return U;
|
|
89
89
|
se = 1;
|
|
90
|
-
var r =
|
|
90
|
+
var r = Jr(), e = Zr(), t = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, a = /^\w*$/;
|
|
91
91
|
function n(i, u) {
|
|
92
92
|
if (r(i))
|
|
93
93
|
return !1;
|
|
@@ -119,16 +119,16 @@ function lt() {
|
|
|
119
119
|
}
|
|
120
120
|
return B = u, B;
|
|
121
121
|
}
|
|
122
|
-
var
|
|
122
|
+
var $, fe;
|
|
123
123
|
function At() {
|
|
124
|
-
if (fe) return
|
|
124
|
+
if (fe) return $;
|
|
125
125
|
fe = 1;
|
|
126
126
|
var r = p(), e = r["__core-js_shared__"];
|
|
127
|
-
return
|
|
127
|
+
return $ = e, $;
|
|
128
128
|
}
|
|
129
|
-
var
|
|
129
|
+
var W, he;
|
|
130
130
|
function Ot() {
|
|
131
|
-
if (he) return
|
|
131
|
+
if (he) return W;
|
|
132
132
|
he = 1;
|
|
133
133
|
var r = At(), e = (function() {
|
|
134
134
|
var a = /[^.]+$/.exec(r && r.keys && r.keys.IE_PROTO || "");
|
|
@@ -137,11 +137,11 @@ function Ot() {
|
|
|
137
137
|
function t(a) {
|
|
138
138
|
return !!e && e in a;
|
|
139
139
|
}
|
|
140
|
-
return
|
|
140
|
+
return W = t, W;
|
|
141
141
|
}
|
|
142
|
-
var
|
|
142
|
+
var J, ve;
|
|
143
143
|
function gt() {
|
|
144
|
-
if (ve) return
|
|
144
|
+
if (ve) return J;
|
|
145
145
|
ve = 1;
|
|
146
146
|
var r = Function.prototype, e = r.toString;
|
|
147
147
|
function t(a) {
|
|
@@ -157,7 +157,7 @@ function gt() {
|
|
|
157
157
|
}
|
|
158
158
|
return "";
|
|
159
159
|
}
|
|
160
|
-
return
|
|
160
|
+
return J = t, J;
|
|
161
161
|
}
|
|
162
162
|
var X, _e;
|
|
163
163
|
function Pt() {
|
|
@@ -406,7 +406,7 @@ function O() {
|
|
|
406
406
|
return gr = e, gr;
|
|
407
407
|
}
|
|
408
408
|
var br, Ge;
|
|
409
|
-
function
|
|
409
|
+
function $t() {
|
|
410
410
|
if (Ge) return br;
|
|
411
411
|
Ge = 1;
|
|
412
412
|
var r = O();
|
|
@@ -417,7 +417,7 @@ function Wt() {
|
|
|
417
417
|
return br = e, br;
|
|
418
418
|
}
|
|
419
419
|
var yr, Ee;
|
|
420
|
-
function
|
|
420
|
+
function Wt() {
|
|
421
421
|
if (Ee) return yr;
|
|
422
422
|
Ee = 1;
|
|
423
423
|
var r = O();
|
|
@@ -427,7 +427,7 @@ function Jt() {
|
|
|
427
427
|
return yr = e, yr;
|
|
428
428
|
}
|
|
429
429
|
var qr, He;
|
|
430
|
-
function
|
|
430
|
+
function Jt() {
|
|
431
431
|
if (He) return qr;
|
|
432
432
|
He = 1;
|
|
433
433
|
var r = O();
|
|
@@ -451,7 +451,7 @@ var Cr, Ne;
|
|
|
451
451
|
function Zt() {
|
|
452
452
|
if (Ne) return Cr;
|
|
453
453
|
Ne = 1;
|
|
454
|
-
var r = Vt(), e =
|
|
454
|
+
var r = Vt(), e = $t(), t = Wt(), a = Jt(), n = Xt();
|
|
455
455
|
function i(u) {
|
|
456
456
|
var s = -1, o = u == null ? 0 : u.length;
|
|
457
457
|
for (this.clear(); ++s < o; ) {
|
|
@@ -520,7 +520,7 @@ var Ir, Ue;
|
|
|
520
520
|
function ta() {
|
|
521
521
|
if (Ue) return Ir;
|
|
522
522
|
Ue = 1;
|
|
523
|
-
var r = Xr(), e = ea(), t =
|
|
523
|
+
var r = Xr(), e = ea(), t = Jr(), a = Zr(), n = r ? r.prototype : void 0, i = n ? n.toString : void 0;
|
|
524
524
|
function u(s) {
|
|
525
525
|
if (typeof s == "string")
|
|
526
526
|
return s;
|
|
@@ -547,16 +547,16 @@ var Or, Be;
|
|
|
547
547
|
function na() {
|
|
548
548
|
if (Be) return Or;
|
|
549
549
|
Be = 1;
|
|
550
|
-
var r =
|
|
550
|
+
var r = Jr(), e = It(), t = ra(), a = aa();
|
|
551
551
|
function n(i, u) {
|
|
552
552
|
return r(i) ? i : e(i, u) ? [i] : t(a(i));
|
|
553
553
|
}
|
|
554
554
|
return Or = n, Or;
|
|
555
555
|
}
|
|
556
|
-
var Pr,
|
|
556
|
+
var Pr, $e;
|
|
557
557
|
function ia() {
|
|
558
|
-
if (
|
|
559
|
-
|
|
558
|
+
if ($e) return Pr;
|
|
559
|
+
$e = 1;
|
|
560
560
|
var r = Zr();
|
|
561
561
|
function e(t) {
|
|
562
562
|
if (typeof t == "string" || r(t))
|
|
@@ -566,10 +566,10 @@ function ia() {
|
|
|
566
566
|
}
|
|
567
567
|
return Pr = e, Pr;
|
|
568
568
|
}
|
|
569
|
-
var wr,
|
|
569
|
+
var wr, We;
|
|
570
570
|
function ya() {
|
|
571
|
-
if (
|
|
572
|
-
|
|
571
|
+
if (We) return wr;
|
|
572
|
+
We = 1;
|
|
573
573
|
var r = na(), e = ia();
|
|
574
574
|
function t(a, n) {
|
|
575
575
|
n = r(n, a);
|
|
@@ -579,10 +579,10 @@ function ya() {
|
|
|
579
579
|
}
|
|
580
580
|
return wr = t, wr;
|
|
581
581
|
}
|
|
582
|
-
var Mr,
|
|
582
|
+
var Mr, Je;
|
|
583
583
|
function ua() {
|
|
584
|
-
if (
|
|
585
|
-
|
|
584
|
+
if (Je) return Mr;
|
|
585
|
+
Je = 1;
|
|
586
586
|
var r = Object.prototype;
|
|
587
587
|
function e(t) {
|
|
588
588
|
var a = t && t.constructor, n = typeof a == "function" && a.prototype || r;
|
|
@@ -743,16 +743,16 @@ function da() {
|
|
|
743
743
|
}
|
|
744
744
|
return Br = jt, Br;
|
|
745
745
|
}
|
|
746
|
-
var
|
|
746
|
+
var $r, ht;
|
|
747
747
|
function la() {
|
|
748
|
-
if (ht) return
|
|
748
|
+
if (ht) return $r;
|
|
749
749
|
ht = 1;
|
|
750
750
|
function r(e) {
|
|
751
751
|
return function(t) {
|
|
752
752
|
return e(t);
|
|
753
753
|
};
|
|
754
754
|
}
|
|
755
|
-
return
|
|
755
|
+
return $r = r, $r;
|
|
756
756
|
}
|
|
757
757
|
var y = { exports: {} };
|
|
758
758
|
y.exports;
|
|
@@ -769,18 +769,18 @@ function ga() {
|
|
|
769
769
|
r.exports = s;
|
|
770
770
|
})(y, y.exports)), y.exports;
|
|
771
771
|
}
|
|
772
|
-
var
|
|
772
|
+
var Wr, _t;
|
|
773
773
|
function Sa() {
|
|
774
|
-
if (_t) return
|
|
774
|
+
if (_t) return Wr;
|
|
775
775
|
_t = 1;
|
|
776
776
|
var r = da(), e = la(), t = ga(), a = t && t.isTypedArray, n = a ? e(a) : r;
|
|
777
|
-
return
|
|
777
|
+
return Wr = n, Wr;
|
|
778
778
|
}
|
|
779
779
|
export {
|
|
780
780
|
qa as a,
|
|
781
781
|
ma as b,
|
|
782
782
|
Ca as c,
|
|
783
|
-
|
|
783
|
+
Jr as d,
|
|
784
784
|
Ta as e,
|
|
785
785
|
ja as f,
|
|
786
786
|
Sa as g,
|
|
@@ -32,5 +32,5 @@ type ModuleBaseProps = {
|
|
|
32
32
|
/**
|
|
33
33
|
* Main component of the module. This component is used to create a module with a router and a signalR provider.
|
|
34
34
|
*/
|
|
35
|
-
export declare const ModuleBase: ({ props,
|
|
35
|
+
export declare const ModuleBase: ({ env, props, queryClient, routes, useSignalR, }: ModuleBaseProps) => import("react").JSX.Element;
|
|
36
36
|
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { QueryClient } from '@tanstack/react-query';
|
|
2
2
|
import { BaseProps } from '../types/BaseProps';
|
|
3
3
|
import { EnvConfig } from '../types/Environment';
|
|
4
|
-
export declare const ModuleQueryClient: QueryClient;
|
|
5
4
|
type ModuleCoreProps = {
|
|
6
5
|
/**
|
|
7
6
|
* Properties that are passed to the Base component by the host application, {@link BaseProps}
|
|
@@ -28,5 +27,5 @@ type ModuleCoreProps = {
|
|
|
28
27
|
/**
|
|
29
28
|
* Minimal component to create a module with a query client and a signalR provider (to use module api)
|
|
30
29
|
*/
|
|
31
|
-
export declare const ModuleCore: ({
|
|
30
|
+
export declare const ModuleCore: ({ children, env, props, queryClient, }: ModuleCoreProps) => import("react").JSX.Element;
|
|
32
31
|
export {};
|
|
@@ -5,5 +5,5 @@ type UseCustomParams<T> = Omit<Parameters<typeof useQuery>[0], 'queryFn' | 'sele
|
|
|
5
5
|
selector?: (data: unknown) => T;
|
|
6
6
|
noAuth?: boolean;
|
|
7
7
|
};
|
|
8
|
-
export declare const useCustom: <T>({ endpoint,
|
|
8
|
+
export declare const useCustom: <T>({ enabled, endpoint, noAuth, queryKey, selector, token, ...rest }: UseCustomParams<T>) => import('@tanstack/react-query').UseQueryResult<NoInfer<T>, unknown>;
|
|
9
9
|
export {};
|
|
@@ -11,4 +11,4 @@ export type CustomMutationInput<Input> = {
|
|
|
11
11
|
input: Input;
|
|
12
12
|
replaceEndpointWith?: string;
|
|
13
13
|
};
|
|
14
|
-
export declare const useCustomMutation: <Input, Output>({ endpoint,
|
|
14
|
+
export declare const useCustomMutation: <Input, Output>({ endpoint, headers, method, noAuth, token, ...rest }: UseCustomMutationParams) => UseMutationResult<BaseResponse<Output>, Error, CustomMutationInput<Input>, unknown>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { HortiviewDataAreaEntity, HortiviewDataAreaGroup, ModuleDataAreaGroup } from '../types/Entities';
|
|
2
2
|
export declare const useOffline: () => {
|
|
3
|
-
|
|
3
|
+
prefetch: <T>({ queryFn, queryKey, }: {
|
|
4
|
+
queryKey: (string | undefined)[];
|
|
5
|
+
queryFn: () => Promise<T>;
|
|
6
|
+
}) => Promise<void>;
|
|
7
|
+
prefetchCustom: <T>({ endpoint, noAuth, queryKey, token, }: {
|
|
4
8
|
queryKey: (string | undefined)[];
|
|
5
9
|
endpoint: string;
|
|
6
10
|
token?: string;
|
|
7
11
|
noAuth?: boolean;
|
|
8
12
|
selector?: (data: unknown) => T;
|
|
9
13
|
}) => Promise<void>;
|
|
10
|
-
prefetch: <T>({ queryKey, queryFn, }: {
|
|
11
|
-
queryKey: (string | undefined)[];
|
|
12
|
-
queryFn: () => Promise<T>;
|
|
13
|
-
}) => Promise<void>;
|
|
14
14
|
usePrefetchEntity: <K extends HortiviewDataAreaGroup | ModuleDataAreaGroup, E extends HortiviewDataAreaEntity<K>>(group: K, ...entities: E[]) => "Prefetch failed: no moduleId" | undefined;
|
|
15
15
|
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ActionItem } from './ActionStorage';
|
|
2
|
+
import { AppInsightsEvent, AppInsightsException, AppInsightsProperties } from './AppInsights';
|
|
3
|
+
import { AllDropdownsData, CommonOption } from './CommonOptions';
|
|
4
|
+
import { EnvironmentVariable } from './EnvironmentVariable';
|
|
5
|
+
import { SystemMessage } from './SystemMessage';
|
|
6
|
+
/**
|
|
7
|
+
* Properties that are passed to the Base component by the host application
|
|
8
|
+
* @param alertRules rules for the alerting system, that are used to show alerts in the host application
|
|
9
|
+
* @param isOnline indicates if the host application is online or offline
|
|
10
|
+
* @param modulePermissionToken token for the module, to communicate with the module api
|
|
11
|
+
* @param moduleId id of the module
|
|
12
|
+
* @param organizationId id of the organization, where the module is used
|
|
13
|
+
* @param basePath base path of the module (that is part of the URL and will be used for routing)
|
|
14
|
+
* @param currentNavigationPath current path of the route, that is changed, when the host application navigates
|
|
15
|
+
* @param currentLanguage current language of the host application
|
|
16
|
+
* @param currentLanguageId current language id of the host application
|
|
17
|
+
* @param commonOptions common options that are used in the module, to show dropdowns with options
|
|
18
|
+
* @param environmentVariables environment variables that are used in the module, to show environment specific information
|
|
19
|
+
* @param refreshModulePermissionToken function to refresh the module permission token, that is used to communicate with the module api
|
|
20
|
+
* @param navigateInHortiview function to navigate to a specific route in the host application, that is used for routing in non-React remotes
|
|
21
|
+
* @param addBreadcrumbTranslation function to add a translation to the i18n instance of the host application, that is used for breadcrumb translations
|
|
22
|
+
* @param showSnackbar function to show a snackbar in the host application, that is used to show messages in the host application
|
|
23
|
+
* @param showMessage function to show a message in the host application, that is used to show messages in the host application
|
|
24
|
+
* @param pendingActions list of pending actions that are used in the module, to show pending actions in the host application
|
|
25
|
+
* @param getPendingActions function to get the list of pending actions, that are used in the module, to show pending actions in the host application
|
|
26
|
+
* @param resolveAction function to resolve a pending action, that is used in the module, to show pending actions in the host application
|
|
27
|
+
* @param startResolvingAction function to start resolving a pending action, that is used in the module, to show pending actions in the host application
|
|
28
|
+
* @param addAction function to add a pending action, that is used in the module, to show pending actions in the host application
|
|
29
|
+
* @param getActions function to get the list of actions, that is used in the module, to show actions in the host application
|
|
30
|
+
* @param getActionByKey function to get an action by key, that is used in the module, to show actions in the host application
|
|
31
|
+
* @param logEvent function to log an event to the host application, that is used for telemetry
|
|
32
|
+
* @param logError function to log an error to the host application, that is used for telemetry
|
|
33
|
+
* @param throwError function to throw an error in the host application, that is used for error handling
|
|
34
|
+
* @param config configuration object that is used to configure the module
|
|
35
|
+
*/
|
|
36
|
+
export type BaseProps = {
|
|
37
|
+
alertRules?: string;
|
|
38
|
+
isOnline?: boolean;
|
|
39
|
+
modulePermissionToken?: string;
|
|
40
|
+
moduleId?: string;
|
|
41
|
+
organizationId?: string;
|
|
42
|
+
basePath: string;
|
|
43
|
+
currentNavigationPath?: string;
|
|
44
|
+
currentLanguage?: string;
|
|
45
|
+
currentLanguageId?: string;
|
|
46
|
+
commonOptions?: AllDropdownsData<CommonOption>['items'];
|
|
47
|
+
environmentVariables?: EnvironmentVariable[];
|
|
48
|
+
refreshModulePermissionToken?: () => Promise<string | undefined>;
|
|
49
|
+
/**
|
|
50
|
+
* Host navigation callback for non-React remotes.
|
|
51
|
+
*
|
|
52
|
+
* React modules should use React Router's `useNavigate` directly and prefer relative paths.
|
|
53
|
+
* Angular (or other non-React) modules should call this callback to ask the host shell to navigate.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* React module (recommended):
|
|
57
|
+
* ```tsx
|
|
58
|
+
* import { useNavigate } from 'react-router';
|
|
59
|
+
*
|
|
60
|
+
* const navigate = useNavigate();
|
|
61
|
+
*
|
|
62
|
+
* navigate('details/42'); // /farm/modules/{moduleId}/details/42
|
|
63
|
+
* navigate(''); // /farm/modules/{moduleId}
|
|
64
|
+
*
|
|
65
|
+
* // Avoid absolute paths in module-internal navigation:
|
|
66
|
+
* // navigate('/details/42')
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* Angular module:
|
|
71
|
+
* ```ts
|
|
72
|
+
* // baseProps is provided by the host application
|
|
73
|
+
* baseProps.navigateInHortiview?.('details/42');
|
|
74
|
+
* baseProps.navigateInHortiview?.('');
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* The host can normalize and prepend `basePath` as needed.
|
|
78
|
+
* @param path
|
|
79
|
+
* @returns
|
|
80
|
+
*/
|
|
81
|
+
navigateInHortiview?: (path: string) => void;
|
|
82
|
+
addBreadcrumbTranslation?: (translation: {
|
|
83
|
+
key: string;
|
|
84
|
+
value: string;
|
|
85
|
+
}, hide?: boolean) => void;
|
|
86
|
+
showSnackbar?: (message: string, icon?: string) => void;
|
|
87
|
+
showMessage?: (message: SystemMessage) => void;
|
|
88
|
+
pendingActions?: ActionItem[];
|
|
89
|
+
getPendingActions?: () => ActionItem[];
|
|
90
|
+
resolveAction?: (key: string, result?: string) => void;
|
|
91
|
+
startResolvingAction?: (key: string) => void;
|
|
92
|
+
addAction?: (functionName: string, args: unknown[], key?: string) => void;
|
|
93
|
+
getActions?: () => ActionItem[];
|
|
94
|
+
getActionByKey?: (key: string) => ActionItem | undefined;
|
|
95
|
+
logEvent?: (event: AppInsightsEvent, customProperties?: AppInsightsProperties) => void;
|
|
96
|
+
logError?: (exception: AppInsightsException) => void;
|
|
97
|
+
throwError?: (message: string, code: number) => void;
|
|
98
|
+
};
|