@hortiview/modulebase 0.0.12109 → 0.0.12119
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/components/ModuleBase.js +17 -17
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
|
3
|
-
import { useState as
|
|
4
|
-
import { Y as
|
|
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 A, b as h, e as B, d as j, f as U, g as G, o as D, 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 X, useEffect as M } from "react";
|
|
4
|
+
import { Y as $, h as z, O as Y, aU as J } from "../chunk-IR6S3I6Y-BmDdD3SP.js";
|
|
5
5
|
import { REQUIRED_PROPS as Z } from "../constants.js";
|
|
6
6
|
import { SignalRProvider as ee } from "../provider/SignalR/SignalRProvider.js";
|
|
7
7
|
import { useBasePropsStore as b } from "../stores/BasePropsStore.js";
|
|
@@ -330,11 +330,11 @@ var ne = class extends N {
|
|
|
330
330
|
find(e) {
|
|
331
331
|
const t = { exact: !0, ...e };
|
|
332
332
|
return this.getAll().find(
|
|
333
|
-
(s) =>
|
|
333
|
+
(s) => A(t, s)
|
|
334
334
|
);
|
|
335
335
|
}
|
|
336
336
|
findAll(e = {}) {
|
|
337
|
-
return this.getAll().filter((t) =>
|
|
337
|
+
return this.getAll().filter((t) => A(e, t));
|
|
338
338
|
}
|
|
339
339
|
notify(e) {
|
|
340
340
|
u.batch(() => {
|
|
@@ -355,7 +355,7 @@ var ne = class extends N {
|
|
|
355
355
|
function O(e) {
|
|
356
356
|
return e.options.scope?.id;
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function I(e) {
|
|
359
359
|
return {
|
|
360
360
|
onFetch: (t, s) => {
|
|
361
361
|
const i = t.options, n = t.fetchOptions?.meta?.fetchMore?.direction, r = t.state.data?.pages || [], d = t.state.data?.pageParams || [];
|
|
@@ -391,7 +391,7 @@ function T(e) {
|
|
|
391
391
|
};
|
|
392
392
|
};
|
|
393
393
|
if (n && r.length) {
|
|
394
|
-
const o = n === "backward", l = o ? re :
|
|
394
|
+
const o = n === "backward", l = o ? re : T, g = {
|
|
395
395
|
pages: r,
|
|
396
396
|
pageParams: d
|
|
397
397
|
}, v = l(i, g);
|
|
@@ -399,7 +399,7 @@ function T(e) {
|
|
|
399
399
|
} else {
|
|
400
400
|
const o = e ?? r.length;
|
|
401
401
|
do {
|
|
402
|
-
const l = f === 0 ? d[0] ?? i.initialPageParam :
|
|
402
|
+
const l = f === 0 ? d[0] ?? i.initialPageParam : T(i, c);
|
|
403
403
|
if (f > 0 && l == null)
|
|
404
404
|
break;
|
|
405
405
|
c = await m(c, l), f++;
|
|
@@ -420,7 +420,7 @@ function T(e) {
|
|
|
420
420
|
}
|
|
421
421
|
};
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function T(e, { pages: t, pageParams: s }) {
|
|
424
424
|
const i = t.length - 1;
|
|
425
425
|
return t.length > 0 ? e.getNextPageParam(
|
|
426
426
|
t[i],
|
|
@@ -447,7 +447,7 @@ var ae = class {
|
|
|
447
447
|
mount() {
|
|
448
448
|
this.#n++, this.#n === 1 && (this.#a = G.subscribe(async (e) => {
|
|
449
449
|
e && (await this.resumePausedMutations(), this.#e.onFocus());
|
|
450
|
-
}), this.#u =
|
|
450
|
+
}), this.#u = D.subscribe(async (e) => {
|
|
451
451
|
e && (await this.resumePausedMutations(), this.#e.onOnline());
|
|
452
452
|
}));
|
|
453
453
|
}
|
|
@@ -555,16 +555,16 @@ var ae = class {
|
|
|
555
555
|
return this.fetchQuery(e).then(h).catch(h);
|
|
556
556
|
}
|
|
557
557
|
fetchInfiniteQuery(e) {
|
|
558
|
-
return e.behavior =
|
|
558
|
+
return e.behavior = I(e.pages), this.fetchQuery(e);
|
|
559
559
|
}
|
|
560
560
|
prefetchInfiniteQuery(e) {
|
|
561
561
|
return this.fetchInfiniteQuery(e).then(h).catch(h);
|
|
562
562
|
}
|
|
563
563
|
ensureInfiniteQueryData(e) {
|
|
564
|
-
return e.behavior =
|
|
564
|
+
return e.behavior = I(e.pages), this.ensureQueryData(e);
|
|
565
565
|
}
|
|
566
566
|
resumePausedMutations() {
|
|
567
|
-
return
|
|
567
|
+
return D.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
|
|
568
568
|
}
|
|
569
569
|
getQueryCache() {
|
|
570
570
|
return this.#e;
|
|
@@ -655,7 +655,7 @@ const ue = new ae({
|
|
|
655
655
|
useSignalR: i = !1,
|
|
656
656
|
queryClient: n = ue
|
|
657
657
|
}) => {
|
|
658
|
-
const r = b((a) => a.setBaseProps), d = b((a) => a.modulePermissionToken), c = R((a) => a.setEnvironment), f = R((a) => a.addEnvironment), [P, p] =
|
|
658
|
+
const r = b((a) => a.setBaseProps), d = b((a) => a.modulePermissionToken), c = R((a) => a.setEnvironment), f = R((a) => a.addEnvironment), [P, p] = X(!1);
|
|
659
659
|
M(() => {
|
|
660
660
|
const a = de();
|
|
661
661
|
if (p(!a), a && c(a), !s) return;
|
|
@@ -671,14 +671,14 @@ const ue = new ae({
|
|
|
671
671
|
e.currentNavigationPath,
|
|
672
672
|
e.sourcePath
|
|
673
673
|
]);
|
|
674
|
-
const w =
|
|
674
|
+
const w = $([
|
|
675
675
|
{
|
|
676
676
|
path: e.basePath,
|
|
677
677
|
children: t,
|
|
678
678
|
element: /* @__PURE__ */ y(he, {})
|
|
679
679
|
}
|
|
680
680
|
]);
|
|
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(
|
|
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(z, { router: w }) }) }) : /* @__PURE__ */ y("div", { children: "TODO: Show fancy Loadingspinner" });
|
|
682
682
|
}, ce = (e) => Z.every((t) => le(t, e)), le = (e, t) => {
|
|
683
683
|
if (!t[e]) {
|
|
684
684
|
if (t.throwError)
|
|
@@ -688,7 +688,7 @@ const ue = new ae({
|
|
|
688
688
|
return !0;
|
|
689
689
|
}, de = () => {
|
|
690
690
|
const e = window.__env__;
|
|
691
|
-
if (e && e.COMMON_API && e.MODULE_AUTH_API && e.API_PREFIX && e.ENVIRONMENT)
|
|
691
|
+
if (e && (e.API_PREFIX = "/api/v8.0", !!e.COMMON_API && e.MODULE_AUTH_API && e.API_PREFIX && e.ENVIRONMENT))
|
|
692
692
|
return e;
|
|
693
693
|
};
|
|
694
694
|
export {
|
package/package.json
CHANGED