@hortiview/modulebase 0.0.11523 → 0.0.11938

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,27 +1,27 @@
1
- import { jsx as g } from "react/jsx-runtime";
2
- import { S as k, h as N, Q as x, n as u, m as M, R as H, c as K, a as E, b as h, e as B, d as j, f as L, g as U, o as S, r as D, i as G, j as A, p as C, s as V, k as W } from "../QueryClientProvider-DQv4Y3Qu.js";
3
- import { useState as $, useEffect as q } from "react";
4
- import { c as z, R as X } from "../chunk-IR6S3I6Y-BvQXS3A3.js";
5
- import { REQUIRED_PROPS as Y } from "../constants.js";
6
- import { SignalRProvider as J } from "../provider/SignalR/SignalRProvider.js";
7
- import { useBasePropsStore as R } from "../stores/BasePropsStore.js";
8
- import { useEnvironmentStore as F } from "../stores/EnvironmentStore.js";
9
- var Z = class extends k {
1
+ import { jsx as y } from "react/jsx-runtime";
2
+ import { S as N, h as k, Q as x, n as u, m as S, R as H, c as K, a as D, b as h, e as B, d as j, f as U, g as G, o as A, r as C, i as L, j as q, p as F, s as V, k as W } from "../QueryClientProvider-DQv4Y3Qu.js";
3
+ import { useState as $, useEffect as M } from "react";
4
+ import { Y as z, h as X, O as Y, aU as J } from "../chunk-IR6S3I6Y-BmDdD3SP.js";
5
+ import { REQUIRED_PROPS as Z } from "../constants.js";
6
+ import { SignalRProvider as ee } from "../provider/SignalR/SignalRProvider.js";
7
+ import { useBasePropsStore as b } from "../stores/BasePropsStore.js";
8
+ import { useEnvironmentStore as R } from "../stores/EnvironmentStore.js";
9
+ var te = class extends N {
10
10
  constructor(e = {}) {
11
11
  super(), this.config = e, this.#e = /* @__PURE__ */ new Map();
12
12
  }
13
13
  #e;
14
14
  build(e, t, s) {
15
- const i = t.queryKey, r = t.queryHash ?? N(i, t);
16
- let n = this.get(r);
17
- return n || (n = new x({
15
+ const i = t.queryKey, n = t.queryHash ?? k(i, t);
16
+ let r = this.get(n);
17
+ return r || (r = new x({
18
18
  client: e,
19
19
  queryKey: i,
20
- queryHash: r,
20
+ queryHash: n,
21
21
  options: e.defaultQueryOptions(t),
22
22
  state: s,
23
23
  defaultOptions: e.getQueryDefaults(i)
24
- }), this.add(n)), n;
24
+ }), this.add(r)), r;
25
25
  }
26
26
  add(e) {
27
27
  this.#e.has(e.queryHash) || (this.#e.set(e.queryHash, e), this.notify({
@@ -49,12 +49,12 @@ var Z = class extends k {
49
49
  find(e) {
50
50
  const t = { exact: !0, ...e };
51
51
  return this.getAll().find(
52
- (s) => M(t, s)
52
+ (s) => S(t, s)
53
53
  );
54
54
  }
55
55
  findAll(e = {}) {
56
56
  const t = this.getAll();
57
- return Object.keys(e).length > 0 ? t.filter((s) => M(e, s)) : t;
57
+ return Object.keys(e).length > 0 ? t.filter((s) => S(e, s)) : t;
58
58
  }
59
59
  notify(e) {
60
60
  u.batch(() => {
@@ -77,12 +77,12 @@ var Z = class extends k {
77
77
  });
78
78
  });
79
79
  }
80
- }, ee = class extends H {
80
+ }, se = class extends H {
81
81
  #e;
82
82
  #t;
83
83
  #s;
84
84
  constructor(e) {
85
- super(), this.mutationId = e.mutationId, this.#t = e.mutationCache, this.#e = [], this.state = e.state || te(), this.setOptions(e.options), this.scheduleGc();
85
+ super(), this.mutationId = e.mutationId, this.#t = e.mutationCache, this.#e = [], this.state = e.state || ie(), this.setOptions(e.options), this.scheduleGc();
86
86
  }
87
87
  setOptions(e) {
88
88
  this.options = e, this.updateGcTime(this.options.gcTime);
@@ -114,8 +114,8 @@ var Z = class extends k {
114
114
  async execute(e) {
115
115
  this.#s = K({
116
116
  fn: () => this.options.mutationFn ? this.options.mutationFn(e) : Promise.reject(new Error("No mutationFn found")),
117
- onFail: (i, r) => {
118
- this.#i({ type: "failed", failureCount: i, error: r });
117
+ onFail: (i, n) => {
118
+ this.#i({ type: "failed", failureCount: i, error: n });
119
119
  },
120
120
  onPause: () => {
121
121
  this.#i({ type: "pause" });
@@ -135,10 +135,10 @@ var Z = class extends k {
135
135
  e,
136
136
  this
137
137
  );
138
- const r = await this.options.onMutate?.(e);
139
- r !== this.state.context && this.#i({
138
+ const n = await this.options.onMutate?.(e);
139
+ n !== this.state.context && this.#i({
140
140
  type: "pending",
141
- context: r,
141
+ context: n,
142
142
  variables: e,
143
143
  isPaused: s
144
144
  });
@@ -251,7 +251,7 @@ var Z = class extends k {
251
251
  });
252
252
  }
253
253
  };
254
- function te() {
254
+ function ie() {
255
255
  return {
256
256
  context: void 0,
257
257
  data: void 0,
@@ -264,7 +264,7 @@ function te() {
264
264
  submittedAt: 0
265
265
  };
266
266
  }
267
- var se = class extends k {
267
+ var ne = class extends N {
268
268
  constructor(e = {}) {
269
269
  super(), this.config = e, this.#e = /* @__PURE__ */ new Set(), this.#t = /* @__PURE__ */ new Map(), this.#s = 0;
270
270
  }
@@ -272,7 +272,7 @@ var se = class extends k {
272
272
  #t;
273
273
  #s;
274
274
  build(e, t, s) {
275
- const i = new ee({
275
+ const i = new se({
276
276
  mutationCache: this,
277
277
  mutationId: ++this.#s,
278
278
  options: e.defaultMutationOptions(t),
@@ -307,7 +307,7 @@ var se = class extends k {
307
307
  const t = O(e);
308
308
  if (typeof t == "string") {
309
309
  const i = this.#t.get(t)?.find(
310
- (r) => r.state.status === "pending"
310
+ (n) => n.state.status === "pending"
311
311
  );
312
312
  return !i || i === e;
313
313
  } else
@@ -330,11 +330,11 @@ var se = class extends k {
330
330
  find(e) {
331
331
  const t = { exact: !0, ...e };
332
332
  return this.getAll().find(
333
- (s) => E(t, s)
333
+ (s) => D(t, s)
334
334
  );
335
335
  }
336
336
  findAll(e = {}) {
337
- return this.getAll().filter((t) => E(e, t));
337
+ return this.getAll().filter((t) => D(e, t));
338
338
  }
339
339
  notify(e) {
340
340
  u.batch(() => {
@@ -358,19 +358,19 @@ function O(e) {
358
358
  function T(e) {
359
359
  return {
360
360
  onFetch: (t, s) => {
361
- const i = t.options, r = t.fetchOptions?.meta?.fetchMore?.direction, n = t.state.data?.pages || [], d = t.state.data?.pageParams || [];
361
+ const i = t.options, n = t.fetchOptions?.meta?.fetchMore?.direction, r = t.state.data?.pages || [], d = t.state.data?.pageParams || [];
362
362
  let c = { pages: [], pageParams: [] }, f = 0;
363
363
  const P = async () => {
364
- let y = !1;
364
+ let p = !1;
365
365
  const w = (o) => {
366
366
  Object.defineProperty(o, "signal", {
367
367
  enumerable: !0,
368
- get: () => (t.signal.aborted ? y = !0 : t.signal.addEventListener("abort", () => {
369
- y = !0;
368
+ get: () => (t.signal.aborted ? p = !0 : t.signal.addEventListener("abort", () => {
369
+ p = !0;
370
370
  }), t.signal)
371
371
  });
372
- }, a = B(t.options, t.fetchOptions), p = async (o, l, m) => {
373
- if (y)
372
+ }, a = B(t.options, t.fetchOptions), m = async (o, l, g) => {
373
+ if (p)
374
374
  return Promise.reject();
375
375
  if (l == null && o.pages.length)
376
376
  return Promise.resolve(o);
@@ -378,31 +378,31 @@ function T(e) {
378
378
  client: t.client,
379
379
  queryKey: t.queryKey,
380
380
  pageParam: l,
381
- direction: m ? "backward" : "forward",
381
+ direction: g ? "backward" : "forward",
382
382
  meta: t.options.meta
383
383
  };
384
384
  w(v);
385
385
  const _ = await a(
386
386
  v
387
- ), { maxPages: b } = t.options, Q = m ? j : L;
387
+ ), { maxPages: Q } = t.options, E = g ? j : U;
388
388
  return {
389
- pages: Q(o.pages, _, b),
390
- pageParams: Q(o.pageParams, l, b)
389
+ pages: E(o.pages, _, Q),
390
+ pageParams: E(o.pageParams, l, Q)
391
391
  };
392
392
  };
393
- if (r && n.length) {
394
- const o = r === "backward", l = o ? ie : I, m = {
395
- pages: n,
393
+ if (n && r.length) {
394
+ const o = n === "backward", l = o ? re : I, g = {
395
+ pages: r,
396
396
  pageParams: d
397
- }, v = l(i, m);
398
- c = await p(m, v, o);
397
+ }, v = l(i, g);
398
+ c = await m(g, v, o);
399
399
  } else {
400
- const o = e ?? n.length;
400
+ const o = e ?? r.length;
401
401
  do {
402
402
  const l = f === 0 ? d[0] ?? i.initialPageParam : I(i, c);
403
403
  if (f > 0 && l == null)
404
404
  break;
405
- c = await p(c, l), f++;
405
+ c = await m(c, l), f++;
406
406
  } while (f < o);
407
407
  }
408
408
  return c;
@@ -429,30 +429,30 @@ function I(e, { pages: t, pageParams: s }) {
429
429
  s
430
430
  ) : void 0;
431
431
  }
432
- function ie(e, { pages: t, pageParams: s }) {
432
+ function re(e, { pages: t, pageParams: s }) {
433
433
  return t.length > 0 ? e.getPreviousPageParam?.(t[0], t, s[0], s) : void 0;
434
434
  }
435
- var re = class {
435
+ var ae = class {
436
436
  #e;
437
437
  #t;
438
438
  #s;
439
439
  #i;
440
- #n;
441
440
  #r;
441
+ #n;
442
442
  #a;
443
443
  #u;
444
444
  constructor(e = {}) {
445
- this.#e = e.queryCache || new Z(), this.#t = e.mutationCache || new se(), this.#s = e.defaultOptions || {}, this.#i = /* @__PURE__ */ new Map(), this.#n = /* @__PURE__ */ new Map(), this.#r = 0;
445
+ this.#e = e.queryCache || new te(), this.#t = e.mutationCache || new ne(), this.#s = e.defaultOptions || {}, this.#i = /* @__PURE__ */ new Map(), this.#r = /* @__PURE__ */ new Map(), this.#n = 0;
446
446
  }
447
447
  mount() {
448
- this.#r++, this.#r === 1 && (this.#a = U.subscribe(async (e) => {
448
+ this.#n++, this.#n === 1 && (this.#a = G.subscribe(async (e) => {
449
449
  e && (await this.resumePausedMutations(), this.#e.onFocus());
450
- }), this.#u = S.subscribe(async (e) => {
450
+ }), this.#u = A.subscribe(async (e) => {
451
451
  e && (await this.resumePausedMutations(), this.#e.onOnline());
452
452
  }));
453
453
  }
454
454
  unmount() {
455
- this.#r--, this.#r === 0 && (this.#a?.(), this.#a = void 0, this.#u?.(), this.#u = void 0);
455
+ this.#n--, this.#n === 0 && (this.#a?.(), this.#a = void 0, this.#u?.(), this.#u = void 0);
456
456
  }
457
457
  isFetching(e) {
458
458
  return this.#e.findAll({ ...e, fetchStatus: "fetching" }).length;
@@ -466,7 +466,7 @@ var re = class {
466
466
  }
467
467
  ensureQueryData(e) {
468
468
  const t = this.defaultQueryOptions(e), s = this.#e.build(this, t), i = s.state.data;
469
- return i === void 0 ? this.fetchQuery(e) : (e.revalidateIfStale && s.isStaleByTime(D(t.staleTime, s)) && this.prefetchQuery(t), Promise.resolve(i));
469
+ return i === void 0 ? this.fetchQuery(e) : (e.revalidateIfStale && s.isStaleByTime(C(t.staleTime, s)) && this.prefetchQuery(t), Promise.resolve(i));
470
470
  }
471
471
  getQueriesData(e) {
472
472
  return this.#e.findAll(e).map(({ queryKey: t, state: s }) => {
@@ -475,9 +475,9 @@ var re = class {
475
475
  });
476
476
  }
477
477
  setQueryData(e, t, s) {
478
- const i = this.defaultQueryOptions({ queryKey: e }), n = this.#e.get(
478
+ const i = this.defaultQueryOptions({ queryKey: e }), r = this.#e.get(
479
479
  i.queryHash
480
- )?.state.data, d = G(t, n);
480
+ )?.state.data, d = L(t, r);
481
481
  if (d !== void 0)
482
482
  return this.#e.build(this, i).setData(d, { ...s, manual: !0 });
483
483
  }
@@ -508,13 +508,13 @@ var re = class {
508
508
  type: "active",
509
509
  ...e
510
510
  };
511
- return u.batch(() => (s.findAll(e).forEach((r) => {
512
- r.reset();
511
+ return u.batch(() => (s.findAll(e).forEach((n) => {
512
+ n.reset();
513
513
  }), this.refetchQueries(i, t)));
514
514
  }
515
515
  cancelQueries(e, t = {}) {
516
516
  const s = { revert: !0, ...t }, i = u.batch(
517
- () => this.#e.findAll(e).map((r) => r.cancel(s))
517
+ () => this.#e.findAll(e).map((n) => n.cancel(s))
518
518
  );
519
519
  return Promise.all(i).then(h).catch(h);
520
520
  }
@@ -536,9 +536,9 @@ var re = class {
536
536
  ...t,
537
537
  cancelRefetch: t.cancelRefetch ?? !0
538
538
  }, i = u.batch(
539
- () => this.#e.findAll(e).filter((r) => !r.isDisabled()).map((r) => {
540
- let n = r.fetch(void 0, s);
541
- return s.throwOnError || (n = n.catch(h)), r.state.fetchStatus === "paused" ? Promise.resolve() : n;
539
+ () => this.#e.findAll(e).filter((n) => !n.isDisabled()).map((n) => {
540
+ let r = n.fetch(void 0, s);
541
+ return s.throwOnError || (r = r.catch(h)), n.state.fetchStatus === "paused" ? Promise.resolve() : r;
542
542
  })
543
543
  );
544
544
  return Promise.all(i).then(h);
@@ -548,7 +548,7 @@ var re = class {
548
548
  t.retry === void 0 && (t.retry = !1);
549
549
  const s = this.#e.build(this, t);
550
550
  return s.isStaleByTime(
551
- D(t.staleTime, s)
551
+ C(t.staleTime, s)
552
552
  ) ? s.fetch(t) : Promise.resolve(s.state.data);
553
553
  }
554
554
  prefetchQuery(e) {
@@ -564,7 +564,7 @@ var re = class {
564
564
  return e.behavior = T(e.pages), this.ensureQueryData(e);
565
565
  }
566
566
  resumePausedMutations() {
567
- return S.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
567
+ return A.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
568
568
  }
569
569
  getQueryCache() {
570
570
  return this.#e;
@@ -579,7 +579,7 @@ var re = class {
579
579
  this.#s = e;
580
580
  }
581
581
  setQueryDefaults(e, t) {
582
- this.#i.set(A(e), {
582
+ this.#i.set(q(e), {
583
583
  queryKey: e,
584
584
  defaultOptions: t
585
585
  });
@@ -587,20 +587,20 @@ var re = class {
587
587
  getQueryDefaults(e) {
588
588
  const t = [...this.#i.values()], s = {};
589
589
  return t.forEach((i) => {
590
- C(e, i.queryKey) && Object.assign(s, i.defaultOptions);
590
+ F(e, i.queryKey) && Object.assign(s, i.defaultOptions);
591
591
  }), s;
592
592
  }
593
593
  setMutationDefaults(e, t) {
594
- this.#n.set(A(e), {
594
+ this.#r.set(q(e), {
595
595
  mutationKey: e,
596
596
  defaultOptions: t
597
597
  });
598
598
  }
599
599
  getMutationDefaults(e) {
600
- const t = [...this.#n.values()];
600
+ const t = [...this.#r.values()];
601
601
  let s = {};
602
602
  return t.forEach((i) => {
603
- C(e, i.mutationKey) && (s = { ...s, ...i.defaultOptions });
603
+ F(e, i.mutationKey) && (s = { ...s, ...i.defaultOptions });
604
604
  }), s;
605
605
  }
606
606
  defaultQueryOptions(e) {
@@ -612,7 +612,7 @@ var re = class {
612
612
  ...e,
613
613
  _defaulted: !0
614
614
  };
615
- return t.queryHash || (t.queryHash = N(
615
+ return t.queryHash || (t.queryHash = k(
616
616
  t.queryKey,
617
617
  t
618
618
  )), t.refetchOnReconnect === void 0 && (t.refetchOnReconnect = t.networkMode !== "always"), t.throwOnError === void 0 && (t.throwOnError = !!t.suspense), !t.networkMode && t.persister && (t.networkMode = "offlineFirst"), t.queryFn === V && (t.enabled = !1), t;
@@ -629,7 +629,7 @@ var re = class {
629
629
  this.#e.clear(), this.#t.clear();
630
630
  }
631
631
  };
632
- const ne = new re({
632
+ const ue = new ae({
633
633
  defaultOptions: {
634
634
  mutations: {
635
635
  retry: !1
@@ -643,22 +643,26 @@ const ne = new re({
643
643
  retry: !1
644
644
  }
645
645
  }
646
- }), ge = ({
646
+ }), oe = () => {
647
+ const e = b((s) => s.currentNavigationPath), t = J();
648
+ M(() => {
649
+ e && t(e, { replace: !0 });
650
+ }, [e, t]);
651
+ }, he = () => (oe(), /* @__PURE__ */ y(Y, {})), we = ({
647
652
  props: e,
648
653
  routes: t,
649
654
  env: s = void 0,
650
655
  useSignalR: i = !1,
651
- queryClient: r = ne
656
+ queryClient: n = ue
652
657
  }) => {
653
- const n = R((a) => a.setBaseProps), d = R((a) => a.modulePermissionToken), c = F((a) => a.setEnvironment), f = F((a) => a.addEnvironment), [P, y] = $(!1);
654
- q(() => {
655
- const a = oe();
656
- if (y(!a), a && c(a), !s) return;
657
- console.log(s);
658
- const p = s[a?.ENVIRONMENT];
659
- p && f(p);
660
- }, [f, s, c]), q(() => {
661
- y(!ae(e)), n(e);
658
+ const r = b((a) => a.setBaseProps), d = b((a) => a.modulePermissionToken), c = R((a) => a.setEnvironment), f = R((a) => a.addEnvironment), [P, p] = $(!1);
659
+ M(() => {
660
+ const a = de();
661
+ if (p(!a), a && c(a), !s) return;
662
+ const m = s[a?.ENVIRONMENT];
663
+ m && f(m);
664
+ }, [f, s, c]), M(() => {
665
+ p(!ce(e)), r(e);
662
666
  }, [
663
667
  e.currentLanguage,
664
668
  e.currentLanguageId,
@@ -670,22 +674,23 @@ const ne = new re({
670
674
  const w = z([
671
675
  {
672
676
  path: e.basePath,
673
- children: t
677
+ children: t,
678
+ element: /* @__PURE__ */ y(he, {})
674
679
  }
675
680
  ]);
676
- return P ? /* @__PURE__ */ g("div", { children: "TODO: Show fancy error" }) : d ? /* @__PURE__ */ g(W, { client: r, children: /* @__PURE__ */ g(J, { enabled: i, children: /* @__PURE__ */ g(X, { router: w }) }) }) : /* @__PURE__ */ g("div", { children: "TODO: Show fancy Loadingspinner" });
677
- }, ae = (e) => Y.every((t) => ue(t, e)), ue = (e, t) => {
681
+ return P ? /* @__PURE__ */ y("div", { children: "TODO: Show fancy error" }) : d ? /* @__PURE__ */ y(W, { client: n, children: /* @__PURE__ */ y(ee, { enabled: i, children: /* @__PURE__ */ y(X, { router: w }) }) }) : /* @__PURE__ */ y("div", { children: "TODO: Show fancy Loadingspinner" });
682
+ }, ce = (e) => Z.every((t) => le(t, e)), le = (e, t) => {
678
683
  if (!t[e]) {
679
684
  if (t.throwError)
680
685
  return t.throwError(`Missing required prop: ${e}`, 404), !1;
681
686
  throw new Error(`Missing required prop: ${e}`);
682
687
  }
683
688
  return !0;
684
- }, oe = () => {
689
+ }, de = () => {
685
690
  const e = window.__env__;
686
691
  if (e && e.COMMON_API && e.MODULE_AUTH_API && e.API_PREFIX && e.ENVIRONMENT)
687
692
  return e;
688
693
  };
689
694
  export {
690
- ge as ModuleBase
695
+ we as ModuleBase
691
696
  };
@@ -1,6 +1,6 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
- export declare const useCustom: <T>({ endpoint, queryKey, token, }: {
1
+ export declare const useCustom: <T>({ endpoint, queryKey, token, selector, }: {
3
2
  endpoint: string;
4
3
  queryKey: (string | undefined)[];
5
4
  token?: string;
6
- }) => UseQueryResult<T[], Error>;
5
+ selector?: (data: any) => T;
6
+ }) => import('@tanstack/react-query').UseQueryResult<T, Error>;
@@ -1,19 +1,20 @@
1
1
  import { u as m } from "../useQuery-znAyMQW1.js";
2
- import { useBasePropsStore as u } from "../stores/BasePropsStore.js";
3
- import { universalSelector as i } from "../types/Requests.js";
4
- import { d as n } from "../fetches-DUCQo_6B.js";
5
- const y = ({
6
- endpoint: r,
7
- queryKey: e,
8
- token: t
2
+ import { useBasePropsStore as i } from "../stores/BasePropsStore.js";
3
+ import { universalSelector as n } from "../types/Requests.js";
4
+ import { d as p } from "../fetches-DUCQo_6B.js";
5
+ const d = ({
6
+ endpoint: e,
7
+ queryKey: t,
8
+ token: s,
9
+ selector: o
9
10
  }) => {
10
- const s = u((o) => o.organizationId);
11
+ const u = i((r) => r.organizationId);
11
12
  return m({
12
- queryKey: [...e, s],
13
- queryFn: () => n(r, t),
14
- select: (o) => i(o)
13
+ queryKey: [...t, u],
14
+ queryFn: () => p(e, s),
15
+ select: (r) => o ? o(r) : n(r)
15
16
  });
16
17
  };
17
18
  export {
18
- y as useCustom
19
+ d as useCustom
19
20
  };
@@ -23,7 +23,7 @@ export declare const useBaseProps: () => Pick<import('../types/Deprecated').Depr
23
23
  setBaseProps: (props: import('../main').BaseProps) => void;
24
24
  }, keyof import('../types/Deprecated').DeprecatedBaseProps | "modulePermissionToken" | "moduleId" | "organizationId" | "basePath" | "currentNavigationPath" | "sourcePath" | "currentLanguage" | "currentLanguageId" | "alertRules" | "commonOptions" | "navigateInHortiview" | "addBreadcrumbTranslation" | "showSnackbar" | "showMessage" | "logEvent" | "logError" | "throwError">;
25
25
  export declare const useConfig: () => Pick<{
26
- environment?: import('../types/Environment').HortiViewEnvironments;
26
+ environment: import('../types/Environment').HortiViewEnvironments;
27
27
  setEnvironment: (environment: import('../types/Environment').HortiViewEnvironments) => void;
28
28
  addEnvironment: (customEnv: import('../types/Environment').CustomEnv) => void;
29
29
  }, "environment">;
package/dist/main.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  export { ModuleBase } from './components/ModuleBase';
2
2
  export type { BaseProps } from './types/BaseProps';
3
3
  export { useBreadcrumbTranslation } from './hooks/useBreadcrumbTranslation';
4
- export { useNavigate } from './hooks/useNavigate';
5
4
  export { useSignalRMessages } from './hooks/useSignalRMessages';
5
+ export * from './module-router';
6
+ export { useNavigate } from './module-router';
6
7
  export { useBaseProps, useConfig } from './hooks/useStores';
7
8
  export { useCustom } from './hooks/useCustom';
8
9
  export { useEntity } from './hooks/useEntity';
package/dist/main.js CHANGED
@@ -1,19 +1,130 @@
1
- import { ModuleBase as r } from "./components/ModuleBase.js";
2
- import { useBreadcrumbTranslation as t } from "./hooks/useBreadcrumbTranslation.js";
3
- import { useNavigate as m } from "./hooks/useNavigate.js";
4
- import { useSignalRMessages as a } from "./hooks/useSignalRMessages.js";
5
- import { useBaseProps as x, useConfig as i } from "./hooks/useStores.js";
6
- import { useCustom as g } from "./hooks/useCustom.js";
7
- import { useEntity as B } from "./hooks/useEntity.js";
8
- import { useOption as C } from "./hooks/useOption.js";
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 F } from "./hooks/useCustom.js";
7
+ import { useEntity as N } from "./hooks/useEntity.js";
8
+ import { useOption as A } from "./hooks/useOption.js";
9
+ import { A as d, B as h, F as U, H as p, I as g, a as C, b as v, L as x, c as P, M as y, d as L, N as f, e as k, f as D, O as H, P as M, R as B, g as O, h as b, i as T, S as w, j as I, k as V, l as q, m as z, D as G, n as K, E as W, o as j, p as J, q as Q, r as X, s as Y, t as Z, u as $, v as aa, V as ea, w as sa, x as ta, y as ra, z as oa, C as ua, G as ia, J as na, K as ca, Q as Sa, T as Ra, U as Ea, W as Fa, X as la, Y as Na, Z as ma, _ as Aa, $ as _a, a0 as da, a1 as ha, a2 as Ua, a3 as pa, a4 as ga, a5 as Ca, a6 as va, a7 as xa, a8 as Pa, a9 as ya, aa as La, ab as fa, ac as ka, ad as Da, ae as Ha, af as Ma, ag as Ba, ah as Oa, ai as ba, aj as Ta, ak as wa, al as Ia, am as Va, an as qa, ao as za, ap as Ga, aq as Ka, ar as Wa, as as ja, at as Ja, au as Qa, av as Xa, aw as Ya, ax as Za, ay as $a, az as ae, aA as ee, aB as se, aC as te, aD as re, aE as oe, aF as ue, aG as ie, aH as ne, aI as ce, aJ as Se, aK as Re, aL as Ee, aM as Fe, aN as le, aO as Ne, aP as me, aQ as Ae, aR as _e, aS as de, aT as he } from "./chunk-IR6S3I6Y-BmDdD3SP.js";
9
10
  export {
10
- r as ModuleBase,
11
- x as useBaseProps,
12
- t as useBreadcrumbTranslation,
13
- i as useConfig,
14
- g as useCustom,
15
- B as useEntity,
16
- m as useNavigate,
17
- C as useOption,
18
- a as useSignalRMessages
11
+ d as Await,
12
+ h as BrowserRouter,
13
+ U as Form,
14
+ p as HashRouter,
15
+ g as IDLE_BLOCKER,
16
+ C as IDLE_FETCHER,
17
+ v as IDLE_NAVIGATION,
18
+ x as Link,
19
+ P as Links,
20
+ y as MemoryRouter,
21
+ L as Meta,
22
+ s as ModuleBase,
23
+ f as NavLink,
24
+ k as Navigate,
25
+ D as NavigationType,
26
+ H as Outlet,
27
+ M as PrefetchPageLinks,
28
+ B as Route,
29
+ O as Router,
30
+ b as RouterProvider,
31
+ T as Routes,
32
+ w as Scripts,
33
+ I as ScrollRestoration,
34
+ V as ServerRouter,
35
+ q as StaticRouter,
36
+ z as StaticRouterProvider,
37
+ G as UNSAFE_DataRouterContext,
38
+ K as UNSAFE_DataRouterStateContext,
39
+ W as UNSAFE_ErrorResponseImpl,
40
+ j as UNSAFE_FetchersContext,
41
+ J as UNSAFE_FrameworkContext,
42
+ Q as UNSAFE_LocationContext,
43
+ X as UNSAFE_NavigationContext,
44
+ Y as UNSAFE_RemixErrorBoundary,
45
+ Z as UNSAFE_RouteContext,
46
+ $ as UNSAFE_ServerMode,
47
+ aa as UNSAFE_SingleFetchRedirectSymbol,
48
+ ea as UNSAFE_ViewTransitionContext,
49
+ sa as UNSAFE_createBrowserHistory,
50
+ ta as UNSAFE_createClientRoutes,
51
+ ra as UNSAFE_createClientRoutesWithHMRRevalidationOptOut,
52
+ oa as UNSAFE_createRouter,
53
+ ua as UNSAFE_decodeViaTurboStream,
54
+ ia as UNSAFE_deserializeErrors,
55
+ na as UNSAFE_getPatchRoutesOnNavigationFunction,
56
+ ca as UNSAFE_getSingleFetchDataStrategy,
57
+ Sa as UNSAFE_invariant,
58
+ Ra as UNSAFE_mapRouteProperties,
59
+ Ea as UNSAFE_shouldHydrateRouteLoader,
60
+ Fa as UNSAFE_useFogOFWarDiscovery,
61
+ la as UNSAFE_useScrollRestoration,
62
+ Na as createBrowserRouter,
63
+ ma as createCookie,
64
+ Aa as createCookieSessionStorage,
65
+ _a as createHashRouter,
66
+ da as createMemoryRouter,
67
+ ha as createMemorySessionStorage,
68
+ Ua as createPath,
69
+ pa as createRequestHandler,
70
+ ga as createRoutesFromChildren,
71
+ Ca as createRoutesFromElements,
72
+ va as createRoutesStub,
73
+ xa as createSearchParams,
74
+ Pa as createSession,
75
+ ya as createSessionStorage,
76
+ La as createStaticHandler,
77
+ fa as createStaticRouter,
78
+ ka as data,
79
+ Da as generatePath,
80
+ Ha as isCookie,
81
+ Ma as isRouteErrorResponse,
82
+ Ba as isSession,
83
+ Oa as matchPath,
84
+ ba as matchRoutes,
85
+ Ta as parsePath,
86
+ wa as redirect,
87
+ Ia as redirectDocument,
88
+ Va as renderMatches,
89
+ qa as replace,
90
+ za as resolvePath,
91
+ Ga as unstable_HistoryRouter,
92
+ Ka as unstable_setDevServerHooks,
93
+ Wa as unstable_usePrompt,
94
+ ja as useActionData,
95
+ Ja as useAsyncError,
96
+ Qa as useAsyncValue,
97
+ S as useBaseProps,
98
+ Xa as useBeforeUnload,
99
+ Ya as useBlocker,
100
+ r as useBreadcrumbTranslation,
101
+ R as useConfig,
102
+ F as useCustom,
103
+ N as useEntity,
104
+ Za as useFetcher,
105
+ $a as useFetchers,
106
+ ae as useFormAction,
107
+ ee as useHref,
108
+ se as useInRouterContext,
109
+ te as useLinkClickHandler,
110
+ re as useLoaderData,
111
+ oe as useLocation,
112
+ ue as useMatch,
113
+ ie as useMatches,
114
+ n as useNavigate,
115
+ ne as useNavigation,
116
+ ce as useNavigationType,
117
+ A as useOption,
118
+ Se as useOutlet,
119
+ Re as useOutletContext,
120
+ Ee as useParams,
121
+ Fe as useResolvedPath,
122
+ le as useRevalidator,
123
+ Ne as useRouteError,
124
+ me as useRouteLoaderData,
125
+ Ae as useRoutes,
126
+ _e as useSearchParams,
127
+ u as useSignalRMessages,
128
+ de as useSubmit,
129
+ he as useViewTransitionState
19
130
  };
@@ -0,0 +1,7 @@
1
+ /**
2
+ *
3
+ * @returns A function to navigate to a specific path
4
+ */
5
+ declare const useNavigate: () => (path: string) => void;
6
+ export * from 'react-router';
7
+ export { useNavigate };