@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.
- package/README.md +8 -8
- package/dist/ModuleCore-YCIFN_02.js +14973 -0
- package/dist/QueryClientProvider-Beog9TR7.js +437 -0
- package/dist/{_baseGet-Bh5zJ_C8.js → _baseGet-C6jMXSsQ.js} +448 -448
- package/dist/api-s6E2GJtu.js +458 -0
- package/dist/assets/ModuleCore.css +1 -0
- package/dist/chunk-QMGIS6GS-C4bgXQXY.js +9203 -0
- package/dist/components/ModuleBase.js +20 -681
- package/dist/components/ModuleCore.js +10 -0
- package/dist/hooks/useBreadcrumbTranslation.js +16 -13
- package/dist/hooks/useCustom.js +15 -15
- package/dist/hooks/useCustomMutation.js +23 -0
- package/dist/hooks/useEntity.js +53 -54
- package/dist/hooks/useOffline.js +45 -0
- package/dist/hooks/useOption.js +19 -17
- package/dist/hooks/useServiceBus.js +25 -0
- package/dist/hooks/useStores.js +11 -841
- package/dist/isRestoring-CLuxJVSA.js +281 -0
- package/dist/lib/components/ModuleBase.d.ts +36 -0
- package/dist/lib/components/ModuleCore.d.ts +32 -0
- package/dist/{constants.d.ts → lib/constants.d.ts} +1 -1
- package/dist/{hooks → lib/hooks}/useBreadcrumbTranslation.d.ts +1 -1
- package/dist/lib/hooks/useCustom.d.ts +8 -0
- package/dist/lib/hooks/useCustomMutation.d.ts +9 -0
- package/dist/{hooks → lib/hooks}/useEntity.d.ts +6 -30
- package/dist/lib/hooks/useOffline.d.ts +15 -0
- package/dist/{hooks → lib/hooks}/useOption.d.ts +1 -1
- package/dist/lib/hooks/useServiceBus.d.ts +19 -0
- package/dist/lib/hooks/useStores.d.ts +38 -0
- package/dist/lib/main.d.ts +27 -0
- package/dist/lib/module-router.d.ts +7 -0
- package/dist/{stores → lib/stores}/EnvironmentStore.d.ts +1 -1
- package/dist/lib/types/ActionStorage.d.ts +16 -0
- package/dist/{types → lib/types}/BaseProps.d.ts +14 -2
- package/dist/{types → lib/types}/Deprecated.d.ts +7 -1
- package/dist/lib/types/Entities.d.ts +22 -0
- package/dist/{types → lib/types}/Environment.d.ts +3 -2
- package/dist/lib/types/EnvironmentVariable.d.ts +6 -0
- package/dist/lib/types/ModuleApi.d.ts +163 -0
- package/dist/{types → lib/types}/Requests.d.ts +6 -11
- package/dist/lib/types/ServiceBus.d.ts +17 -0
- package/dist/{utils/fetches.d.ts → lib/utils/api.d.ts} +2 -8
- package/dist/lib/utils/baseFetches.d.ts +19 -0
- package/dist/lib/utils/fetches.d.ts +43 -0
- package/dist/lib/utils/helper.d.ts +29 -0
- package/dist/main.js +224 -17
- package/dist/module-router.js +137 -0
- package/dist/mutation-DSKlaYzY.js +192 -0
- package/dist/omit-C9Qe80rl.js +835 -0
- package/dist/stores/EnvironmentStore.js +9 -3
- package/dist/types/ActionStorage.js +4 -0
- package/dist/types/Entities.js +25 -0
- package/dist/types/EnvironmentVariable.js +1 -0
- package/dist/types/Requests.js +1 -4
- package/dist/types/ServiceBus.js +1 -0
- package/dist/useMutation-zu8uxBak.js +97 -0
- package/dist/{useQuery-znAyMQW1.js → useQuery-Bj9k9zik.js} +106 -108
- package/dist/utils/api.js +9 -0
- package/dist/utils/baseFetches.js +19 -0
- package/dist/utils/fetches.js +20 -14
- package/dist/utils/helper.js +55 -0
- package/dist/utils-DxRR_XLb.js +9 -0
- package/package.json +8 -3
- package/dist/QueryClientProvider-DQv4Y3Qu.js +0 -707
- package/dist/chunk-IR6S3I6Y-BvQXS3A3.js +0 -3908
- package/dist/components/ModuleBase.d.ts +0 -11
- package/dist/fetches-DUCQo_6B.js +0 -477
- package/dist/hooks/useCustom.d.ts +0 -6
- package/dist/hooks/useNavigate.d.ts +0 -5
- package/dist/hooks/useNavigate.js +0 -27
- package/dist/hooks/useStores.d.ts +0 -29
- package/dist/main.d.ts +0 -9
- package/dist/types/ModuleApi.d.ts +0 -80
- /package/dist/{hooks → lib/hooks}/useSignalRMessages.d.ts +0 -0
- /package/dist/{provider → lib/provider}/SignalR/SignalRProvider.d.ts +0 -0
- /package/dist/{provider → lib/provider}/SignalR/signalR.d.ts +0 -0
- /package/dist/{stores → lib/stores}/BasePropsStore.d.ts +0 -0
- /package/dist/{types → lib/types}/AppInsights.d.ts +0 -0
- /package/dist/{types → lib/types}/CommonOptions.d.ts +0 -0
- /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
|
+
};
|
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.
|
|
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/
|
|
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",
|