@hortiview/modulebase 0.0.20436 → 0.0.20524
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 +3 -2
- package/dist/IsRestoringProvider-CBSZo7ur.js +312 -0
- package/dist/ModuleCore-DuJVrj6v.js +11828 -0
- package/dist/QueryClientProvider-DyiNrPkn.js +514 -0
- package/dist/_commonjsHelpers-ByX85dGu.js +33 -0
- package/dist/api-COabZnyn.js +147 -0
- package/dist/assets/ModuleCore.css +1 -1
- package/dist/chunk-LFPYN7LY-D1ls8FXf.js +8643 -0
- package/dist/components/ModuleBase.js +9 -9
- package/dist/components/ModuleCore.js +1 -1
- package/dist/constants.js +2 -3
- package/dist/hooks/useCustom.js +1 -1
- package/dist/hooks/useCustomMutation.js +5 -5
- package/dist/hooks/useEntity.js +30 -30
- package/dist/hooks/useOffline.js +1 -1
- package/dist/hooks/useOption.js +5 -5
- package/dist/hooks/useServiceBus.js +1 -1
- package/dist/hooks/useStores.js +1 -1
- package/dist/{_baseGet-C6jMXSsQ.js → isTypedArray-SkhznY1k.js} +494 -494
- package/dist/lib/constants.d.ts +0 -1
- package/dist/lib/hooks/useCustom.d.ts +4 -2
- package/dist/lib/hooks/useCustomMutation.d.ts +8 -3
- package/dist/lib/hooks/useEntity.d.ts +6 -0
- package/dist/lib/types/Requests.d.ts +0 -17
- package/dist/lib/utils/api.d.ts +6 -13
- package/dist/lib/utils/baseFetches.d.ts +3 -2
- package/dist/main.js +188 -173
- package/dist/module-router.js +2322 -121
- package/dist/{mutation-DSKlaYzY.js → mutation-CmhiEgfA.js} +101 -56
- package/dist/{omit-C9Qe80rl.js → omit-Do6MFRwA.js} +240 -223
- package/dist/provider/SignalR/SignalRProvider.js +2389 -2824
- package/dist/react-c9FSfB30.js +27 -0
- package/dist/stores/BasePropsStore.js +1 -1
- package/dist/stores/EnvironmentStore.js +1 -1
- package/dist/useMutation-Aoachkw_.js +139 -0
- package/dist/useQuery-DEU_AUtf.js +392 -0
- package/dist/utils/api.js +3 -4
- package/dist/utils/baseFetches.js +18 -14
- package/dist/utils/fetches.js +3 -4
- package/dist/utils/helper.js +14 -14
- package/package.json +16 -13
- package/dist/ModuleCore-DpwHP0IU.js +0 -14973
- package/dist/QueryClientProvider-Beog9TR7.js +0 -437
- package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/api-CogBuK0n.js +0 -473
- package/dist/chunk-IR6S3I6Y-BmDdD3SP.js +0 -8162
- package/dist/isRestoring-CLuxJVSA.js +0 -281
- package/dist/react-QiIgv49H.js +0 -27
- package/dist/useMutation-zu8uxBak.js +0 -97
- package/dist/useQuery-Bj9k9zik.js +0 -395
- package/dist/utils-DxRR_XLb.js +0 -9
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect as s } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { SignalRProvider as
|
|
3
|
+
import { c as u, R as c, O as l, u as m } from "../chunk-LFPYN7LY-D1ls8FXf.js";
|
|
4
|
+
import { SignalRProvider as d } from "../provider/SignalR/SignalRProvider.js";
|
|
5
5
|
import { useBasePropsStore as f } from "../stores/BasePropsStore.js";
|
|
6
|
-
import { M as p, a as
|
|
7
|
-
const
|
|
8
|
-
const e = f((o) => o.currentNavigationPath), t =
|
|
6
|
+
import { M as p, a as v } from "../ModuleCore-DuJVrj6v.js";
|
|
7
|
+
const g = () => {
|
|
8
|
+
const e = f((o) => o.currentNavigationPath), t = m();
|
|
9
9
|
s(() => {
|
|
10
10
|
e && t(e, { replace: !0 });
|
|
11
11
|
}, [e, t]);
|
|
12
|
-
},
|
|
12
|
+
}, h = () => (g(), /* @__PURE__ */ r(l, {})), x = ({
|
|
13
13
|
props: e,
|
|
14
14
|
routes: t,
|
|
15
15
|
env: o = void 0,
|
|
16
16
|
useSignalR: a = !1,
|
|
17
|
-
queryClient: i =
|
|
17
|
+
queryClient: i = v
|
|
18
18
|
}) => {
|
|
19
19
|
const n = u([
|
|
20
20
|
{
|
|
21
21
|
path: e.basePath,
|
|
22
22
|
children: t,
|
|
23
|
-
element: /* @__PURE__ */ r(
|
|
23
|
+
element: /* @__PURE__ */ r(h, {})
|
|
24
24
|
}
|
|
25
25
|
]);
|
|
26
|
-
return /* @__PURE__ */ r(p, { props: e, env: o, queryClient: i, children: /* @__PURE__ */ r(
|
|
26
|
+
return /* @__PURE__ */ r(p, { props: e, env: o, queryClient: i, children: /* @__PURE__ */ r(d, { enabled: a, children: /* @__PURE__ */ r(c, { router: n }) }) });
|
|
27
27
|
};
|
|
28
28
|
export {
|
|
29
29
|
x as ModuleBase
|
package/dist/constants.js
CHANGED
|
@@ -5,7 +5,7 @@ const a = [
|
|
|
5
5
|
"organizationId",
|
|
6
6
|
"currentLanguageId",
|
|
7
7
|
"currentNavigationPath"
|
|
8
|
-
], e =
|
|
8
|
+
], e = {
|
|
9
9
|
/**
|
|
10
10
|
* The server timed out waiting for the request.
|
|
11
11
|
*/
|
|
@@ -29,6 +29,5 @@ const a = [
|
|
|
29
29
|
};
|
|
30
30
|
export {
|
|
31
31
|
a as REQUIRED_PROPS,
|
|
32
|
-
e as
|
|
33
|
-
t as RETRY_HTTP_STATUS_CODES
|
|
32
|
+
e as RETRY_HTTP_STATUS_CODES
|
|
34
33
|
};
|
package/dist/hooks/useCustom.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { u as n } from "../useMutation-
|
|
1
|
+
import { u as n } from "../useMutation-Aoachkw_.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-
|
|
6
|
+
import "../ModuleCore-DuJVrj6v.js";
|
|
7
7
|
import { mutateOnCustomApi as s } from "../utils/fetches.js";
|
|
8
8
|
import "../types/Entities.js";
|
|
9
|
-
import "../api-
|
|
10
|
-
import "../omit-
|
|
9
|
+
import "../api-COabZnyn.js";
|
|
10
|
+
import "../omit-Do6MFRwA.js";
|
|
11
11
|
import "../stores/EnvironmentStore.js";
|
|
12
12
|
const d = ({
|
|
13
13
|
endpoint: t,
|
|
@@ -16,7 +16,7 @@ const d = ({
|
|
|
16
16
|
headers: r,
|
|
17
17
|
noAuth: i
|
|
18
18
|
}) => n({
|
|
19
|
-
mutationFn: (p, u) => s(u ?? t, p, o, m, r, i)
|
|
19
|
+
mutationFn: ({ input: p, replaceEndpointWith: u }) => s(u ?? t, p, o, m, r, i)
|
|
20
20
|
});
|
|
21
21
|
export {
|
|
22
22
|
d as useCustomMutation
|
package/dist/hooks/useEntity.js
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { u as p } from "../useQuery-
|
|
1
|
+
import { u as p } from "../useQuery-DEU_AUtf.js";
|
|
2
2
|
import { useMemo as g, useCallback as Q } from "react";
|
|
3
3
|
import { useBasePropsStore as m } from "../stores/BasePropsStore.js";
|
|
4
|
-
import { AllEntitiesTypeResultMap as
|
|
5
|
-
import { getModuleDependedEntitiesRaw as
|
|
4
|
+
import { AllEntitiesTypeResultMap as v } from "../types/Entities.js";
|
|
5
|
+
import { getModuleDependedEntitiesRaw as A, getModuleDependedEntities as D, getFarmOrgEntities as q } from "../utils/fetches.js";
|
|
6
6
|
import { getModuleQueryKey as y, universalSelector as E } from "../utils/helper.js";
|
|
7
|
-
import { useOption as M, useModuleDependency as
|
|
8
|
-
const P = (t, e,
|
|
9
|
-
const a = m((
|
|
7
|
+
import { useOption as M, useModuleDependency as k } from "./useOption.js";
|
|
8
|
+
const P = (t, e, o = !0, n = !1) => {
|
|
9
|
+
const a = m((d) => d.moduleId), u = m((d) => d.organizationId), s = t === "ModuleDepended", r = K(t)(e), c = F(
|
|
10
10
|
a,
|
|
11
11
|
r,
|
|
12
|
-
|
|
12
|
+
u,
|
|
13
13
|
s,
|
|
14
14
|
n,
|
|
15
|
-
|
|
15
|
+
o
|
|
16
16
|
);
|
|
17
17
|
return g(() => {
|
|
18
|
-
const
|
|
19
|
-
if (s && n) return
|
|
20
|
-
const
|
|
21
|
-
return f
|
|
18
|
+
const d = (c.data ?? []).map((l) => {
|
|
19
|
+
if (s && n) return l;
|
|
20
|
+
const f = v[e];
|
|
21
|
+
return l[f];
|
|
22
22
|
});
|
|
23
23
|
return {
|
|
24
24
|
...c,
|
|
25
|
-
data:
|
|
25
|
+
data: d
|
|
26
26
|
};
|
|
27
27
|
}, [e, c, s, n]);
|
|
28
|
-
},
|
|
28
|
+
}, F = (t, e, o, n, a, u = !0) => {
|
|
29
29
|
const s = p({
|
|
30
30
|
queryKey: y([e]),
|
|
31
|
-
queryFn: () => a ?
|
|
32
|
-
enabled:
|
|
31
|
+
queryFn: () => a ? A(t ?? "", e ?? "") : D(t ?? "", e ?? ""),
|
|
32
|
+
enabled: u && n && !!t && !!e && !!o,
|
|
33
33
|
select: (r) => E(r)
|
|
34
|
-
}),
|
|
34
|
+
}), i = p({
|
|
35
35
|
queryKey: y([e]),
|
|
36
|
-
queryFn: () =>
|
|
37
|
-
enabled:
|
|
36
|
+
queryFn: () => q(t ?? "", e ?? ""),
|
|
37
|
+
enabled: u && !n && !!t && !!e && !!o,
|
|
38
38
|
select: (r) => E(r)
|
|
39
39
|
});
|
|
40
|
-
return n ? s :
|
|
41
|
-
},
|
|
42
|
-
const { data: e } = M("DataAreaGroup"), { data:
|
|
40
|
+
return n ? s : i;
|
|
41
|
+
}, K = (t) => {
|
|
42
|
+
const { data: e } = M("DataAreaGroup"), { data: o } = M("DataAreaEntity"), { data: n } = k(t === "ModuleDepended");
|
|
43
43
|
return Q(
|
|
44
|
-
(
|
|
44
|
+
(u) => {
|
|
45
45
|
if (t === "ModuleDepended")
|
|
46
|
-
return n ? n.find((r) => r.registeredEntityName ===
|
|
47
|
-
if (!e || !
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
return
|
|
46
|
+
return n ? n.find((r) => r.registeredEntityName === u)?.id : void 0;
|
|
47
|
+
if (!e || !o) return;
|
|
48
|
+
const i = e.find((r) => r.key === t)?.id;
|
|
49
|
+
if (i)
|
|
50
|
+
return o.find((r) => r.description === i && r.value === u)?.id;
|
|
51
51
|
},
|
|
52
|
-
[t, e,
|
|
52
|
+
[t, e, o, n]
|
|
53
53
|
);
|
|
54
54
|
};
|
|
55
55
|
export {
|
|
56
56
|
P as useEntity,
|
|
57
|
-
|
|
57
|
+
K as useEntityId
|
|
58
58
|
};
|
package/dist/hooks/useOffline.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as y } from "../QueryClientProvider-
|
|
1
|
+
import { u as y } from "../QueryClientProvider-DyiNrPkn.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,20 +1,20 @@
|
|
|
1
|
-
import { u as m } from "../useQuery-
|
|
2
|
-
import { g as c } from "../api-
|
|
1
|
+
import { u as m } from "../useQuery-DEU_AUtf.js";
|
|
2
|
+
import { g as c } from "../api-COabZnyn.js";
|
|
3
3
|
import { useBasePropsStore as n } from "../stores/BasePropsStore.js";
|
|
4
|
-
import {
|
|
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
9
|
queryKey: [e, o],
|
|
10
|
-
queryFn: () => u ? Promise.resolve(u) :
|
|
10
|
+
queryFn: () => u ? Promise.resolve(u) : i(`${e}/dropdown`),
|
|
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
|
queryKey: l([]),
|
|
17
|
-
queryFn: () =>
|
|
17
|
+
queryFn: () => p(`ModuleDependencies/${t}`),
|
|
18
18
|
select: (o) => s(o),
|
|
19
19
|
enabled: e
|
|
20
20
|
});
|
package/dist/hooks/useStores.js
CHANGED