@hortiview/modulebase 0.0.13321 → 0.0.13925

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,7 +1,7 @@
1
1
  import { u as i } from "../useQuery-XBGd5Kep.js";
2
2
  import { useBasePropsStore as n } from "../stores/BasePropsStore.js";
3
- import { universalSelector as p } from "../types/Requests.js";
4
- import { fetchFromCustomApi as a } from "../utils/fetches.js";
3
+ import { fetchFromCustomApi as p } from "../utils/fetches.js";
4
+ import { universalSelector as a } from "../utils/helper.js";
5
5
  const l = ({
6
6
  endpoint: e,
7
7
  queryKey: t,
@@ -12,8 +12,8 @@ const l = ({
12
12
  const s = n((r) => r.organizationId);
13
13
  return i({
14
14
  queryKey: [...t, s],
15
- queryFn: () => a(e, u),
16
- select: (r) => o ? o(r) : p(r),
15
+ queryFn: () => p(e, u),
16
+ select: (r) => o ? o(r) : a(r),
17
17
  enabled: m
18
18
  });
19
19
  };
@@ -1,8 +1,8 @@
1
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
- import { universalSelector as E } from "../types/Requests.js";
5
4
  import { getModuleDependedEntities as g, getFarmOrgEntities as R } from "../utils/fetches.js";
5
+ import { universalSelector as E } from "../utils/helper.js";
6
6
  import { useOption as M, useModuleDependency as k } from "./useOption.js";
7
7
  const D = {
8
8
  farms: "farm",
@@ -1,8 +1,8 @@
1
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
- import { universalSelector as s } from "../types/Requests.js";
5
4
  import { fetchFromCommonApi as i, fetchFromModuleApi as c } from "../utils/fetches.js";
5
+ import { universalSelector as s } from "../utils/helper.js";
6
6
  const f = (e) => {
7
7
  const r = n((o) => o.commonOptions), t = u(r, e);
8
8
  return m({
@@ -1,4 +1,4 @@
1
- export declare const useCustom: <T>({ endpoint, queryKey, token, selector, enabled }: {
1
+ export declare const useCustom: <T>({ endpoint, queryKey, token, selector, enabled, }: {
2
2
  endpoint: string;
3
3
  queryKey: (string | undefined)[];
4
4
  token?: string;
@@ -1,4 +1,4 @@
1
- export declare const useBaseProps: () => Pick<import('../types/Deprecated').DeprecatedBaseProps & {
1
+ export declare const useBaseProps: () => Pick<import('../main').DeprecatedBaseProps & {
2
2
  modulePermissionToken?: string;
3
3
  moduleId?: string;
4
4
  organizationId?: string;
@@ -8,7 +8,7 @@ export declare const useBaseProps: () => Pick<import('../types/Deprecated').Depr
8
8
  currentLanguage?: string;
9
9
  currentLanguageId?: string;
10
10
  alertRules?: string;
11
- commonOptions?: import('../types/CommonOptions').AllDropdownsData<import('../types/CommonOptions').CommonOption>["items"];
11
+ commonOptions?: import('../main').AllDropdownsData<import('../main').CommonOption>["items"];
12
12
  riseNotification?: (message: import('../main').AlertServiceBusMessage) => Promise<unknown>;
13
13
  navigateInHortiview?: (path: string) => void;
14
14
  addBreadcrumbTranslation?: (translation: {
@@ -16,15 +16,15 @@ export declare const useBaseProps: () => Pick<import('../types/Deprecated').Depr
16
16
  value: string;
17
17
  }, hide?: boolean) => void;
18
18
  showSnackbar?: (message: string, icon?: string) => void;
19
- showMessage?: (message: import('../types/SystemMessage').SystemMessage) => void;
20
- logEvent?: (event: import('../types/AppInsights').AppInsightsEvent, customProperties?: import('../types/AppInsights').AppInsightsProperties) => void;
21
- logError?: (exception: import('../types/AppInsights').AppInsightsException) => void;
19
+ showMessage?: (message: import('../main').SystemMessage) => void;
20
+ logEvent?: (event: import('../main').AppInsightsEvent, customProperties?: import('../main').AppInsightsProperties) => void;
21
+ logError?: (exception: import('../main').AppInsightsException) => void;
22
22
  throwError?: (message: string, code: number) => void;
23
23
  } & {
24
24
  setBaseProps: (props: import('../main').BaseProps) => void;
25
- }, keyof import('../types/Deprecated').DeprecatedBaseProps | "modulePermissionToken" | "moduleId" | "organizationId" | "basePath" | "currentNavigationPath" | "sourcePath" | "currentLanguage" | "currentLanguageId" | "alertRules" | "commonOptions" | "riseNotification" | "navigateInHortiview" | "addBreadcrumbTranslation" | "showSnackbar" | "showMessage" | "logEvent" | "logError" | "throwError">;
25
+ }, keyof import('../main').DeprecatedBaseProps | "modulePermissionToken" | "moduleId" | "organizationId" | "basePath" | "currentNavigationPath" | "sourcePath" | "currentLanguage" | "currentLanguageId" | "alertRules" | "commonOptions" | "riseNotification" | "navigateInHortiview" | "addBreadcrumbTranslation" | "showSnackbar" | "showMessage" | "logEvent" | "logError" | "throwError">;
26
26
  export declare const useConfig: () => Pick<{
27
- environment: import('../types/Environment').HortiViewEnvironments;
28
- setEnvironment: (environment: import('../types/Environment').HortiViewEnvironments) => void;
29
- addEnvironment: (customEnv: import('../types/Environment').CustomEnv) => void;
27
+ environment: import('../main').HortiViewEnvironments;
28
+ setEnvironment: (environment: import('../main').HortiViewEnvironments) => void;
29
+ addEnvironment: (customEnv: import('../main').CustomEnv) => void;
30
30
  }, "environment">;
@@ -1,8 +1,14 @@
1
1
  export { ModuleBase } from './components/ModuleBase';
2
2
  export { ModuleCore } from './components/ModuleCore';
3
- export type { BaseProps } from './types/BaseProps';
3
+ export type * from './types/AppInsights';
4
+ export type * from './types/BaseProps';
5
+ export type * from './types/CommonOptions';
6
+ export type * from './types/Deprecated';
7
+ export type * from './types/Environment';
4
8
  export type * from './types/ModuleApi';
5
- export type { AlertServiceBusMessage } from './types/ServiceBus';
9
+ export type * from './types/Requests';
10
+ export type * from './types/ServiceBus';
11
+ export type * from './types/SystemMessage';
6
12
  export { useBreadcrumbTranslation } from './hooks/useBreadcrumbTranslation';
7
13
  export { useSignalRMessages } from './hooks/useSignalRMessages';
8
14
  export * from './module-router';
@@ -14,3 +20,4 @@ export { useEntity } from './hooks/useEntity';
14
20
  export { useOption } from './hooks/useOption';
15
21
  export { useNotification, useServiceBus } from './hooks/useServiceBus';
16
22
  export { mutateOnCustomApi } from './utils/fetches';
23
+ export * from './utils/helper';
@@ -13,7 +13,6 @@ export type Environments = 'SDC-DEV' | 'SDC-TEST' | 'SDC-DEMO' | 'BAYER-TES' | '
13
13
  export type EnvConfig = {
14
14
  [key in Environments]?: CustomEnv;
15
15
  };
16
- export declare const checkConfig: <T extends EnvConfig>(config: T & Record<Exclude<keyof T, Environments>, never>) => T;
17
16
  export type CustomEnv = {
18
17
  [key: string]: string;
19
18
  };
@@ -1,17 +1,17 @@
1
1
  import { Expand, Filter, Select } from 'odata-query';
2
2
  export type RequestConfig = {
3
- redirect: "follow";
4
- credentials: "omit";
3
+ redirect: 'follow';
4
+ credentials: 'omit';
5
5
  headers: RequestHeader;
6
6
  method: httpMethod;
7
7
  body?: string | FormData;
8
8
  };
9
9
  export type RequestHeader = Headers & {
10
- "Content-Type"?: "application/json";
10
+ 'Content-Type'?: 'application/json';
11
11
  orgId?: string;
12
12
  Authorization?: string;
13
13
  Permission?: string;
14
- "Api-Version"?: "1.0" | "2.0";
14
+ 'Api-Version'?: '1.0' | '2.0';
15
15
  languageId?: string;
16
16
  };
17
17
  export type InternalError = {
@@ -41,10 +41,4 @@ export type BaseResponse<T> = T | T[] | {
41
41
  } | {
42
42
  items: T | T[];
43
43
  };
44
- /**
45
- * a universal selector that can be used for all fetches
46
- * @param data - the data to select from
47
- * @returns
48
- */
49
- export declare const universalSelector: <T>(data: BaseResponse<T>) => T | T[];
50
44
  export type httpMethod = 'POST' | 'PATCH' | 'DELETE' | 'PUT' | 'GET';
@@ -1,35 +1,35 @@
1
1
  import { httpMethod } from '../types/Requests';
2
- export declare const mutateOnCustomApi: <T, R>(endpoint: string, data: T, method?: Omit<httpMethod, "GET">, token?: string, headers?: Headers) => Promise<import('../types/Requests').BaseResponse<R>>;
2
+ export declare const mutateOnCustomApi: <T, R>(endpoint: string, data: T, method?: Omit<httpMethod, "GET">, token?: string, headers?: Headers) => Promise<import('../main').BaseResponse<R>>;
3
3
  /**
4
4
  * a fetch function to get a certain farmorganization entity from the moduleApi (will be used in useEntity)
5
5
  * @param moduleId moduleID to get the entity from
6
6
  * @param entityId entityID of the entity to get
7
7
  * @returns entity to get
8
8
  */
9
- export declare const getFarmOrgEntities: <T>(moduleId: string, entityId: string) => Promise<import('../types/Requests').BaseResponse<T>>;
9
+ export declare const getFarmOrgEntities: <T>(moduleId: string, entityId: string) => Promise<import('../main').BaseResponse<T>>;
10
10
  /**
11
11
  * a fetch function to get a certain MODULEDEPENDED entity from the moduleApi (will be used in useEntity)
12
12
  * @param moduleId moduleID to get the entity from
13
13
  * @param entityId entityID of the entity to get
14
14
  * @returns entity to get
15
15
  */
16
- export declare const getModuleDependedEntities: <T>(moduleId: string, entityId: string) => Promise<import('../types/Requests').BaseResponse<T>>;
16
+ export declare const getModuleDependedEntities: <T>(moduleId: string, entityId: string) => Promise<import('../main').BaseResponse<T>>;
17
17
  /**
18
18
  * a fetch function to handle GET requests and returns the response.
19
19
  * @param endpoint custom endpoint to GET data from
20
20
  * @param token token to use (default is the modulePermissionToken)
21
21
  * @returns Promise<BaseResponse<T>> response from the fetch
22
22
  */
23
- export declare const fetchFromCustomApi: <T>(endpoint: string, token?: string) => Promise<import('../types/Requests').BaseResponse<T>>;
23
+ export declare const fetchFromCustomApi: <T>(endpoint: string, token?: string) => Promise<import('../main').BaseResponse<T>>;
24
24
  /**
25
25
  * a fetch function to handle GET requests and returns the response.
26
26
  * @param endpoint endpoint of moduleApi to fetch data from
27
27
  * @returns Promise<BaseResponse<T>> response from the fetch
28
28
  */
29
- export declare const fetchFromModuleApi: <T>(endpoint: string) => Promise<import('../types/Requests').BaseResponse<T>>;
29
+ export declare const fetchFromModuleApi: <T>(endpoint: string) => Promise<import('../main').BaseResponse<T>>;
30
30
  /**
31
31
  * a fetch function to handle GET requests and returns the response.
32
32
  * @param endpoint endpoint of commonApi to fetch data from
33
33
  * @returns Promise<BaseResponse<T>> response from the fetch
34
34
  */
35
- export declare const fetchFromCommonApi: <T>(endpoint: string) => Promise<import('../types/Requests').BaseResponse<T>>;
35
+ export declare const fetchFromCommonApi: <T>(endpoint: string) => Promise<import('../main').BaseResponse<T>>;
@@ -1,5 +1,6 @@
1
1
  import { BaseProps } from '../main';
2
- import { HortiViewEnvironments } from '../types/Environment';
2
+ import { EnvConfig, Environments, HortiViewEnvironments } from '../types/Environment';
3
+ import { BaseResponse } from '../types/Requests';
3
4
  /**
4
5
  * Validates the props and checks if the required props are set
5
6
  * @param props props to be validated
@@ -18,3 +19,10 @@ export declare const checkIfPropExists: (prop: keyof BaseProps, props: BaseProps
18
19
  */
19
20
  export declare const getEnvironmentVariables: () => HortiViewEnvironments | undefined;
20
21
  export declare const checkVersion: (environmentVariables?: HortiViewEnvironments) => string | null;
22
+ /**
23
+ * a universal selector that can be used for all fetches
24
+ * @param data - the data to select from
25
+ * @returns
26
+ */
27
+ export declare const universalSelector: <T>(data: BaseResponse<T>) => T | T[];
28
+ export declare const checkConfig: <T extends EnvConfig>(config: T & Record<Exclude<keyof T, Environments>, never>) => T;
package/dist/main.js CHANGED
@@ -4,136 +4,143 @@ import { useBreadcrumbTranslation as u } from "./hooks/useBreadcrumbTranslation.
4
4
  import { useSignalRMessages as n } from "./hooks/useSignalRMessages.js";
5
5
  import { useNavigate as S } from "./module-router.js";
6
6
  import { useBaseProps as m, useConfig as E } from "./hooks/useStores.js";
7
- import { useCustom as l } from "./hooks/useCustom.js";
7
+ import { useCustom as F } from "./hooks/useCustom.js";
8
8
  import { useCustomMutation as A } from "./hooks/useCustomMutation.js";
9
- import { useEntity as d } from "./hooks/useEntity.js";
9
+ import { useEntity as _ } from "./hooks/useEntity.js";
10
10
  import { useOption as h } from "./hooks/useOption.js";
11
- import { useNotification as x, useServiceBus as C } from "./hooks/useServiceBus.js";
11
+ import { useNotification as C, useServiceBus as U } from "./hooks/useServiceBus.js";
12
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
+ import { arePropsValid as P, checkConfig as k, checkIfPropExists as y, checkVersion as L, getEnvironmentVariables as M, universalSelector as D } from "./utils/helper.js";
14
+ import { A as B, B as O, F as b, H as I, I as T, a as w, b as V, L as q, c as z, M as G, d as K, N as W, e as j, f as J, O as Q, P as X, R as Y, g as Z, h as $, i as aa, S as ea, j as sa, k as ta, l as ra, m as oa, D as ua, n as ia, E as na, o as ca, p as Sa, q as Ra, r as ma, s as Ea, t as la, u as Fa, v as Na, V as Aa, w as pa, x as _a, y as da, z as ha, C as xa, G as Ca, J as Ua, K as ga, Q as va, T as fa, U as Pa, W as ka, X as ya, Y as La, Z as Ma, _ as Da, $ as Ha, a0 as Ba, a1 as Oa, a2 as ba, a3 as Ia, a4 as Ta, a5 as wa, a6 as Va, a7 as qa, a8 as za, a9 as Ga, aa as Ka, ab as Wa, ac as ja, ad as Ja, ae as Qa, af as Xa, ag as Ya, ah as Za, ai as $a, aj as ae, ak as ee, al as se, am as te, an as re, ao as oe, ap as ue, aq as ie, ar as ne, as as ce, at as Se, au as Re, av as me, aw as Ee, ax as le, ay as Fe, az as Ne, aA as Ae, aB as pe, aC as _e, aD as de, aE as he, aF as xe, aG as Ce, aH as Ue, aI as ge, aJ as ve, aK as fe, aL as Pe, aM as ke, aN as ye, aO as Le, aP as Me, aQ as De, aR as He, aS as Be, aT as Oe } from "./chunk-IR6S3I6Y-BmDdD3SP.js";
14
15
  export {
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,
16
+ B as Await,
17
+ O as BrowserRouter,
18
+ b as Form,
19
+ I as HashRouter,
20
+ T as IDLE_BLOCKER,
21
+ w as IDLE_FETCHER,
22
+ V as IDLE_NAVIGATION,
23
+ q as Link,
24
+ z as Links,
25
+ G as MemoryRouter,
26
+ K as Meta,
26
27
  s as ModuleBase,
27
28
  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,
29
+ W as NavLink,
30
+ j as Navigate,
31
+ J as NavigationType,
32
+ Q as Outlet,
33
+ X as PrefetchPageLinks,
34
+ Y as Route,
35
+ Z as Router,
36
+ $ as RouterProvider,
37
+ aa as Routes,
38
+ ea as Scripts,
39
+ sa as ScrollRestoration,
40
+ ta as ServerRouter,
41
+ ra as StaticRouter,
42
+ oa as StaticRouterProvider,
43
+ ua as UNSAFE_DataRouterContext,
44
+ ia as UNSAFE_DataRouterStateContext,
45
+ na as UNSAFE_ErrorResponseImpl,
46
+ ca as UNSAFE_FetchersContext,
47
+ Sa as UNSAFE_FrameworkContext,
48
+ Ra as UNSAFE_LocationContext,
49
+ ma as UNSAFE_NavigationContext,
50
+ Ea as UNSAFE_RemixErrorBoundary,
51
+ la as UNSAFE_RouteContext,
52
+ Fa as UNSAFE_ServerMode,
53
+ Na as UNSAFE_SingleFetchRedirectSymbol,
54
+ Aa as UNSAFE_ViewTransitionContext,
55
+ pa as UNSAFE_createBrowserHistory,
56
+ _a as UNSAFE_createClientRoutes,
57
+ da as UNSAFE_createClientRoutesWithHMRRevalidationOptOut,
58
+ ha as UNSAFE_createRouter,
59
+ xa as UNSAFE_decodeViaTurboStream,
60
+ Ca as UNSAFE_deserializeErrors,
61
+ Ua as UNSAFE_getPatchRoutesOnNavigationFunction,
62
+ ga as UNSAFE_getSingleFetchDataStrategy,
63
+ va as UNSAFE_invariant,
64
+ fa as UNSAFE_mapRouteProperties,
65
+ Pa as UNSAFE_shouldHydrateRouteLoader,
66
+ ka as UNSAFE_useFogOFWarDiscovery,
67
+ ya as UNSAFE_useScrollRestoration,
68
+ P as arePropsValid,
69
+ k as checkConfig,
70
+ y as checkIfPropExists,
71
+ L as checkVersion,
72
+ La as createBrowserRouter,
73
+ Ma as createCookie,
74
+ Da as createCookieSessionStorage,
75
+ Ha as createHashRouter,
76
+ Ba as createMemoryRouter,
77
+ Oa as createMemorySessionStorage,
78
+ ba as createPath,
79
+ Ia as createRequestHandler,
80
+ Ta as createRoutesFromChildren,
81
+ wa as createRoutesFromElements,
82
+ Va as createRoutesStub,
83
+ qa as createSearchParams,
84
+ za as createSession,
85
+ Ga as createSessionStorage,
86
+ Ka as createStaticHandler,
87
+ Wa as createStaticRouter,
88
+ ja as data,
89
+ Ja as generatePath,
90
+ M as getEnvironmentVariables,
91
+ Qa as isCookie,
92
+ Xa as isRouteErrorResponse,
93
+ Ya as isSession,
94
+ Za as matchPath,
95
+ $a as matchRoutes,
90
96
  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,
97
+ ae as parsePath,
98
+ ee as redirect,
99
+ se as redirectDocument,
100
+ te as renderMatches,
101
+ re as replace,
102
+ oe as resolvePath,
103
+ D as universalSelector,
104
+ ue as unstable_HistoryRouter,
105
+ ie as unstable_setDevServerHooks,
106
+ ne as unstable_usePrompt,
107
+ ce as useActionData,
108
+ Se as useAsyncError,
109
+ Re as useAsyncValue,
103
110
  m as useBaseProps,
104
- oe as useBeforeUnload,
105
- ue as useBlocker,
111
+ me as useBeforeUnload,
112
+ Ee as useBlocker,
106
113
  u as useBreadcrumbTranslation,
107
114
  E as useConfig,
108
- l as useCustom,
115
+ F as useCustom,
109
116
  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,
117
+ _ as useEntity,
118
+ le as useFetcher,
119
+ Fe as useFetchers,
120
+ Ne as useFormAction,
121
+ Ae as useHref,
122
+ pe as useInRouterContext,
123
+ _e as useLinkClickHandler,
124
+ de as useLoaderData,
125
+ he as useLocation,
126
+ xe as useMatch,
127
+ Ce as useMatches,
121
128
  S as useNavigate,
122
- Ae as useNavigation,
123
- _e as useNavigationType,
124
- x as useNotification,
129
+ Ue as useNavigation,
130
+ ge as useNavigationType,
131
+ C as useNotification,
125
132
  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,
133
+ ve as useOutlet,
134
+ fe as useOutletContext,
135
+ Pe as useParams,
136
+ ke as useResolvedPath,
137
+ ye as useRevalidator,
138
+ Le as useRouteError,
139
+ Me as useRouteLoaderData,
140
+ De as useRoutes,
141
+ He as useSearchParams,
142
+ U as useServiceBus,
136
143
  n as useSignalRMessages,
137
- Pe as useSubmit,
138
- ye as useViewTransitionState
144
+ Be as useSubmit,
145
+ Oe as useViewTransitionState
139
146
  };
@@ -1,4 +1 @@
1
- const e = (c) => c;
2
- export {
3
- e as checkConfig
4
- };
1
+
@@ -1,4 +1 @@
1
- const r = (e) => typeof e == "string" || typeof e == "boolean" || typeof e == "number" ? e : typeof e == "object" && "value" in e ? e.value : typeof e == "object" && "items" in e ? e.items : (Array.isArray(e), e);
2
- export {
3
- r as universalSelector
4
- };
1
+
@@ -1,30 +1,30 @@
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) => {
1
+ import { REQUIRED_PROPS as d } from "../constants.js";
2
+ const h = /^[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(p);
5
+ const e = r.match(h);
6
6
  if (!e)
7
7
  throw new Error(`Invalid argument not valid semver ('${r}' received)`);
8
8
  return e.shift(), e;
9
- }, c = (r) => r === "*" || r === "x" || r === "X", d = (r) => {
9
+ }, c = (r) => r === "*" || r === "x" || r === "X", f = (r) => {
10
10
  const e = parseInt(r, 10);
11
11
  return isNaN(e) ? r : e;
12
- }, E = (r, e) => typeof r != typeof e ? [String(r), String(e)] : [r, e], h = (r, e) => {
12
+ }, m = (r, e) => typeof r != typeof e ? [String(r), String(e)] : [r, e], E = (r, e) => {
13
13
  if (c(r) || c(e))
14
14
  return 0;
15
- const [t, n] = E(d(r), d(e));
16
- return t > n ? 1 : t < n ? -1 : 0;
17
- }, f = (r, e) => {
18
- for (let t = 0; t < Math.max(r.length, e.length); t++) {
19
- const n = h(r[t] || "0", e[t] || "0");
20
- if (n !== 0)
21
- return n;
15
+ const [n, t] = m(f(r), f(e));
16
+ return n > t ? 1 : n < t ? -1 : 0;
17
+ }, l = (r, e) => {
18
+ for (let n = 0; n < Math.max(r.length, e.length); n++) {
19
+ const t = E(r[n] || "0", e[n] || "0");
20
+ if (t !== 0)
21
+ return t;
22
22
  }
23
23
  return 0;
24
- }, m = (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) => {
24
+ }, g = (r, e) => {
25
+ const n = u(r), t = u(e), i = n.pop(), o = t.pop(), s = l(n, t);
26
+ return s !== 0 ? s : i && o ? l(i.split("."), o.split(".")) : i || o ? i ? -1 : 1 : 0;
27
+ }, p = "0.0.13925", w = (r) => d.every((e) => v(e, r)), v = (r, e) => {
28
28
  if (!e[r]) {
29
29
  if (e.throwError)
30
30
  return e.throwError(`Missing required prop: ${r}`, 404), !1;
@@ -38,11 +38,13 @@ const p = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([
38
38
  }, P = (r) => {
39
39
  if (!r?.REQ_VERSION) return null;
40
40
  const e = r.REQ_VERSION;
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
- };
41
+ return g(p, e) < 0 ? `ModuleBase version ${p} is probably not compatible with the current HortiView version ${e}. Please update the modulebase to be at least ${e}` : null;
42
+ }, _ = (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), a = (r) => r;
43
43
  export {
44
- v as arePropsValid,
45
- g as checkIfPropExists,
44
+ w as arePropsValid,
45
+ a as checkConfig,
46
+ v as checkIfPropExists,
46
47
  P as checkVersion,
47
- I as getEnvironmentVariables
48
+ I as getEnvironmentVariables,
49
+ _ as universalSelector
48
50
  };
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.13321",
4
+ "version": "0.0.13925",
5
5
  "type": "module",
6
6
  "author": "Falk Menge <falk.menge.ext@bayer.com>",
7
7
  "contributors": [