@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.
@@ -1,4 +1,4 @@
1
- import { u as i } from "../useQuery-CwwWze9O.js";
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-3rykrmeD.js";
2
- import "../components/ModuleBase.js";
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 O = ({
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
- O as useCustomMutation
21
+ b as useCustomMutation
21
22
  };
@@ -1,4 +1,4 @@
1
- import { u as f } from "../useQuery-CwwWze9O.js";
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";
@@ -1,4 +1,4 @@
1
- import { u as m } from "../useQuery-CwwWze9O.js";
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";
@@ -1,4 +1,4 @@
1
- import { u as n } from "../useMutation-3rykrmeD.js";
1
+ import { u as n } from "../useMutation-Num57Ulc.js";
2
2
  import { useBasePropsStore as r } from "../stores/BasePropsStore.js";
3
3
  const a = ({
4
4
  authenticationKey: i,
@@ -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('../types/ServiceBus').AlertServiceBusMessage) => Promise<unknown>;
12
+ riseNotification?: (message: import('../main').AlertServiceBusMessage) => Promise<unknown>;
13
13
  navigateInHortiview?: (path: string) => void;
14
14
  addBreadcrumbTranslation?: (translation: {
15
15
  key: string;
@@ -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 { useCustomMutation } from './hooks/useCustomMutation';
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 { useBreadcrumbTranslation as r } from "./hooks/useBreadcrumbTranslation.js";
3
- import { useSignalRMessages as u } from "./hooks/useSignalRMessages.js";
4
- import { useNavigate as n } from "./module-router.js";
5
- import { useBaseProps as S, useConfig as R } from "./hooks/useStores.js";
6
- import { useCustom as E } from "./hooks/useCustom.js";
7
- import { useEntity as N } from "./hooks/useEntity.js";
8
- import { useOption as A } from "./hooks/useOption.js";
9
- import { useCustomMutation as d } from "./hooks/useCustomMutation.js";
10
- import { useNotification as h, useServiceBus as U } from "./hooks/useServiceBus.js";
11
- import { mutateOnCustomApi as C } from "./utils/fetches.js";
12
- import { A as v, B as f, F as P, H as y, I as L, a as k, b as D, L as H, c as M, M as B, d as O, N as b, e as T, f as w, O as I, P as V, R as q, g as z, h as G, i as K, S as W, j, k as J, l as Q, m as X, D as Y, n as Z, E as $, o as aa, p as ea, q as sa, r as ta, s as ra, t as oa, u as ua, v as ia, V as na, w as ca, x as Sa, y as Ra, z as ma, C as Ea, G as Fa, J as Na, K as la, Q as Aa, T as _a, U as da, W as pa, X as ha, Y as Ua, Z as xa, _ as Ca, $ as ga, a0 as va, a1 as fa, a2 as Pa, a3 as ya, a4 as La, a5 as ka, a6 as Da, a7 as Ha, a8 as Ma, a9 as Ba, aa as Oa, ab as ba, ac as Ta, ad as wa, ae as Ia, af as Va, ag as qa, ah as za, ai as Ga, aj as Ka, ak as Wa, al as ja, am as Ja, an as Qa, ao as Xa, ap as Ya, aq as Za, ar as $a, as as ae, at as ee, au as se, av as te, aw as re, ax as oe, ay as ue, az as ie, aA as ne, aB as ce, aC as Se, aD as Re, aE as me, aF as Ee, aG as Fe, aH as Ne, aI as le, aJ as Ae, aK as _e, aL as de, aM as pe, aN as he, aO as Ue, aP as xe, aQ as Ce, aR as ge, aS as ve, aT as fe } from "./chunk-IR6S3I6Y-BmDdD3SP.js";
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
- v as Await,
15
- f as BrowserRouter,
16
- P as Form,
17
- y as HashRouter,
18
- L as IDLE_BLOCKER,
19
- k as IDLE_FETCHER,
20
- D as IDLE_NAVIGATION,
21
- H as Link,
22
- M as Links,
23
- B as MemoryRouter,
24
- O as Meta,
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
- b as NavLink,
27
- T as Navigate,
28
- w as NavigationType,
29
- I as Outlet,
30
- V as PrefetchPageLinks,
31
- q as Route,
32
- z as Router,
33
- G as RouterProvider,
34
- K as Routes,
35
- W as Scripts,
36
- j as ScrollRestoration,
37
- J as ServerRouter,
38
- Q as StaticRouter,
39
- X as StaticRouterProvider,
40
- Y as UNSAFE_DataRouterContext,
41
- Z as UNSAFE_DataRouterStateContext,
42
- $ as UNSAFE_ErrorResponseImpl,
43
- aa as UNSAFE_FetchersContext,
44
- ea as UNSAFE_FrameworkContext,
45
- sa as UNSAFE_LocationContext,
46
- ta as UNSAFE_NavigationContext,
47
- ra as UNSAFE_RemixErrorBoundary,
48
- oa as UNSAFE_RouteContext,
49
- ua as UNSAFE_ServerMode,
50
- ia as UNSAFE_SingleFetchRedirectSymbol,
51
- na as UNSAFE_ViewTransitionContext,
52
- ca as UNSAFE_createBrowserHistory,
53
- Sa as UNSAFE_createClientRoutes,
54
- Ra as UNSAFE_createClientRoutesWithHMRRevalidationOptOut,
55
- ma as UNSAFE_createRouter,
56
- Ea as UNSAFE_decodeViaTurboStream,
57
- Fa as UNSAFE_deserializeErrors,
58
- Na as UNSAFE_getPatchRoutesOnNavigationFunction,
59
- la as UNSAFE_getSingleFetchDataStrategy,
60
- Aa as UNSAFE_invariant,
61
- _a as UNSAFE_mapRouteProperties,
62
- da as UNSAFE_shouldHydrateRouteLoader,
63
- pa as UNSAFE_useFogOFWarDiscovery,
64
- ha as UNSAFE_useScrollRestoration,
65
- Ua as createBrowserRouter,
66
- xa as createCookie,
67
- Ca as createCookieSessionStorage,
68
- ga as createHashRouter,
69
- va as createMemoryRouter,
70
- fa as createMemorySessionStorage,
71
- Pa as createPath,
72
- ya as createRequestHandler,
73
- La as createRoutesFromChildren,
74
- ka as createRoutesFromElements,
75
- Da as createRoutesStub,
76
- Ha as createSearchParams,
77
- Ma as createSession,
78
- Ba as createSessionStorage,
79
- Oa as createStaticHandler,
80
- ba as createStaticRouter,
81
- Ta as data,
82
- wa as generatePath,
83
- Ia as isCookie,
84
- Va as isRouteErrorResponse,
85
- qa as isSession,
86
- za as matchPath,
87
- Ga as matchRoutes,
88
- C as mutateOnCustomApi,
89
- Ka as parsePath,
90
- Wa as redirect,
91
- ja as redirectDocument,
92
- Ja as renderMatches,
93
- Qa as replace,
94
- Xa as resolvePath,
95
- Ya as unstable_HistoryRouter,
96
- Za as unstable_setDevServerHooks,
97
- $a as unstable_usePrompt,
98
- ae as useActionData,
99
- ee as useAsyncError,
100
- se as useAsyncValue,
101
- S as useBaseProps,
102
- te as useBeforeUnload,
103
- re as useBlocker,
104
- r as useBreadcrumbTranslation,
105
- R as useConfig,
106
- E as useCustom,
107
- d as useCustomMutation,
108
- N as useEntity,
109
- oe as useFetcher,
110
- ue as useFetchers,
111
- ie as useFormAction,
112
- ne as useHref,
113
- ce as useInRouterContext,
114
- Se as useLinkClickHandler,
115
- Re as useLoaderData,
116
- me as useLocation,
117
- Ee as useMatch,
118
- Fe as useMatches,
119
- n as useNavigate,
120
- Ne as useNavigation,
121
- le as useNavigationType,
122
- h as useNotification,
123
- A as useOption,
124
- Ae as useOutlet,
125
- _e as useOutletContext,
126
- de as useParams,
127
- pe as useResolvedPath,
128
- he as useRevalidator,
129
- Ue as useRouteError,
130
- xe as useRouteLoaderData,
131
- Ce as useRoutes,
132
- ge as useSearchParams,
133
- U as useServiceBus,
134
- u as useSignalRMessages,
135
- ve as useSubmit,
136
- fe as useViewTransitionState
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 o, c as a, n as r } from "./QueryClientProvider-Q_mWQTzQ.js";
1
+ import { R as o, c as a, n as r } from "./QueryClientProvider-VtJdNkDw.js";
2
2
  var d = class extends o {
3
3
  #e;
4
4
  #t;
@@ -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-Q_mWQTzQ.js";
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-X73nm7Df.js";
3
- import { S as d, f as p, h, n as a, u as b } from "./QueryClientProvider-Q_mWQTzQ.js";
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, x as U, b as f, f as w, q as O, a as H, y as Q, z as M, t as V, o as z, r as k, n as A, u as W } from "./QueryClientProvider-Q_mWQTzQ.js";
2
- import { f as $ } from "./query-CRIVoEP7.js";
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), q(this.#e, this.options) ? this.#u() : this.updateResult(), this.#R());
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 || !M(e))
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 || !M(this.#n) || this.#n === 0) && (this.#h = setInterval(() => {
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 && q(e, t), m = h && L(e, s, t, r);
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 = k(a?.data, l, t), this.#l = l, this.#r = null;
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 = k(
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 q(e, t) {
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, j = (e, t, s) => t.fetchOptimistic(e).catch(() => {
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 j(i, o, u);
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
- j(i, o, u)
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
@@ -1,8 +1,8 @@
1
- import { REQUIRED_PROPS as p } from "../constants.js";
2
- const l = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, u = (r) => {
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(l);
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
- }, a = (r, e) => {
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 = a(t, n);
26
- return s !== 0 ? s : i && o ? a(i.split("."), o.split(".")) : i || o ? i ? -1 : 1 : 0;
27
- }, f = "0.0.13318", v = (r) => p.every((e) => I(e, r)), I = (r, e) => {
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
- }, w = () => {
34
+ }, I = () => {
35
35
  const r = window.__env__;
36
- if (r && (r.API_PREFIX = "/api/v8.0", !!r.COMMON_API && r.MODULE_AUTH_API && r.API_PREFIX && r.ENVIRONMENT))
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(f, e) < 0 ? `ModuleBase version ${f} is probably not compatible with the current HortiView version ${e}. Please update the modulebase to be at least ${e}` : null;
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
- I as checkIfPropExists,
45
+ g as checkIfPropExists,
46
46
  P as checkVersion,
47
- w as getEnvironmentVariables
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.13318",
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",