@hortiview/modulebase 0.0.13318 → 0.0.13321
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/{QueryClientProvider-Q_mWQTzQ.js → QueryClientProvider-VtJdNkDw.js} +18 -18
- package/dist/assets/ModuleCore.css +1 -0
- package/dist/components/ModuleBase.js +17 -489
- package/dist/components/ModuleCore.js +14694 -0
- package/dist/hooks/useCustom.js +1 -1
- package/dist/hooks/useCustomMutation.js +6 -5
- package/dist/hooks/useEntity.js +1 -1
- package/dist/hooks/useOption.js +1 -1
- package/dist/hooks/useServiceBus.js +1 -1
- package/dist/lib/components/ModuleBase.d.ts +3 -0
- package/dist/lib/components/ModuleCore.d.ts +13 -0
- package/dist/lib/hooks/useStores.d.ts +1 -1
- package/dist/lib/main.d.ts +5 -2
- package/dist/main.js +135 -133
- package/dist/{mutation-X73nm7Df.js → mutation-CnKIetRs.js} +1 -1
- package/dist/{query-CRIVoEP7.js → query-CFoO2uy7.js} +1 -1
- package/dist/{useMutation-3rykrmeD.js → useMutation-Num57Ulc.js} +2 -2
- package/dist/{useQuery-CwwWze9O.js → useQuery-XBGd5Kep.js} +12 -12
- package/dist/utils/helper.js +12 -12
- package/package.json +3 -1
package/dist/hooks/useCustom.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as i } from "../useQuery-
|
|
1
|
+
import { u as i } from "../useQuery-XBGd5Kep.js";
|
|
2
2
|
import { useBasePropsStore as n } from "../stores/BasePropsStore.js";
|
|
3
3
|
import { universalSelector as p } from "../types/Requests.js";
|
|
4
4
|
import { fetchFromCustomApi as a } from "../utils/fetches.js";
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { u } from "../useMutation-
|
|
2
|
-
import "
|
|
1
|
+
import { u } from "../useMutation-Num57Ulc.js";
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
|
-
import "../stores/BasePropsStore.js";
|
|
5
4
|
import "../provider/SignalR/SignalRProvider.js";
|
|
5
|
+
import "../stores/BasePropsStore.js";
|
|
6
|
+
import "../components/ModuleCore.js";
|
|
6
7
|
import "../omit-B7MWDtHq.js";
|
|
7
8
|
import "../stores/EnvironmentStore.js";
|
|
8
9
|
import { mutateOnCustomApi as n } from "../utils/fetches.js";
|
|
9
10
|
import "./useEntity.js";
|
|
10
11
|
import "../api-D9Lmqe6S.js";
|
|
11
|
-
const
|
|
12
|
+
const b = ({
|
|
12
13
|
endpoint: t,
|
|
13
14
|
method: o,
|
|
14
15
|
token: m,
|
|
@@ -17,5 +18,5 @@ const O = ({
|
|
|
17
18
|
mutationFn: (i, p) => n(p ?? t, i, o, m, r)
|
|
18
19
|
});
|
|
19
20
|
export {
|
|
20
|
-
|
|
21
|
+
b as useCustomMutation
|
|
21
22
|
};
|
package/dist/hooks/useEntity.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as f } from "../useQuery-
|
|
1
|
+
import { u as f } from "../useQuery-XBGd5Kep.js";
|
|
2
2
|
import { useMemo as p } from "react";
|
|
3
3
|
import { useBasePropsStore as y } from "../stores/BasePropsStore.js";
|
|
4
4
|
import { universalSelector as E } from "../types/Requests.js";
|
package/dist/hooks/useOption.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as m } from "../useQuery-
|
|
1
|
+
import { u as m } from "../useQuery-XBGd5Kep.js";
|
|
2
2
|
import { g as u } from "../api-D9Lmqe6S.js";
|
|
3
3
|
import { useBasePropsStore as n } from "../stores/BasePropsStore.js";
|
|
4
4
|
import { universalSelector as s } from "../types/Requests.js";
|
|
@@ -2,6 +2,9 @@ import { QueryClient } from '@tanstack/react-query';
|
|
|
2
2
|
import { RouteObject } from 'react-router';
|
|
3
3
|
import { BaseProps } from '../types/BaseProps';
|
|
4
4
|
import { EnvConfig } from '../types/Environment';
|
|
5
|
+
/**
|
|
6
|
+
* Main component of the module. This component is used to create a module with a router and a signalR provider.
|
|
7
|
+
*/
|
|
5
8
|
export declare const ModuleBase: ({ props, routes, env, useSignalR, queryClient, }: {
|
|
6
9
|
props: BaseProps;
|
|
7
10
|
routes: RouteObject[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { BaseProps } from '../types/BaseProps';
|
|
3
|
+
import { EnvConfig } from '../types/Environment';
|
|
4
|
+
export declare const ModuleQueryClient: QueryClient;
|
|
5
|
+
/**
|
|
6
|
+
* Minimal component to create a module with a query client and a signalR provider (to use module api)
|
|
7
|
+
*/
|
|
8
|
+
export declare const ModuleCore: ({ props, env, queryClient, children, }: {
|
|
9
|
+
props: BaseProps;
|
|
10
|
+
env?: EnvConfig;
|
|
11
|
+
queryClient?: QueryClient;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,7 +9,7 @@ export declare const useBaseProps: () => Pick<import('../types/Deprecated').Depr
|
|
|
9
9
|
currentLanguageId?: string;
|
|
10
10
|
alertRules?: string;
|
|
11
11
|
commonOptions?: import('../types/CommonOptions').AllDropdownsData<import('../types/CommonOptions').CommonOption>["items"];
|
|
12
|
-
riseNotification?: (message: import('../
|
|
12
|
+
riseNotification?: (message: import('../main').AlertServiceBusMessage) => Promise<unknown>;
|
|
13
13
|
navigateInHortiview?: (path: string) => void;
|
|
14
14
|
addBreadcrumbTranslation?: (translation: {
|
|
15
15
|
key: string;
|
package/dist/lib/main.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
export { ModuleBase } from './components/ModuleBase';
|
|
2
|
+
export { ModuleCore } from './components/ModuleCore';
|
|
2
3
|
export type { BaseProps } from './types/BaseProps';
|
|
4
|
+
export type * from './types/ModuleApi';
|
|
5
|
+
export type { AlertServiceBusMessage } from './types/ServiceBus';
|
|
3
6
|
export { useBreadcrumbTranslation } from './hooks/useBreadcrumbTranslation';
|
|
4
7
|
export { useSignalRMessages } from './hooks/useSignalRMessages';
|
|
5
8
|
export * from './module-router';
|
|
6
9
|
export { useNavigate } from './module-router';
|
|
7
10
|
export { useBaseProps, useConfig } from './hooks/useStores';
|
|
8
11
|
export { useCustom } from './hooks/useCustom';
|
|
12
|
+
export { useCustomMutation } from './hooks/useCustomMutation';
|
|
9
13
|
export { useEntity } from './hooks/useEntity';
|
|
10
14
|
export { useOption } from './hooks/useOption';
|
|
11
|
-
export {
|
|
12
|
-
export { useServiceBus, useNotification } from './hooks/useServiceBus';
|
|
15
|
+
export { useNotification, useServiceBus } from './hooks/useServiceBus';
|
|
13
16
|
export { mutateOnCustomApi } from './utils/fetches';
|
package/dist/main.js
CHANGED
|
@@ -1,137 +1,139 @@
|
|
|
1
1
|
import { ModuleBase as s } from "./components/ModuleBase.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
2
|
+
import { ModuleCore as r } from "./components/ModuleCore.js";
|
|
3
|
+
import { useBreadcrumbTranslation as u } from "./hooks/useBreadcrumbTranslation.js";
|
|
4
|
+
import { useSignalRMessages as n } from "./hooks/useSignalRMessages.js";
|
|
5
|
+
import { useNavigate as S } from "./module-router.js";
|
|
6
|
+
import { useBaseProps as m, useConfig as E } from "./hooks/useStores.js";
|
|
7
|
+
import { useCustom as l } from "./hooks/useCustom.js";
|
|
8
|
+
import { useCustomMutation as A } from "./hooks/useCustomMutation.js";
|
|
9
|
+
import { useEntity as d } from "./hooks/useEntity.js";
|
|
10
|
+
import { useOption as h } from "./hooks/useOption.js";
|
|
11
|
+
import { useNotification as x, useServiceBus as C } from "./hooks/useServiceBus.js";
|
|
12
|
+
import { mutateOnCustomApi as v } from "./utils/fetches.js";
|
|
13
|
+
import { A as P, B as y, F as L, H as M, I as k, a as D, b as H, L as B, c as O, M as b, d as T, N as w, e as I, f as V, O as q, P as z, R as G, g as K, h as W, i as j, S as J, j as Q, k as X, l as Y, m as Z, D as $, n as aa, E as ea, o as sa, p as ta, q as ra, r as oa, s as ua, t as ia, u as na, v as ca, V as Sa, w as Ra, x as ma, y as Ea, z as Fa, C as la, G as Na, J as Aa, K as _a, Q as da, T as pa, U as ha, W as Ua, X as xa, Y as Ca, Z as ga, _ as va, $ as fa, a0 as Pa, a1 as ya, a2 as La, a3 as Ma, a4 as ka, a5 as Da, a6 as Ha, a7 as Ba, a8 as Oa, a9 as ba, aa as Ta, ab as wa, ac as Ia, ad as Va, ae as qa, af as za, ag as Ga, ah as Ka, ai as Wa, aj as ja, ak as Ja, al as Qa, am as Xa, an as Ya, ao as Za, ap as $a, aq as ae, ar as ee, as as se, at as te, au as re, av as oe, aw as ue, ax as ie, ay as ne, az as ce, aA as Se, aB as Re, aC as me, aD as Ee, aE as Fe, aF as le, aG as Ne, aH as Ae, aI as _e, aJ as de, aK as pe, aL as he, aM as Ue, aN as xe, aO as Ce, aP as ge, aQ as ve, aR as fe, aS as Pe, aT as ye } from "./chunk-IR6S3I6Y-BmDdD3SP.js";
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
P as Await,
|
|
16
|
+
y as BrowserRouter,
|
|
17
|
+
L as Form,
|
|
18
|
+
M as HashRouter,
|
|
19
|
+
k as IDLE_BLOCKER,
|
|
20
|
+
D as IDLE_FETCHER,
|
|
21
|
+
H as IDLE_NAVIGATION,
|
|
22
|
+
B as Link,
|
|
23
|
+
O as Links,
|
|
24
|
+
b as MemoryRouter,
|
|
25
|
+
T as Meta,
|
|
25
26
|
s as ModuleBase,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
Na as
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
ka as
|
|
75
|
-
Da as
|
|
76
|
-
Ha as
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
E as
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
27
|
+
r as ModuleCore,
|
|
28
|
+
w as NavLink,
|
|
29
|
+
I as Navigate,
|
|
30
|
+
V as NavigationType,
|
|
31
|
+
q as Outlet,
|
|
32
|
+
z as PrefetchPageLinks,
|
|
33
|
+
G as Route,
|
|
34
|
+
K as Router,
|
|
35
|
+
W as RouterProvider,
|
|
36
|
+
j as Routes,
|
|
37
|
+
J as Scripts,
|
|
38
|
+
Q as ScrollRestoration,
|
|
39
|
+
X as ServerRouter,
|
|
40
|
+
Y as StaticRouter,
|
|
41
|
+
Z as StaticRouterProvider,
|
|
42
|
+
$ as UNSAFE_DataRouterContext,
|
|
43
|
+
aa as UNSAFE_DataRouterStateContext,
|
|
44
|
+
ea as UNSAFE_ErrorResponseImpl,
|
|
45
|
+
sa as UNSAFE_FetchersContext,
|
|
46
|
+
ta as UNSAFE_FrameworkContext,
|
|
47
|
+
ra as UNSAFE_LocationContext,
|
|
48
|
+
oa as UNSAFE_NavigationContext,
|
|
49
|
+
ua as UNSAFE_RemixErrorBoundary,
|
|
50
|
+
ia as UNSAFE_RouteContext,
|
|
51
|
+
na as UNSAFE_ServerMode,
|
|
52
|
+
ca as UNSAFE_SingleFetchRedirectSymbol,
|
|
53
|
+
Sa as UNSAFE_ViewTransitionContext,
|
|
54
|
+
Ra as UNSAFE_createBrowserHistory,
|
|
55
|
+
ma as UNSAFE_createClientRoutes,
|
|
56
|
+
Ea as UNSAFE_createClientRoutesWithHMRRevalidationOptOut,
|
|
57
|
+
Fa as UNSAFE_createRouter,
|
|
58
|
+
la as UNSAFE_decodeViaTurboStream,
|
|
59
|
+
Na as UNSAFE_deserializeErrors,
|
|
60
|
+
Aa as UNSAFE_getPatchRoutesOnNavigationFunction,
|
|
61
|
+
_a as UNSAFE_getSingleFetchDataStrategy,
|
|
62
|
+
da as UNSAFE_invariant,
|
|
63
|
+
pa as UNSAFE_mapRouteProperties,
|
|
64
|
+
ha as UNSAFE_shouldHydrateRouteLoader,
|
|
65
|
+
Ua as UNSAFE_useFogOFWarDiscovery,
|
|
66
|
+
xa as UNSAFE_useScrollRestoration,
|
|
67
|
+
Ca as createBrowserRouter,
|
|
68
|
+
ga as createCookie,
|
|
69
|
+
va as createCookieSessionStorage,
|
|
70
|
+
fa as createHashRouter,
|
|
71
|
+
Pa as createMemoryRouter,
|
|
72
|
+
ya as createMemorySessionStorage,
|
|
73
|
+
La as createPath,
|
|
74
|
+
Ma as createRequestHandler,
|
|
75
|
+
ka as createRoutesFromChildren,
|
|
76
|
+
Da as createRoutesFromElements,
|
|
77
|
+
Ha as createRoutesStub,
|
|
78
|
+
Ba as createSearchParams,
|
|
79
|
+
Oa as createSession,
|
|
80
|
+
ba as createSessionStorage,
|
|
81
|
+
Ta as createStaticHandler,
|
|
82
|
+
wa as createStaticRouter,
|
|
83
|
+
Ia as data,
|
|
84
|
+
Va as generatePath,
|
|
85
|
+
qa as isCookie,
|
|
86
|
+
za as isRouteErrorResponse,
|
|
87
|
+
Ga as isSession,
|
|
88
|
+
Ka as matchPath,
|
|
89
|
+
Wa as matchRoutes,
|
|
90
|
+
v as mutateOnCustomApi,
|
|
91
|
+
ja as parsePath,
|
|
92
|
+
Ja as redirect,
|
|
93
|
+
Qa as redirectDocument,
|
|
94
|
+
Xa as renderMatches,
|
|
95
|
+
Ya as replace,
|
|
96
|
+
Za as resolvePath,
|
|
97
|
+
$a as unstable_HistoryRouter,
|
|
98
|
+
ae as unstable_setDevServerHooks,
|
|
99
|
+
ee as unstable_usePrompt,
|
|
100
|
+
se as useActionData,
|
|
101
|
+
te as useAsyncError,
|
|
102
|
+
re as useAsyncValue,
|
|
103
|
+
m as useBaseProps,
|
|
104
|
+
oe as useBeforeUnload,
|
|
105
|
+
ue as useBlocker,
|
|
106
|
+
u as useBreadcrumbTranslation,
|
|
107
|
+
E as useConfig,
|
|
108
|
+
l as useCustom,
|
|
109
|
+
A as useCustomMutation,
|
|
110
|
+
d as useEntity,
|
|
111
|
+
ie as useFetcher,
|
|
112
|
+
ne as useFetchers,
|
|
113
|
+
ce as useFormAction,
|
|
114
|
+
Se as useHref,
|
|
115
|
+
Re as useInRouterContext,
|
|
116
|
+
me as useLinkClickHandler,
|
|
117
|
+
Ee as useLoaderData,
|
|
118
|
+
Fe as useLocation,
|
|
119
|
+
le as useMatch,
|
|
120
|
+
Ne as useMatches,
|
|
121
|
+
S as useNavigate,
|
|
122
|
+
Ae as useNavigation,
|
|
123
|
+
_e as useNavigationType,
|
|
124
|
+
x as useNotification,
|
|
125
|
+
h as useOption,
|
|
126
|
+
de as useOutlet,
|
|
127
|
+
pe as useOutletContext,
|
|
128
|
+
he as useParams,
|
|
129
|
+
Ue as useResolvedPath,
|
|
130
|
+
xe as useRevalidator,
|
|
131
|
+
Ce as useRouteError,
|
|
132
|
+
ge as useRouteLoaderData,
|
|
133
|
+
ve as useRoutes,
|
|
134
|
+
fe as useSearchParams,
|
|
135
|
+
C as useServiceBus,
|
|
136
|
+
n as useSignalRMessages,
|
|
137
|
+
Pe as useSubmit,
|
|
138
|
+
ye as useViewTransitionState
|
|
137
139
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as d, r as l, a as u, b as f, s as p, t as y, c as v, n as b, e as m, i as h, d as S } from "./QueryClientProvider-
|
|
1
|
+
import { R as d, r as l, a as u, b as f, s as p, t as y, c as v, n as b, e as m, i as h, d as S } from "./QueryClientProvider-VtJdNkDw.js";
|
|
2
2
|
var q = class extends d {
|
|
3
3
|
#a;
|
|
4
4
|
#n;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as n from "react";
|
|
2
|
-
import { g as l } from "./mutation-
|
|
3
|
-
import { S as d, f as p, h, n as a, u as b } from "./QueryClientProvider-
|
|
2
|
+
import { g as l } from "./mutation-CnKIetRs.js";
|
|
3
|
+
import { S as d, f as p, h, n as a, u as b } from "./QueryClientProvider-VtJdNkDw.js";
|
|
4
4
|
import { n as m, s as f } from "./utils-DxRR_XLb.js";
|
|
5
5
|
var v = class extends d {
|
|
6
6
|
#e;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as N,
|
|
2
|
-
import { f as $ } from "./query-
|
|
1
|
+
import { S as N, p as U, b as f, f as w, g as O, a as H, j as Q, k, t as V, l as z, r as M, n as A, u as W } from "./QueryClientProvider-VtJdNkDw.js";
|
|
2
|
+
import { f as $ } from "./query-CFoO2uy7.js";
|
|
3
3
|
import * as p from "react";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import { s as K, n as _ } from "./utils-DxRR_XLb.js";
|
|
@@ -30,7 +30,7 @@ var G = class extends N {
|
|
|
30
30
|
this.refetch = this.refetch.bind(this);
|
|
31
31
|
}
|
|
32
32
|
onSubscribe() {
|
|
33
|
-
this.listeners.size === 1 && (this.#e.addObserver(this),
|
|
33
|
+
this.listeners.size === 1 && (this.#e.addObserver(this), j(this.#e, this.options) ? this.#u() : this.updateResult(), this.#R());
|
|
34
34
|
}
|
|
35
35
|
onUnsubscribe() {
|
|
36
36
|
this.hasListeners() || this.destroy();
|
|
@@ -125,7 +125,7 @@ var G = class extends N {
|
|
|
125
125
|
this.options.staleTime,
|
|
126
126
|
this.#e
|
|
127
127
|
);
|
|
128
|
-
if (Q || this.#t.isStale || !
|
|
128
|
+
if (Q || this.#t.isStale || !k(e))
|
|
129
129
|
return;
|
|
130
130
|
const s = V(this.#t.dataUpdatedAt, e) + 1;
|
|
131
131
|
this.#o = setTimeout(() => {
|
|
@@ -136,7 +136,7 @@ var G = class extends N {
|
|
|
136
136
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#e) : this.options.refetchInterval) ?? !1;
|
|
137
137
|
}
|
|
138
138
|
#g(e) {
|
|
139
|
-
this.#O(), this.#n = e, !(Q || f(this.options.enabled, this.#e) === !1 || !
|
|
139
|
+
this.#O(), this.#n = e, !(Q || f(this.options.enabled, this.#e) === !1 || !k(this.#n) || this.#n === 0) && (this.#h = setInterval(() => {
|
|
140
140
|
(this.options.refetchIntervalInBackground || z.isFocused()) && this.#u();
|
|
141
141
|
}, this.#n));
|
|
142
142
|
}
|
|
@@ -153,7 +153,7 @@ var G = class extends N {
|
|
|
153
153
|
const s = this.#e, r = this.options, a = this.#t, u = this.#a, i = this.#c, o = e !== s ? e.state : this.#p, { state: c } = e;
|
|
154
154
|
let n = { ...c }, R = !1, l;
|
|
155
155
|
if (t._optimisticResults) {
|
|
156
|
-
const h = this.hasListeners(), b = !h &&
|
|
156
|
+
const h = this.hasListeners(), b = !h && j(e, t), m = h && L(e, s, t, r);
|
|
157
157
|
(b || m) && (n = {
|
|
158
158
|
...n,
|
|
159
159
|
...$(c.data, e.options)
|
|
@@ -165,7 +165,7 @@ var G = class extends N {
|
|
|
165
165
|
l = this.#l;
|
|
166
166
|
else
|
|
167
167
|
try {
|
|
168
|
-
this.#y = t.select, l = t.select(n.data), l =
|
|
168
|
+
this.#y = t.select, l = t.select(n.data), l = M(a?.data, l, t), this.#l = l, this.#r = null;
|
|
169
169
|
} catch (h) {
|
|
170
170
|
this.#r = h;
|
|
171
171
|
}
|
|
@@ -184,7 +184,7 @@ var G = class extends N {
|
|
|
184
184
|
} catch (b) {
|
|
185
185
|
this.#r = b;
|
|
186
186
|
}
|
|
187
|
-
h !== void 0 && (y = "success", l =
|
|
187
|
+
h !== void 0 && (y = "success", l = M(
|
|
188
188
|
a?.data,
|
|
189
189
|
h,
|
|
190
190
|
t
|
|
@@ -284,7 +284,7 @@ var G = class extends N {
|
|
|
284
284
|
function J(e, t) {
|
|
285
285
|
return f(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function j(e, t) {
|
|
288
288
|
return J(e, t) || e.state.data !== void 0 && T(e, t, t.refetchOnMount);
|
|
289
289
|
}
|
|
290
290
|
function T(e, t, s) {
|
|
@@ -332,7 +332,7 @@ var ee = p.createContext(Z()), te = () => p.useContext(ee), se = (e, t) => {
|
|
|
332
332
|
}) => e.isError && !t.isReset() && !e.isFetching && r && (a && e.data === void 0 || K(s, [e.error, r])), ne = (e) => {
|
|
333
333
|
const t = e.staleTime;
|
|
334
334
|
e.suspense && (e.staleTime = typeof t == "function" ? (...s) => Math.max(t(...s), 1e3) : Math.max(t ?? 1e3, 1e3), typeof e.gcTime == "number" && (e.gcTime = Math.max(e.gcTime, 1e3)));
|
|
335
|
-
}, ae = (e, t) => e.isLoading && e.isFetching && !t, oe = (e, t) => e?.suspense && t.isPending,
|
|
335
|
+
}, ae = (e, t) => e.isLoading && e.isFetching && !t, oe = (e, t) => e?.suspense && t.isPending, q = (e, t, s) => t.fetchOptimistic(e).catch(() => {
|
|
336
336
|
s.clearReset();
|
|
337
337
|
});
|
|
338
338
|
function he(e, t, s) {
|
|
@@ -365,7 +365,7 @@ function he(e, t, s) {
|
|
|
365
365
|
), p.useEffect(() => {
|
|
366
366
|
o.setOptions(i, { listeners: !1 });
|
|
367
367
|
}, [i, o]), oe(i, c))
|
|
368
|
-
throw
|
|
368
|
+
throw q(i, o, u);
|
|
369
369
|
if (ie({
|
|
370
370
|
result: c,
|
|
371
371
|
errorResetBoundary: u,
|
|
@@ -379,7 +379,7 @@ function he(e, t, s) {
|
|
|
379
379
|
c
|
|
380
380
|
), i.experimental_prefetchInRender && !Q && ae(c, a) && (g ? (
|
|
381
381
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
382
|
-
|
|
382
|
+
q(i, o, u)
|
|
383
383
|
) : (
|
|
384
384
|
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
|
385
385
|
r.getQueryCache().get(i.queryHash)?.promise
|
package/dist/utils/helper.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { REQUIRED_PROPS as
|
|
2
|
-
const
|
|
1
|
+
import { REQUIRED_PROPS as l } from "../constants.js";
|
|
2
|
+
const p = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, u = (r) => {
|
|
3
3
|
if (typeof r != "string")
|
|
4
4
|
throw new TypeError("Invalid argument expected string");
|
|
5
|
-
const e = r.match(
|
|
5
|
+
const e = r.match(p);
|
|
6
6
|
if (!e)
|
|
7
7
|
throw new Error(`Invalid argument not valid semver ('${r}' received)`);
|
|
8
8
|
return e.shift(), e;
|
|
@@ -14,7 +14,7 @@ const l = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([
|
|
|
14
14
|
return 0;
|
|
15
15
|
const [t, n] = E(d(r), d(e));
|
|
16
16
|
return t > n ? 1 : t < n ? -1 : 0;
|
|
17
|
-
},
|
|
17
|
+
}, f = (r, e) => {
|
|
18
18
|
for (let t = 0; t < Math.max(r.length, e.length); t++) {
|
|
19
19
|
const n = h(r[t] || "0", e[t] || "0");
|
|
20
20
|
if (n !== 0)
|
|
@@ -22,27 +22,27 @@ const l = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([
|
|
|
22
22
|
}
|
|
23
23
|
return 0;
|
|
24
24
|
}, m = (r, e) => {
|
|
25
|
-
const t = u(r), n = u(e), i = t.pop(), o = n.pop(), s =
|
|
26
|
-
return s !== 0 ? s : i && o ?
|
|
27
|
-
},
|
|
25
|
+
const t = u(r), n = u(e), i = t.pop(), o = n.pop(), s = f(t, n);
|
|
26
|
+
return s !== 0 ? s : i && o ? f(i.split("."), o.split(".")) : i || o ? i ? -1 : 1 : 0;
|
|
27
|
+
}, a = "0.0.13321", v = (r) => l.every((e) => g(e, r)), g = (r, e) => {
|
|
28
28
|
if (!e[r]) {
|
|
29
29
|
if (e.throwError)
|
|
30
30
|
return e.throwError(`Missing required prop: ${r}`, 404), !1;
|
|
31
31
|
throw new Error(`Missing required prop: ${r}`);
|
|
32
32
|
}
|
|
33
33
|
return !0;
|
|
34
|
-
},
|
|
34
|
+
}, I = () => {
|
|
35
35
|
const r = window.__env__;
|
|
36
|
-
if (r &&
|
|
36
|
+
if (r && r.COMMON_API && r.MODULE_AUTH_API && r.API_PREFIX && r.ENVIRONMENT)
|
|
37
37
|
return r;
|
|
38
38
|
}, P = (r) => {
|
|
39
39
|
if (!r?.REQ_VERSION) return null;
|
|
40
40
|
const e = r.REQ_VERSION;
|
|
41
|
-
return m(
|
|
41
|
+
return m(a, e) < 0 ? `ModuleBase version ${a} is probably not compatible with the current HortiView version ${e}. Please update the modulebase to be at least ${e}` : null;
|
|
42
42
|
};
|
|
43
43
|
export {
|
|
44
44
|
v as arePropsValid,
|
|
45
|
-
|
|
45
|
+
g as checkIfPropExists,
|
|
46
46
|
P as checkVersion,
|
|
47
|
-
|
|
47
|
+
I as getEnvironmentVariables
|
|
48
48
|
};
|
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.13321",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Falk Menge <falk.menge.ext@bayer.com>",
|
|
7
7
|
"contributors": [
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
"preview": "vite preview"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
+
"@hortiview/default-components": "^1.2.0",
|
|
27
|
+
"@hortiview/shared-components": "^1.4.2",
|
|
26
28
|
"@microsoft/signalr": "^8.0.7",
|
|
27
29
|
"@tanstack/react-query": "^5.67.3",
|
|
28
30
|
"compare-versions": "^6.1.1",
|