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