@gen-epix/ui-client-common 4.0.0 → 4.0.2
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/@types/{ui.d.ts → ui-client-common.d.ts} +1 -1
- package/dist/_chunks/ApplicationFooter.js +1 -1
- package/dist/_chunks/ApplicationFooter.js.map +1 -1
- package/dist/_chunks/Breadcrumbs.js +1 -1
- package/dist/_chunks/Breadcrumbs.js.map +1 -1
- package/dist/_chunks/CrudPage.js +293 -293
- package/dist/_chunks/CrudPage.js.map +1 -1
- package/dist/_chunks/GeoFilter.js +1 -1
- package/dist/_chunks/GeoFilter.js.map +1 -1
- package/dist/_chunks/Notifications.js.map +1 -1
- package/dist/_chunks/OutageList.js.map +1 -1
- package/dist/_chunks/QueryClientProvider.js +1 -1
- package/dist/_chunks/QueryClientProvider.js.map +1 -1
- package/dist/_chunks/QueryClientService.js +79 -66
- package/dist/_chunks/QueryClientService.js.map +1 -1
- package/dist/_chunks/Table.js +953 -945
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/TableUtil.js.map +1 -1
- package/dist/_chunks/TextFilter.js +4 -4
- package/dist/_chunks/TextFilter.js.map +1 -1
- package/dist/_chunks/UserInvitationsAdminPage.js +110 -110
- package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
- package/dist/_chunks/_baseFlatten.js +1 -1
- package/dist/_chunks/_baseGet.js +26 -26
- package/dist/_chunks/_baseGet.js.map +1 -1
- package/dist/_chunks/_baseIteratee.js +25 -26
- package/dist/_chunks/_baseIteratee.js.map +1 -1
- package/dist/_chunks/_setToString.js.map +1 -1
- package/dist/_chunks/{chunk-KS7C4IRE.js → chunk-BV7QT456.js} +1041 -1128
- package/dist/_chunks/chunk-BV7QT456.js.map +1 -0
- package/dist/_chunks/format.js +199 -198
- package/dist/_chunks/format.js.map +1 -1
- package/dist/_chunks/index.esm.js +797 -692
- package/dist/_chunks/index.esm.js.map +1 -1
- package/dist/_chunks/isArrayLike.js +1 -2
- package/dist/_chunks/isArrayLike.js.map +1 -1
- package/dist/_chunks/isObject.js +38 -2
- package/dist/_chunks/isObject.js.map +1 -1
- package/dist/_chunks/isSymbol.js +2 -2
- package/dist/_chunks/middleware.js +11 -9
- package/dist/_chunks/middleware.js.map +1 -1
- package/dist/_chunks/oidc-client-ts.js +12 -9
- package/dist/_chunks/oidc-client-ts.js.map +1 -1
- package/dist/_chunks/omit.js +38 -39
- package/dist/_chunks/omit.js.map +1 -1
- package/dist/_chunks/query.js +210 -228
- package/dist/_chunks/query.js.map +1 -1
- package/dist/_chunks/react-oidc-context.js +1 -1
- package/dist/_chunks/react-oidc-context.js.map +1 -1
- package/dist/_chunks/react.js +1 -1
- package/dist/_chunks/react.js.map +1 -1
- package/dist/_chunks/rolldown-runtime.js +2 -2
- package/dist/_chunks/tableStore.js +79 -78
- package/dist/_chunks/tableStore.js.map +1 -1
- package/dist/_chunks/toDate.js +1 -1
- package/dist/_chunks/toDate.js.map +1 -1
- package/dist/_chunks/uniq.js +1 -1
- package/dist/_chunks/uniq.js.map +1 -1
- package/dist/_chunks/useColumnsMenu.js +7 -6
- package/dist/_chunks/useColumnsMenu.js.map +1 -1
- package/dist/_chunks/useMutation.js +19 -16
- package/dist/_chunks/useMutation.js.map +1 -1
- package/dist/_chunks/useQueryMemo.js +156 -169
- package/dist/_chunks/useQueryMemo.js.map +1 -1
- package/dist/_chunks/vanilla.js +1 -1
- package/dist/_chunks/vanilla.js.map +1 -1
- package/dist/_chunks/yup.js +5 -5
- package/dist/_chunks/yup.js.map +1 -1
- package/dist/classes/filters/GeoFilter.d.ts +1 -1
- package/dist/classes/filters/MultiSelectFilter.d.ts +1 -1
- package/dist/classes/services/AuthenticationService/index.js +41 -44
- package/dist/classes/services/AuthenticationService/index.js.map +1 -1
- package/dist/classes/services/BreadcrumbService/index.js.map +1 -1
- package/dist/classes/services/InactivityService/index.js +10 -11
- package/dist/classes/services/InactivityService/index.js.map +1 -1
- package/dist/classes/services/RouterService/index.js +1 -1
- package/dist/components/app/App/index.js +48 -38
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrap/index.js +54 -54
- package/dist/components/app/ApplicationBootstrap/index.js.map +1 -1
- package/dist/components/app/AuthenticationWrapper/index.js +45 -45
- package/dist/components/app/AuthenticationWrapper/index.js.map +1 -1
- package/dist/components/app/AuthorizationWrapper/index.js +7 -7
- package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
- package/dist/components/app/RouterRoot/index.js +53 -53
- package/dist/components/app/RouterRoot/index.js.map +1 -1
- package/dist/components/epi/EpiContactDetailsDialog/EpiContactDetailsDialog.d.ts +2 -2
- package/dist/components/epi/EpiContactDetailsDialog/index.js +28 -26
- package/dist/components/epi/EpiContactDetailsDialog/index.js.map +1 -1
- package/dist/components/filters/BooleanFilterField/index.js +1 -1
- package/dist/components/filters/BooleanFilterField/index.js.map +1 -1
- package/dist/components/filters/DateFilterField/index.js +1 -1
- package/dist/components/filters/DateFilterField/index.js.map +1 -1
- package/dist/components/filters/GeoFilterField/index.js +2 -2
- package/dist/components/filters/GeoFilterField/index.js.map +1 -1
- package/dist/components/filters/MultiSelectFilterField/index.js +2 -2
- package/dist/components/filters/MultiSelectFilterField/index.js.map +1 -1
- package/dist/components/filters/NumberRangeFilterField/index.js +1 -1
- package/dist/components/filters/NumberRangeFilterField/index.js.map +1 -1
- package/dist/components/filters/TextFilterField/index.js +1 -1
- package/dist/components/filters/TextFilterField/index.js.map +1 -1
- package/dist/components/ui/ApplicationBar/index.js +132 -132
- package/dist/components/ui/ApplicationBar/index.js.map +1 -1
- package/dist/components/ui/ConsentDialog/ConsentDialog.d.ts +2 -2
- package/dist/components/ui/ConsentDialog/index.js +11 -11
- package/dist/components/ui/ConsentDialog/index.js.map +1 -1
- package/dist/components/ui/GenericErrorMessage/index.js +1 -1
- package/dist/components/ui/GenericErrorMessage/index.js.map +1 -1
- package/dist/components/ui/LicensesDialog/LicensesDialog.d.ts +2 -2
- package/dist/components/ui/LicensesDialog/index.js +40 -40
- package/dist/components/ui/LicensesDialog/index.js.map +1 -1
- package/dist/components/ui/MyPermissionsDialog/MyPermissionsDialog.d.ts +2 -2
- package/dist/components/ui/MyPermissionsDialog/index.js +21 -21
- package/dist/components/ui/MyPermissionsDialog/index.js.map +1 -1
- package/dist/components/ui/NavLink/index.js +1 -1
- package/dist/components/ui/NavLink/index.js.map +1 -1
- package/dist/components/ui/OrganizationSwitcherDialog/OrganizationSwitcherDialog.d.ts +2 -2
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +43 -43
- package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
- package/dist/components/ui/OutagesDialog/OutagesDialog.d.ts +2 -2
- package/dist/components/ui/OutagesDialog/index.js +14 -14
- package/dist/components/ui/OutagesDialog/index.js.map +1 -1
- package/dist/components/ui/PageContainer/index.js +2 -2
- package/dist/components/ui/PageContainer/index.js.map +1 -1
- package/dist/components/ui/ResponseHandler/index.js +8 -8
- package/dist/components/ui/ResponseHandler/index.js.map +1 -1
- package/dist/components/ui/Sidebar/index.js.map +1 -1
- package/dist/components/ui/Table/TableColumnsEditorDialog.d.ts +2 -2
- package/dist/components/ui/UserFeedbackDialog/UserFeedbackDialog.d.ts +2 -2
- package/dist/components/ui/UserFeedbackDialog/index.js +38 -38
- package/dist/components/ui/UserFeedbackDialog/index.js.map +1 -1
- package/dist/components/ui/UserInactivityConfirmation/index.js +14 -14
- package/dist/components/ui/UserInactivityConfirmation/index.js.map +1 -1
- package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContext.d.ts +5 -0
- package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContextProvider.d.ts +6 -0
- package/dist/context/uiClientCommonConfigContext/index.d.ts +3 -0
- package/dist/context/uiClientCommonConfigContext/index.js +18 -0
- package/dist/context/uiClientCommonConfigContext/index.js.map +1 -0
- package/dist/context/uiClientCommonConfigContext/useUiClientCommonConfigContext.d.ts +2 -0
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +4 -4
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js +4 -4
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +4 -4
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +4 -4
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js +4 -4
- package/dist/dataHooks/useOrganizationsQuery/index.js +4 -4
- package/dist/dataHooks/useUsersQuery/index.js +4 -4
- package/dist/hooks/useColumnsMenu/useColumnsMenu.d.ts +1 -1
- package/dist/hooks/useEditMutation/index.js +6 -6
- package/dist/hooks/useEditMutation/index.js.map +1 -1
- package/dist/hooks/useItemQuery/index.js +8 -8
- package/dist/hooks/useItemQuery/index.js.map +1 -1
- package/dist/locale/en.json +0 -10
- package/dist/locale/nl.json +0 -10
- package/dist/models/dataHooks.d.ts +1 -1
- package/dist/models/table.d.ts +1 -1
- package/dist/models/table.js.map +1 -1
- package/dist/pages/AcceptInvitationPage/index.js +5 -5
- package/dist/pages/AcceptInvitationPage/index.js.map +1 -1
- package/dist/pages/AdminPage/index.js +1 -1
- package/dist/pages/AdminPage/index.js.map +1 -1
- package/dist/pages/ChooseIdentityProviderPage/index.js.map +1 -1
- package/dist/pages/CrudPage/CrudPage.d.ts +2 -2
- package/dist/pages/CrudPage/CrudPageDeleteDialog.d.ts +2 -2
- package/dist/pages/CrudPage/CrudPageEditDialog.d.ts +4 -4
- package/dist/pages/ErrorPage/index.js.map +1 -1
- package/dist/pages/IdentifierIssuersAdminPage/index.js +2 -2
- package/dist/pages/IdentifierIssuersAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +1 -1
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationContactsAdminPage/index.js +3 -3
- package/dist/pages/OrganizationContactsAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationSitesAdminPage/index.js +3 -3
- package/dist/pages/OrganizationSitesAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationsAdminPage/index.js +2 -2
- package/dist/pages/OrganizationsAdminPage/index.js.map +1 -1
- package/dist/pages/OutagesAdminPage/index.js +2 -2
- package/dist/pages/OutagesAdminPage/index.js.map +1 -1
- package/dist/pages/PostLoginPage/index.js.map +1 -1
- package/dist/pages/PostLogoutPage/index.js.map +1 -1
- package/dist/pages/RouterErrorPage/index.js +1 -1
- package/dist/pages/RouterErrorPage/index.js.map +1 -1
- package/dist/pages/UserInvitationsAdminPage/UserInvitationConsumeDialog.d.ts +2 -2
- package/dist/pages/UserInvitationsAdminPage/UserInvitationShareDialog.d.ts +2 -2
- package/dist/pages/UsersAdminPage/index.js +47 -47
- package/dist/pages/UsersAdminPage/index.js.map +1 -1
- package/dist/setup/setup.js +1 -1
- package/dist/setup/setup.js.map +1 -1
- package/dist/utils/MenuDataUtil/MenuDataUtil.d.ts +1 -1
- package/dist/utils/MenuDataUtil/index.js.map +1 -1
- package/dist/utils/StandardConfigUtil/index.js +4 -4
- package/dist/utils/StandardConfigUtil/index.js.map +1 -1
- package/dist/utils/TableUtil/TableUtil.d.ts +1 -1
- package/package.json +7 -7
- package/dist/_chunks/chunk-KS7C4IRE.js.map +0 -1
- package/dist/_chunks/isObjectLike.js +0 -43
- package/dist/_chunks/isObjectLike.js.map +0 -1
- package/dist/components/ui/BackdropSpinner/BackdropSpinner.d.ts +0 -5
- package/dist/components/ui/BackdropSpinner/index.d.ts +0 -1
- package/dist/components/ui/BackdropSpinner/index.js +0 -19
- package/dist/components/ui/BackdropSpinner/index.js.map +0 -1
- package/dist/components/ui/Confirmation/Confirmation.d.ts +0 -2
- package/dist/components/ui/Confirmation/ConfirmationRender.d.ts +0 -11
- package/dist/components/ui/Confirmation/index.d.ts +0 -2
- package/dist/components/ui/Confirmation/index.js +0 -58
- package/dist/components/ui/Confirmation/index.js.map +0 -1
- package/dist/components/ui/CopyToClipboardButton/CopyToClipboardButton.d.ts +0 -13
- package/dist/components/ui/CopyToClipboardButton/index.d.ts +0 -1
- package/dist/components/ui/CopyToClipboardButton/index.js +0 -101
- package/dist/components/ui/CopyToClipboardButton/index.js.map +0 -1
- package/dist/components/ui/Dialog/Dialog.d.ts +0 -27
- package/dist/components/ui/Dialog/index.d.ts +0 -1
- package/dist/components/ui/Dialog/index.js +0 -83
- package/dist/components/ui/Dialog/index.js.map +0 -1
- package/dist/components/ui/LinearProgressWithLabel/LinearProgressWithLabel.d.ts +0 -5
- package/dist/components/ui/LinearProgressWithLabel/index.d.ts +0 -1
- package/dist/components/ui/LinearProgressWithLabel/index.js +0 -31
- package/dist/components/ui/LinearProgressWithLabel/index.js.map +0 -1
- package/dist/components/ui/LoadingIndicator/LoadingIndicator.d.ts +0 -2
- package/dist/components/ui/LoadingIndicator/index.d.ts +0 -1
- package/dist/components/ui/LoadingIndicator/index.js +0 -12
- package/dist/components/ui/LoadingIndicator/index.js.map +0 -1
- package/dist/components/ui/NestedMenu/IconMenuItem.d.ts +0 -18
- package/dist/components/ui/NestedMenu/NestedDropdown.d.ts +0 -17
- package/dist/components/ui/NestedMenu/NestedMenuItem.d.ts +0 -22
- package/dist/components/ui/NestedMenu/index.d.ts +0 -4
- package/dist/components/ui/NestedMenu/index.js +0 -240
- package/dist/components/ui/NestedMenu/index.js.map +0 -1
- package/dist/components/ui/NestedMenu/nestedMenuItemsFromObject.d.ts +0 -11
- package/dist/components/ui/Spinner/Spinner.d.ts +0 -11
- package/dist/components/ui/Spinner/index.d.ts +0 -1
- package/dist/components/ui/Spinner/index.js +0 -63
- package/dist/components/ui/Spinner/index.js.map +0 -1
- package/dist/components/ui/Stepper/Stepper.d.ts +0 -17
- package/dist/components/ui/Stepper/index.d.ts +0 -2
- package/dist/components/ui/Stepper/index.js +0 -126
- package/dist/components/ui/Stepper/index.js.map +0 -1
- package/dist/components/ui/Stepper/stepperModel.d.ts +0 -4
- package/dist/hoc/withDialog/index.d.ts +0 -1
- package/dist/hoc/withDialog/index.js +0 -69
- package/dist/hoc/withDialog/index.js.map +0 -1
- package/dist/hoc/withDialog/withDialog.d.ts +0 -33
- package/dist/models/nestedMenu.d.ts +0 -17
- package/dist/models/nestedMenu.js +0 -0
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import * as
|
|
4
|
-
import { useMemo as
|
|
1
|
+
import { n as e } from "./QueryClientProvider.js";
|
|
2
|
+
import { C as t, b as n, c as r, g as i, l as a, n as o, o as s, p as c, s as l, v as u, w as d, x as f, y as p } from "./query.js";
|
|
3
|
+
import * as m from "react";
|
|
4
|
+
import { useMemo as h } from "react";
|
|
5
5
|
import "react/jsx-runtime";
|
|
6
|
-
//#region ../../node_modules/.pnpm/@tanstack+query-core@5.
|
|
7
|
-
var
|
|
8
|
-
constructor(e, t) {
|
|
9
|
-
super(), this.options = t, this.#e = e, this.#s = null, this.#o = o(), this.bindMethods(), this.setOptions(t);
|
|
10
|
-
}
|
|
6
|
+
//#region ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/queryObserver.js
|
|
7
|
+
var g = class extends r {
|
|
11
8
|
#e;
|
|
12
9
|
#t = void 0;
|
|
13
10
|
#n = void 0;
|
|
@@ -21,51 +18,53 @@ var v = class extends d {
|
|
|
21
18
|
#u;
|
|
22
19
|
#d;
|
|
23
20
|
#f;
|
|
24
|
-
#p;
|
|
25
|
-
|
|
21
|
+
#p = /* @__PURE__ */ new Set();
|
|
22
|
+
constructor(e, t) {
|
|
23
|
+
super(), this.options = t, this.#e = e, this.#o = null, this.bindMethods(), this.setOptions(t);
|
|
24
|
+
}
|
|
26
25
|
bindMethods() {
|
|
27
26
|
this.refetch = this.refetch.bind(this);
|
|
28
27
|
}
|
|
29
28
|
onSubscribe() {
|
|
30
|
-
this.listeners.size === 1 && (this.#t.addObserver(this),
|
|
29
|
+
this.listeners.size === 1 && (this.#t.addObserver(this), v(this.#t, this.options) ? this.#m() : this.updateResult(), this.#y());
|
|
31
30
|
}
|
|
32
31
|
onUnsubscribe() {
|
|
33
32
|
this.hasListeners() || this.destroy();
|
|
34
33
|
}
|
|
35
34
|
shouldFetchOnReconnect() {
|
|
36
|
-
return
|
|
35
|
+
return y(this.#t, this.options, this.options.refetchOnReconnect);
|
|
37
36
|
}
|
|
38
37
|
shouldFetchOnWindowFocus() {
|
|
39
|
-
return
|
|
38
|
+
return y(this.#t, this.options, this.options.refetchOnWindowFocus);
|
|
40
39
|
}
|
|
41
40
|
destroy() {
|
|
42
41
|
this.listeners = /* @__PURE__ */ new Set(), this.#b(), this.#x(), this.#t.removeObserver(this);
|
|
43
42
|
}
|
|
44
43
|
setOptions(e) {
|
|
45
44
|
let t = this.options, r = this.#t;
|
|
46
|
-
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof
|
|
45
|
+
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof p(this.options.enabled, this.#t) != "boolean") throw Error("Expected enabled to be a boolean or a callback that returns a boolean");
|
|
47
46
|
this.#S(), this.#t.setOptions(this.options), t._defaulted && !n(this.options, t) && this.#e.getQueryCache().notify({
|
|
48
47
|
type: "observerOptionsUpdated",
|
|
49
48
|
query: this.#t,
|
|
50
49
|
observer: this
|
|
51
50
|
});
|
|
52
51
|
let i = this.hasListeners();
|
|
53
|
-
i &&
|
|
54
|
-
let
|
|
55
|
-
i && (this.#t !== r ||
|
|
52
|
+
i && b(this.#t, r, this.options, t) && this.#m(), this.updateResult(), i && (this.#t !== r || p(this.options.enabled, this.#t) !== p(t.enabled, this.#t) || p(this.options.staleTime, this.#t) !== p(t.staleTime, this.#t)) && this.#g();
|
|
53
|
+
let a = this.#_();
|
|
54
|
+
i && (this.#t !== r || p(this.options.enabled, this.#t) !== p(t.enabled, this.#t) || a !== this.#f) && this.#v(a);
|
|
56
55
|
}
|
|
57
56
|
getOptimisticResult(e) {
|
|
58
|
-
let t = this.#e.getQueryCache().build(this.#e, e),
|
|
59
|
-
return
|
|
57
|
+
let t = this.#e.getQueryCache().build(this.#e, e), r = this.createResult(t, e);
|
|
58
|
+
return n(this.getCurrentResult(), r) || (this.#r = r, this.#a = this.options, this.#i = this.#t.state), r;
|
|
60
59
|
}
|
|
61
60
|
getCurrentResult() {
|
|
62
61
|
return this.#r;
|
|
63
62
|
}
|
|
64
63
|
trackResult(e, t) {
|
|
65
|
-
return new Proxy(e, { get: (e, n) => (this.trackProp(n), t?.(n),
|
|
64
|
+
return new Proxy(e, { get: (e, n) => (this.trackProp(n), t?.(n), Reflect.get(e, n)) });
|
|
66
65
|
}
|
|
67
66
|
trackProp(e) {
|
|
68
|
-
this.#
|
|
67
|
+
this.#p.add(e);
|
|
69
68
|
}
|
|
70
69
|
getCurrentQuery() {
|
|
71
70
|
return this.#t;
|
|
@@ -74,26 +73,38 @@ var v = class extends d {
|
|
|
74
73
|
return this.fetch({ ...e });
|
|
75
74
|
}
|
|
76
75
|
fetchOptimistic(e) {
|
|
77
|
-
let t = this.#e.defaultQueryOptions(e), n = this.#e.getQueryCache().build(this.#e, t)
|
|
78
|
-
|
|
76
|
+
let t = this.#e.defaultQueryOptions(e), n = this.#e.getQueryCache().build(this.#e, t), r = () => {}, i, a = new Promise((e) => {
|
|
77
|
+
i = e, r = this.#e.getQueryCache().subscribe((i) => {
|
|
78
|
+
i.type === "updated" && i.query.queryHash === n.queryHash && n.state.data !== void 0 && (r(), e(this.createResult(n, t)));
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
return Promise.race([n.fetch().then(() => {
|
|
82
|
+
let e = this.createResult(n, t);
|
|
83
|
+
return i?.(e), e;
|
|
84
|
+
}).finally(() => {
|
|
85
|
+
r();
|
|
86
|
+
}), a]);
|
|
79
87
|
}
|
|
80
88
|
fetch(e) {
|
|
81
|
-
return this.#
|
|
89
|
+
return this.#m({
|
|
82
90
|
...e,
|
|
83
91
|
cancelRefetch: e.cancelRefetch ?? !0
|
|
84
92
|
}).then(() => (this.updateResult(), this.#r));
|
|
85
93
|
}
|
|
86
|
-
#
|
|
94
|
+
#m(e) {
|
|
87
95
|
this.#S();
|
|
88
96
|
let t = this.#t.fetch(this.options, e);
|
|
89
97
|
return e?.throwOnError || (t = t.catch(i)), t;
|
|
90
98
|
}
|
|
99
|
+
#h(e) {
|
|
100
|
+
return !a() && p(this.options.enabled, this.#t) !== !1 && c(e);
|
|
101
|
+
}
|
|
91
102
|
#g() {
|
|
92
103
|
this.#b();
|
|
93
104
|
let e = p(this.options.staleTime, this.#t);
|
|
94
|
-
if (
|
|
95
|
-
let n =
|
|
96
|
-
this.#
|
|
105
|
+
if (this.#r.isStale || !this.#h(e)) return;
|
|
106
|
+
let n = t(this.#r.dataUpdatedAt, e) + 1;
|
|
107
|
+
this.#u = d.setTimeout(() => {
|
|
97
108
|
this.#r.isStale || this.updateResult();
|
|
98
109
|
}, n);
|
|
99
110
|
}
|
|
@@ -101,102 +112,95 @@ var v = class extends d {
|
|
|
101
112
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
|
|
102
113
|
}
|
|
103
114
|
#v(e) {
|
|
104
|
-
this.#x(), this.#
|
|
105
|
-
(this.options.refetchIntervalInBackground ||
|
|
106
|
-
}, this.#
|
|
115
|
+
this.#x(), this.#f = e, !(this.#f === 0 || !this.#h(this.#f)) && (this.#d = d.setInterval(() => {
|
|
116
|
+
(this.options.refetchIntervalInBackground || l.isFocused()) && this.#m();
|
|
117
|
+
}, this.#f));
|
|
107
118
|
}
|
|
108
119
|
#y() {
|
|
109
120
|
this.#g(), this.#v(this.#_());
|
|
110
121
|
}
|
|
111
122
|
#b() {
|
|
112
|
-
this.#
|
|
123
|
+
this.#u !== void 0 && (d.clearTimeout(this.#u), this.#u = void 0);
|
|
113
124
|
}
|
|
114
125
|
#x() {
|
|
115
|
-
this.#
|
|
126
|
+
this.#d !== void 0 && (d.clearInterval(this.#d), this.#d = void 0);
|
|
116
127
|
}
|
|
117
128
|
createResult(e, t) {
|
|
118
|
-
let n = this.#t, r = this.options, i = this.#r,
|
|
129
|
+
let n = this.#t, r = this.options, i = this.#r, a = this.#i, s = this.#a, c = e === n ? this.#n : e.state, { state: l } = e, d = { ...l }, f = !1, m;
|
|
119
130
|
if (t._optimisticResults) {
|
|
120
|
-
let i = this.hasListeners(), a = !i &&
|
|
121
|
-
(a ||
|
|
122
|
-
...
|
|
123
|
-
...l
|
|
124
|
-
}), t._optimisticResults === "isRestoring" && (
|
|
131
|
+
let i = this.hasListeners(), a = !i && v(e, t), s = i && b(e, n, t, r);
|
|
132
|
+
(a || s) && (d = {
|
|
133
|
+
...d,
|
|
134
|
+
...o(l.data, e.options)
|
|
135
|
+
}), t._optimisticResults === "isRestoring" && (d.fetchStatus = "idle");
|
|
125
136
|
}
|
|
126
|
-
let { error:
|
|
127
|
-
|
|
137
|
+
let { error: h, errorUpdatedAt: g, status: _ } = d;
|
|
138
|
+
m = d.data;
|
|
128
139
|
let y = !1;
|
|
129
|
-
if (t.placeholderData !== void 0 &&
|
|
140
|
+
if (t.placeholderData !== void 0 && m === void 0 && _ === "pending") {
|
|
130
141
|
let e;
|
|
131
|
-
i?.isPlaceholderData && t.placeholderData ===
|
|
132
|
-
}
|
|
133
|
-
if (t.select && h !== void 0 && !y) if (i && h === s?.data && t.select === this.#c) h = this.#l;
|
|
134
|
-
else try {
|
|
135
|
-
this.#c = t.select, h = t.select(h), h = m(i?.data, h, t), this.#l = h, this.#s = null;
|
|
136
|
-
} catch (e) {
|
|
137
|
-
this.#s = e;
|
|
142
|
+
i?.isPlaceholderData && t.placeholderData === s?.placeholderData ? (e = i.data, y = !0) : e = typeof t.placeholderData == "function" ? t.placeholderData(this.#l?.state.data, this.#l) : t.placeholderData, e !== void 0 && (_ = "success", m = u(i?.data, e, t), f = !0);
|
|
138
143
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
144
|
+
if (t.select && m !== void 0 && !y) {
|
|
145
|
+
if (i && m === a?.data && t.select === this.#s) m = this.#c;
|
|
146
|
+
else try {
|
|
147
|
+
this.#s = t.select, m = t.select(m), m = u(i?.data, m, t), this.#c = m, this.#o = null;
|
|
148
|
+
} catch (e) {
|
|
149
|
+
this.#o = e;
|
|
150
|
+
}
|
|
151
|
+
} else m === void 0 && (this.#o = null);
|
|
152
|
+
this.#o && (h = this.#o, m = this.#c, g = Date.now(), _ = "error", f = !1);
|
|
153
|
+
let S = d.fetchStatus === "fetching", C = _ === "pending", w = _ === "error", T = C && S, E = m !== void 0;
|
|
154
|
+
return {
|
|
155
|
+
status: _,
|
|
156
|
+
fetchStatus: d.fetchStatus,
|
|
157
|
+
isPending: C,
|
|
158
|
+
isSuccess: _ === "success",
|
|
159
|
+
isError: w,
|
|
160
|
+
isInitialLoading: T,
|
|
161
|
+
isLoading: T,
|
|
162
|
+
data: m,
|
|
163
|
+
dataUpdatedAt: d.dataUpdatedAt,
|
|
164
|
+
error: h,
|
|
165
|
+
errorUpdatedAt: g,
|
|
166
|
+
failureCount: d.fetchFailureCount,
|
|
167
|
+
failureReason: d.fetchFailureReason,
|
|
168
|
+
errorUpdateCount: d.errorUpdateCount,
|
|
155
169
|
isFetched: e.isFetched(),
|
|
156
|
-
isFetchedAfterMount:
|
|
157
|
-
isFetching:
|
|
158
|
-
isRefetching:
|
|
159
|
-
isLoadingError:
|
|
160
|
-
isPaused:
|
|
161
|
-
isPlaceholderData:
|
|
162
|
-
isRefetchError:
|
|
163
|
-
isStale:
|
|
170
|
+
isFetchedAfterMount: d.dataUpdateCount > c.dataUpdateCount || d.errorUpdateCount > c.errorUpdateCount,
|
|
171
|
+
isFetching: S,
|
|
172
|
+
isRefetching: S && !C,
|
|
173
|
+
isLoadingError: w && !E,
|
|
174
|
+
isPaused: d.fetchStatus === "paused",
|
|
175
|
+
isPlaceholderData: f,
|
|
176
|
+
isRefetchError: w && E,
|
|
177
|
+
isStale: x(e, t),
|
|
164
178
|
refetch: this.refetch,
|
|
165
|
-
|
|
166
|
-
isEnabled: a(t.enabled, e) !== !1
|
|
179
|
+
isEnabled: p(t.enabled, e) !== !1
|
|
167
180
|
};
|
|
168
|
-
if (this.options.experimental_prefetchInRender) {
|
|
169
|
-
let t = O.data !== void 0, r = O.status === "error" && !t, i = (e) => {
|
|
170
|
-
r ? e.reject(O.error) : t && e.resolve(O.data);
|
|
171
|
-
}, a = () => {
|
|
172
|
-
i(this.#o = O.promise = o());
|
|
173
|
-
}, s = this.#o;
|
|
174
|
-
switch (s.status) {
|
|
175
|
-
case "pending":
|
|
176
|
-
e.queryHash === n.queryHash && i(s);
|
|
177
|
-
break;
|
|
178
|
-
case "fulfilled":
|
|
179
|
-
(r || O.data !== s.value) && a();
|
|
180
|
-
break;
|
|
181
|
-
case "rejected":
|
|
182
|
-
(!r || O.error !== s.reason) && a();
|
|
183
|
-
break;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
return O;
|
|
187
181
|
}
|
|
188
182
|
updateResult() {
|
|
189
183
|
let e = this.#r, t = this.createResult(this.#t, this.options);
|
|
190
|
-
this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#
|
|
184
|
+
if (this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#l = this.#t), n(t, e)) return;
|
|
185
|
+
this.#r = t;
|
|
186
|
+
let r = (() => {
|
|
191
187
|
if (!e) return !0;
|
|
192
188
|
let { notifyOnChangeProps: t } = this.options, n = typeof t == "function" ? t() : t;
|
|
193
|
-
if (n === "all" || !n && !this.#
|
|
194
|
-
let r = new Set(n ?? this.#
|
|
189
|
+
if (n === "all" || !n && !this.#p.size) return !0;
|
|
190
|
+
let r = new Set(n ?? this.#p);
|
|
195
191
|
return this.options.throwOnError && r.add("error"), Object.keys(this.#r).some((t) => {
|
|
196
192
|
let n = t;
|
|
197
193
|
return this.#r[n] !== e[n] && r.has(n);
|
|
198
194
|
});
|
|
199
|
-
})()
|
|
195
|
+
})();
|
|
196
|
+
s.batch(() => {
|
|
197
|
+
r && this.listeners.forEach((e) => {
|
|
198
|
+
e(this.#r);
|
|
199
|
+
}), this.#e.getQueryCache().notify({
|
|
200
|
+
query: this.#t,
|
|
201
|
+
type: "observerResultsUpdated"
|
|
202
|
+
});
|
|
203
|
+
});
|
|
200
204
|
}
|
|
201
205
|
#S() {
|
|
202
206
|
let e = this.#e.getQueryCache().build(this.#e, this.options);
|
|
@@ -207,42 +211,33 @@ var v = class extends d {
|
|
|
207
211
|
onQueryUpdate() {
|
|
208
212
|
this.updateResult(), this.hasListeners() && this.#y();
|
|
209
213
|
}
|
|
210
|
-
#C(e) {
|
|
211
|
-
s.batch(() => {
|
|
212
|
-
e.listeners && this.listeners.forEach((e) => {
|
|
213
|
-
e(this.#r);
|
|
214
|
-
}), this.#e.getQueryCache().notify({
|
|
215
|
-
query: this.#t,
|
|
216
|
-
type: "observerResultsUpdated"
|
|
217
|
-
});
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
214
|
};
|
|
221
|
-
function
|
|
222
|
-
return
|
|
215
|
+
function _(e, t) {
|
|
216
|
+
return p(t.enabled, e) !== !1 && e.state.data === void 0 && (e.state.status !== "error" || p(t.retryOnMount, e) !== !1);
|
|
223
217
|
}
|
|
224
|
-
function
|
|
225
|
-
return
|
|
218
|
+
function v(e, t) {
|
|
219
|
+
return _(e, t) || e.state.data !== void 0 && y(e, t, t.refetchOnMount);
|
|
226
220
|
}
|
|
227
|
-
function
|
|
228
|
-
if (
|
|
221
|
+
function y(e, t, n) {
|
|
222
|
+
if (p(t.enabled, e) !== !1 && p(t.staleTime, e) !== "static") {
|
|
229
223
|
let r = typeof n == "function" ? n(e) : n;
|
|
230
|
-
return r === "always" || r !== !1 &&
|
|
224
|
+
return r === "always" || r !== !1 && x(e, t);
|
|
231
225
|
}
|
|
232
226
|
return !1;
|
|
233
227
|
}
|
|
234
|
-
function
|
|
235
|
-
return (e !== t ||
|
|
228
|
+
function b(e, t, n, r) {
|
|
229
|
+
return (e !== t || p(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") && x(e, n);
|
|
236
230
|
}
|
|
237
|
-
function
|
|
238
|
-
return
|
|
239
|
-
}
|
|
240
|
-
function w(e, t) {
|
|
241
|
-
return !n(e.getCurrentResult(), t);
|
|
231
|
+
function x(e, t) {
|
|
232
|
+
return p(t.enabled, e) !== !1 && e.isStaleByTime(p(t.staleTime, e));
|
|
242
233
|
}
|
|
243
234
|
//#endregion
|
|
244
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-query@5.
|
|
245
|
-
|
|
235
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js
|
|
236
|
+
var S = m.createContext(!1), C = () => m.useContext(S);
|
|
237
|
+
S.Provider;
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js
|
|
240
|
+
function w() {
|
|
246
241
|
let e = !1;
|
|
247
242
|
return {
|
|
248
243
|
clearReset: () => {
|
|
@@ -254,63 +249,55 @@ function T() {
|
|
|
254
249
|
isReset: () => e
|
|
255
250
|
};
|
|
256
251
|
}
|
|
257
|
-
var
|
|
258
|
-
let
|
|
259
|
-
(
|
|
260
|
-
},
|
|
261
|
-
|
|
252
|
+
var T = m.createContext(w()), E = () => m.useContext(T), D = (e, t, n) => {
|
|
253
|
+
let r = n?.state.error && typeof e.throwOnError == "function" ? f(e.throwOnError, [n.state.error, n]) : e.throwOnError;
|
|
254
|
+
(e.suspense || r) && (t.isReset() || (e.retryOnMount = !1));
|
|
255
|
+
}, O = (e) => {
|
|
256
|
+
m.useEffect(() => {
|
|
262
257
|
e.clearReset();
|
|
263
258
|
}, [e]);
|
|
264
|
-
},
|
|
265
|
-
j.Provider;
|
|
266
|
-
//#endregion
|
|
267
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-query@5.101.2_react@19.2.7/node_modules/@tanstack/react-query/build/modern/suspense.js
|
|
268
|
-
var N = (e) => {
|
|
259
|
+
}, k = ({ result: e, errorResetBoundary: t, throwOnError: n, query: r, suspense: i }) => e.isError && !t.isReset() && !e.isFetching && r && (i && e.data === void 0 || f(n, [e.error, r])), A = (e) => {
|
|
269
260
|
if (e.suspense) {
|
|
270
261
|
let t = 1e3, n = (e) => e === "static" ? e : Math.max(e ?? t, t), r = e.staleTime;
|
|
271
262
|
e.staleTime = typeof r == "function" ? (...e) => n(r(...e)) : n(r), typeof e.gcTime == "number" && (e.gcTime = Math.max(e.gcTime, t));
|
|
272
263
|
}
|
|
273
|
-
},
|
|
264
|
+
}, j = (e, t) => e?.suspense && t.isPending, M = (e, t, n) => t.fetchOptimistic(e).catch(() => {
|
|
274
265
|
n.clearReset();
|
|
275
266
|
});
|
|
276
267
|
//#endregion
|
|
277
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-query@5.
|
|
278
|
-
function
|
|
279
|
-
if (process.env.NODE_ENV !== "production" && (typeof
|
|
280
|
-
let
|
|
281
|
-
|
|
282
|
-
let
|
|
283
|
-
|
|
284
|
-
let
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
}, [
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
})) throw m.error;
|
|
300
|
-
return o.getDefaultOptions().queries?._experimental_afterQuery?.(c, m), c.experimental_prefetchInRender && !f.isServer() && P(m, r) && (d ? I(c, p, a) : l?.promise)?.catch(i).finally(() => {
|
|
301
|
-
p.updateResult();
|
|
302
|
-
}), c.notifyOnChangeProps ? m : p.trackResult(m);
|
|
268
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js
|
|
269
|
+
function N(t, n, r) {
|
|
270
|
+
if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t))) throw Error("Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object");
|
|
271
|
+
let a = C(), o = E(), c = e(r), l = c.defaultQueryOptions(t), u = c.getQueryCache().get(l.queryHash);
|
|
272
|
+
process.env.NODE_ENV !== "production" && (l.queryFn || console.error(`[${l.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`));
|
|
273
|
+
let d = t.subscribed !== !1;
|
|
274
|
+
l._optimisticResults = a ? "isRestoring" : d ? "optimistic" : void 0, A(l), D(l, o, u), O(o);
|
|
275
|
+
let [f] = m.useState(() => new n(c, l)), p = f.getOptimisticResult(l), h = !a && d;
|
|
276
|
+
if (m.useSyncExternalStore(m.useCallback((e) => {
|
|
277
|
+
let t = h ? f.subscribe(s.batchCalls(e)) : i;
|
|
278
|
+
return f.updateResult(), t;
|
|
279
|
+
}, [f, h]), () => f.getCurrentResult(), () => f.getCurrentResult()), m.useEffect(() => {
|
|
280
|
+
f.setOptions(l);
|
|
281
|
+
}, [l, f]), j(l, p)) throw M(l, f, o);
|
|
282
|
+
if (k({
|
|
283
|
+
result: p,
|
|
284
|
+
errorResetBoundary: o,
|
|
285
|
+
throwOnError: l.throwOnError,
|
|
286
|
+
query: u,
|
|
287
|
+
suspense: l.suspense
|
|
288
|
+
})) throw p.error;
|
|
289
|
+
return l.notifyOnChangeProps ? p : f.trackResult(p);
|
|
303
290
|
}
|
|
304
291
|
//#endregion
|
|
305
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-query@5.
|
|
306
|
-
function
|
|
307
|
-
return
|
|
292
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/useQuery.js
|
|
293
|
+
function P(e, t) {
|
|
294
|
+
return N(e, g, t);
|
|
308
295
|
}
|
|
309
296
|
//#endregion
|
|
310
297
|
//#region src/hooks/useQueryMemo/useQueryMemo.ts
|
|
311
|
-
var
|
|
312
|
-
let n =
|
|
313
|
-
return
|
|
298
|
+
var F = (e, t) => {
|
|
299
|
+
let n = P(e, t);
|
|
300
|
+
return h(() => n, [JSON.stringify({
|
|
314
301
|
data: n.data,
|
|
315
302
|
error: n.error,
|
|
316
303
|
isEnabled: n.isEnabled,
|
|
@@ -320,6 +307,6 @@ var z = (e, t) => {
|
|
|
320
307
|
})]);
|
|
321
308
|
};
|
|
322
309
|
//#endregion
|
|
323
|
-
export {
|
|
310
|
+
export { F as t };
|
|
324
311
|
|
|
325
312
|
//# sourceMappingURL=useQueryMemo.js.map
|