@hortiview/modulebase 0.0.1 → 0.0.17-beta

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 (80) hide show
  1. package/README.md +8 -8
  2. package/dist/ModuleCore-YCIFN_02.js +14973 -0
  3. package/dist/QueryClientProvider-Beog9TR7.js +437 -0
  4. package/dist/{_baseGet-Bh5zJ_C8.js → _baseGet-C6jMXSsQ.js} +448 -448
  5. package/dist/api-s6E2GJtu.js +458 -0
  6. package/dist/assets/ModuleCore.css +1 -0
  7. package/dist/chunk-QMGIS6GS-C4bgXQXY.js +9203 -0
  8. package/dist/components/ModuleBase.js +20 -681
  9. package/dist/components/ModuleCore.js +10 -0
  10. package/dist/hooks/useBreadcrumbTranslation.js +16 -13
  11. package/dist/hooks/useCustom.js +15 -15
  12. package/dist/hooks/useCustomMutation.js +23 -0
  13. package/dist/hooks/useEntity.js +53 -54
  14. package/dist/hooks/useOffline.js +45 -0
  15. package/dist/hooks/useOption.js +19 -17
  16. package/dist/hooks/useServiceBus.js +25 -0
  17. package/dist/hooks/useStores.js +11 -841
  18. package/dist/isRestoring-CLuxJVSA.js +281 -0
  19. package/dist/lib/components/ModuleBase.d.ts +36 -0
  20. package/dist/lib/components/ModuleCore.d.ts +32 -0
  21. package/dist/{constants.d.ts → lib/constants.d.ts} +1 -1
  22. package/dist/{hooks → lib/hooks}/useBreadcrumbTranslation.d.ts +1 -1
  23. package/dist/lib/hooks/useCustom.d.ts +8 -0
  24. package/dist/lib/hooks/useCustomMutation.d.ts +9 -0
  25. package/dist/{hooks → lib/hooks}/useEntity.d.ts +6 -30
  26. package/dist/lib/hooks/useOffline.d.ts +15 -0
  27. package/dist/{hooks → lib/hooks}/useOption.d.ts +1 -1
  28. package/dist/lib/hooks/useServiceBus.d.ts +19 -0
  29. package/dist/lib/hooks/useStores.d.ts +38 -0
  30. package/dist/lib/main.d.ts +27 -0
  31. package/dist/lib/module-router.d.ts +7 -0
  32. package/dist/{stores → lib/stores}/EnvironmentStore.d.ts +1 -1
  33. package/dist/lib/types/ActionStorage.d.ts +16 -0
  34. package/dist/{types → lib/types}/BaseProps.d.ts +14 -2
  35. package/dist/{types → lib/types}/Deprecated.d.ts +7 -1
  36. package/dist/lib/types/Entities.d.ts +22 -0
  37. package/dist/{types → lib/types}/Environment.d.ts +3 -2
  38. package/dist/lib/types/EnvironmentVariable.d.ts +6 -0
  39. package/dist/lib/types/ModuleApi.d.ts +163 -0
  40. package/dist/{types → lib/types}/Requests.d.ts +6 -11
  41. package/dist/lib/types/ServiceBus.d.ts +17 -0
  42. package/dist/{utils/fetches.d.ts → lib/utils/api.d.ts} +2 -8
  43. package/dist/lib/utils/baseFetches.d.ts +19 -0
  44. package/dist/lib/utils/fetches.d.ts +43 -0
  45. package/dist/lib/utils/helper.d.ts +29 -0
  46. package/dist/main.js +224 -17
  47. package/dist/module-router.js +137 -0
  48. package/dist/mutation-DSKlaYzY.js +192 -0
  49. package/dist/omit-C9Qe80rl.js +835 -0
  50. package/dist/stores/EnvironmentStore.js +9 -3
  51. package/dist/types/ActionStorage.js +4 -0
  52. package/dist/types/Entities.js +25 -0
  53. package/dist/types/EnvironmentVariable.js +1 -0
  54. package/dist/types/Requests.js +1 -4
  55. package/dist/types/ServiceBus.js +1 -0
  56. package/dist/useMutation-zu8uxBak.js +97 -0
  57. package/dist/{useQuery-znAyMQW1.js → useQuery-Bj9k9zik.js} +106 -108
  58. package/dist/utils/api.js +9 -0
  59. package/dist/utils/baseFetches.js +19 -0
  60. package/dist/utils/fetches.js +20 -14
  61. package/dist/utils/helper.js +55 -0
  62. package/dist/utils-DxRR_XLb.js +9 -0
  63. package/package.json +8 -3
  64. package/dist/QueryClientProvider-DQv4Y3Qu.js +0 -707
  65. package/dist/chunk-IR6S3I6Y-BvQXS3A3.js +0 -3908
  66. package/dist/components/ModuleBase.d.ts +0 -11
  67. package/dist/fetches-DUCQo_6B.js +0 -477
  68. package/dist/hooks/useCustom.d.ts +0 -6
  69. package/dist/hooks/useNavigate.d.ts +0 -5
  70. package/dist/hooks/useNavigate.js +0 -27
  71. package/dist/hooks/useStores.d.ts +0 -29
  72. package/dist/main.d.ts +0 -9
  73. package/dist/types/ModuleApi.d.ts +0 -80
  74. /package/dist/{hooks → lib/hooks}/useSignalRMessages.d.ts +0 -0
  75. /package/dist/{provider → lib/provider}/SignalR/SignalRProvider.d.ts +0 -0
  76. /package/dist/{provider → lib/provider}/SignalR/signalR.d.ts +0 -0
  77. /package/dist/{stores → lib/stores}/BasePropsStore.d.ts +0 -0
  78. /package/dist/{types → lib/types}/AppInsights.d.ts +0 -0
  79. /package/dist/{types → lib/types}/CommonOptions.d.ts +0 -0
  80. /package/dist/{types → lib/types}/SystemMessage.d.ts +0 -0
@@ -0,0 +1,55 @@
1
+ import { REQUIRED_PROPS as m } from "../constants.js";
2
+ import { useBasePropsStore as u } from "../stores/BasePropsStore.js";
3
+ const g = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, c = (r) => {
4
+ if (typeof r != "string")
5
+ throw new TypeError("Invalid argument expected string");
6
+ const e = r.match(g);
7
+ if (!e)
8
+ throw new Error(`Invalid argument not valid semver ('${r}' received)`);
9
+ return e.shift(), e;
10
+ }, f = (r) => r === "*" || r === "x" || r === "X", l = (r) => {
11
+ const e = parseInt(r, 10);
12
+ return isNaN(e) ? r : e;
13
+ }, h = (r, e) => typeof r != typeof e ? [String(r), String(e)] : [r, e], E = (r, e) => {
14
+ if (f(r) || f(e))
15
+ return 0;
16
+ const [n, t] = h(l(r), l(e));
17
+ return n > t ? 1 : n < t ? -1 : 0;
18
+ }, p = (r, e) => {
19
+ for (let n = 0; n < Math.max(r.length, e.length); n++) {
20
+ const t = E(r[n] || "0", e[n] || "0");
21
+ if (t !== 0)
22
+ return t;
23
+ }
24
+ return 0;
25
+ }, y = (r, e) => {
26
+ const n = c(r), t = c(e), o = n.pop(), i = t.pop(), s = p(n, t);
27
+ return s !== 0 ? s : o && i ? p(o.split("."), i.split(".")) : o || i ? o ? -1 : 1 : 0;
28
+ }, d = "0.0.13075", w = (r) => m.every((e) => a(e, r)), a = (r, e) => {
29
+ if (!e[r]) {
30
+ if (e.throwError)
31
+ return e.throwError(`Missing required prop: ${r}`, 404), !1;
32
+ throw new Error(`Missing required prop: ${r}`);
33
+ }
34
+ return !0;
35
+ }, P = () => {
36
+ const r = window.__env__;
37
+ if (r && r.COMMON_API && r.MODULE_AUTH_API && r.API_PREFIX && r.ENVIRONMENT)
38
+ return r;
39
+ }, S = (r) => {
40
+ if (!r?.REQ_VERSION) return null;
41
+ const e = r.REQ_VERSION;
42
+ return y(d, e) < 0 ? `ModuleBase version ${d} is probably not compatible with the current HortiView version ${e}. Please update the modulebase to be at least ${e}` : null;
43
+ }, _ = (r) => typeof r == "string" || typeof r == "boolean" || typeof r == "number" ? r : typeof r == "object" && "value" in r ? r.value : typeof r == "object" && "items" in r ? r.items : (Array.isArray(r), r), M = (r) => r, R = (r) => {
44
+ const e = u.getState().organizationId, n = u.getState().moduleId;
45
+ return [...r, e, n];
46
+ };
47
+ export {
48
+ w as arePropsValid,
49
+ M as checkConfig,
50
+ a as checkIfPropExists,
51
+ S as checkVersion,
52
+ P as getEnvironmentVariables,
53
+ R as getModuleQueryKey,
54
+ _ as universalSelector
55
+ };
@@ -0,0 +1,9 @@
1
+ function u(n, o) {
2
+ return typeof n == "function" ? n(...o) : !!n;
3
+ }
4
+ function f() {
5
+ }
6
+ export {
7
+ f as n,
8
+ u as s
9
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hortiview/modulebase",
3
3
  "description": "This is a base module for hortiview",
4
- "version": "0.0.1",
4
+ "version": "0.0.17-beta",
5
5
  "type": "module",
6
6
  "author": "Falk Menge <falk.menge.ext@bayer.com>",
7
7
  "contributors": [
@@ -9,7 +9,7 @@
9
9
  ],
10
10
  "license": "GPL-3.0",
11
11
  "main": "dist/main.js",
12
- "types": "dist/main.d.ts",
12
+ "types": "dist/lib/main.d.ts",
13
13
  "files": [
14
14
  "dist"
15
15
  ],
@@ -23,8 +23,13 @@
23
23
  "preview": "vite preview"
24
24
  },
25
25
  "dependencies": {
26
+ "@hortiview/default-components": "^1.2.1",
27
+ "@hortiview/shared-components": "^2.0.0",
26
28
  "@microsoft/signalr": "^8.0.7",
27
- "@tanstack/react-query": "^5.66.0",
29
+ "@tanstack/query-async-storage-persister": "^5.85.5",
30
+ "@tanstack/react-query": "^5.67.3",
31
+ "@tanstack/react-query-persist-client": "^5.85.5",
32
+ "compare-versions": "^6.1.1",
28
33
  "lodash": "^4.17.21",
29
34
  "odata-query": "^7.0.9",
30
35
  "react": "^18.3.1",