@gen-epix/ui-client-common 4.6.1 → 4.7.0
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/README.md +2 -2
- package/dist/_chunks/Breadcrumbs.js +4 -4
- package/dist/_chunks/CrudPage.js +166 -166
- package/dist/_chunks/CrudPage.js.map +1 -1
- package/dist/_chunks/Notifications.js +16 -16
- package/dist/_chunks/QueryClientProvider.js +1 -1
- package/dist/_chunks/QueryClientProvider.js.map +1 -1
- package/dist/_chunks/QueryClientService.js +73 -72
- package/dist/_chunks/QueryClientService.js.map +1 -1
- package/dist/_chunks/Table.js +853 -744
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/TableUtil.js +38 -38
- package/dist/_chunks/TableUtil.js.map +1 -1
- package/dist/_chunks/UserInvitationsAdminPage.js +131 -131
- package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
- package/dist/_chunks/_baseFlatten.js +12 -12
- package/dist/_chunks/_baseFlatten.js.map +1 -1
- package/dist/_chunks/_baseIteratee.js +78 -78
- package/dist/_chunks/_baseIteratee.js.map +1 -1
- package/dist/_chunks/decorate.js +1 -1
- package/dist/_chunks/decorateParam.js +1 -1
- package/dist/_chunks/middleware.js +66 -70
- package/dist/_chunks/middleware.js.map +1 -1
- package/dist/_chunks/omit.js +98 -98
- package/dist/_chunks/omit.js.map +1 -1
- package/dist/_chunks/query.js +108 -92
- package/dist/_chunks/query.js.map +1 -1
- package/dist/_chunks/react.js +1 -1
- package/dist/_chunks/react.js.map +1 -1
- package/dist/_chunks/tableStore.js +61 -58
- package/dist/_chunks/tableStore.js.map +1 -1
- package/dist/_chunks/useColumnsMenu.js +73 -71
- package/dist/_chunks/useColumnsMenu.js.map +1 -1
- package/dist/_chunks/useMutation.js +2 -2
- package/dist/_chunks/useMutation.js.map +1 -1
- package/dist/_chunks/useQueryMemo.js +15 -16
- 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 +2 -2
- package/dist/_chunks/yup.js.map +1 -1
- package/dist/classes/services/AuthenticationService/index.js +8 -8
- package/dist/classes/services/AuthenticationService/index.js.map +1 -1
- package/dist/classes/services/AuthorizationService/index.js +4 -4
- package/dist/classes/services/AuthorizationService/index.js.map +1 -1
- package/dist/classes/services/BreadcrumbService/index.js +4 -4
- package/dist/classes/services/BreadcrumbService/index.js.map +1 -1
- package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
- package/dist/classes/services/InactivityService/index.js +30 -30
- package/dist/classes/services/InactivityService/index.js.map +1 -1
- package/dist/classes/services/LogService/index.js +15 -15
- package/dist/classes/services/LogService/index.js.map +1 -1
- package/dist/classes/services/PageEventBusService/index.js.map +1 -1
- package/dist/components/app/App/index.js +26 -24
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +18 -18
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +18 -18
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -1
- package/dist/components/app/AuthenticationWrapper/index.js +15 -15
- package/dist/components/app/AuthorizationWrapper/index.js +16 -16
- package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
- package/dist/components/app/RouterRoot/index.js +33 -33
- package/dist/components/app/RouterRoot/index.js.map +1 -1
- package/dist/components/epi/EpiContactDetailsDialog/index.js +4 -4
- package/dist/components/epi/EpiContactDetailsDialog/index.js.map +1 -1
- package/dist/components/ui/ApplicationBar/index.js +234 -234
- package/dist/components/ui/ApplicationBar/index.js.map +1 -1
- package/dist/components/ui/GenericErrorMessage/index.js +13 -13
- package/dist/components/ui/LicensesDialog/index.js +6 -6
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +11 -11
- package/dist/components/ui/OutagesDialog/index.js +4 -4
- package/dist/components/ui/OutagesDialog/index.js.map +1 -1
- package/dist/components/ui/PageContainer/index.js +5 -5
- package/dist/components/ui/PageContainer/index.js.map +1 -1
- package/dist/components/ui/ResponseHandler/index.js +4 -4
- package/dist/components/ui/SortableList/SortableList.d.ts +5 -3
- package/dist/components/ui/Table/Table.d.ts +5 -2
- package/dist/components/ui/Table/TableColumnsEditorDialog.d.ts +13 -2
- package/dist/components/ui/Table/index.d.ts +1 -0
- package/dist/components/ui/Table/index.js +1 -1
- package/dist/components/ui/UserFeedbackDialog/index.js +15 -15
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +12 -12
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js +11 -11
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +5 -5
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +15 -15
- package/dist/dataHooks/useOrganizationsQuery/index.js +7 -7
- package/dist/dataHooks/useUsersQuery/index.js +10 -10
- package/dist/hooks/useCreateMutation/index.js +14 -14
- package/dist/hooks/useCreateMutation/index.js.map +1 -1
- package/dist/hooks/useDeleteMutation/index.js +17 -17
- package/dist/hooks/useDeleteMutation/index.js.map +1 -1
- package/dist/hooks/useEditMutation/index.js +22 -22
- package/dist/hooks/useEditMutation/index.js.map +1 -1
- package/dist/hooks/useInitializeTableStore/index.js +6 -6
- package/dist/hooks/useInitializeTableStore/index.js.map +1 -1
- package/dist/locale/en.json +13 -5
- package/dist/locale/nl.json +13 -5
- package/dist/pages/AcceptInvitationPage/index.js +10 -10
- package/dist/pages/AdminPage/index.js +19 -19
- package/dist/pages/ChooseIdentityProviderPage/index.js +5 -5
- package/dist/pages/ErrorPage/index.js +4 -4
- package/dist/pages/IdentifierIssuersAdminPage/index.js +7 -7
- package/dist/pages/IdentifierIssuersAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +16 -16
- package/dist/pages/OrganizationContactsAdminPage/index.js +10 -10
- package/dist/pages/OrganizationContactsAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationSitesAdminPage/index.js +12 -12
- package/dist/pages/OrganizationSitesAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationsAdminPage/index.js +20 -20
- package/dist/pages/OrganizationsAdminPage/index.js.map +1 -1
- package/dist/pages/OutagesAdminPage/index.js +11 -11
- package/dist/pages/OutagesAdminPage/index.js.map +1 -1
- package/dist/pages/RouterErrorPage/index.js +4 -4
- package/dist/pages/UsersAdminPage/index.js +34 -34
- package/dist/pages/UsersAdminPage/index.js.map +1 -1
- package/dist/setup/setup.js +4 -4
- package/dist/setup/setup.js.map +1 -1
- package/dist/stores/oidcStore/oidcStore.d.ts +1 -1
- package/dist/utils/StandardConfigUtil/index.js +2 -2
- package/dist/utils/StandardConfigUtil/index.js.map +1 -1
- package/package.json +33 -33
package/dist/_chunks/query.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/@tanstack+query-core@5.
|
|
1
|
+
// ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/timeoutManager.js
|
|
2
2
|
var e = {
|
|
3
3
|
setTimeout: (e, t) => setTimeout(e, t),
|
|
4
4
|
clearTimeout: (e) => clearTimeout(e),
|
|
@@ -29,7 +29,7 @@ var e = {
|
|
|
29
29
|
function n(e) {
|
|
30
30
|
setTimeout(e, 0);
|
|
31
31
|
}
|
|
32
|
-
// ../../node_modules/.pnpm/@tanstack+query-core@5.
|
|
32
|
+
// ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/utils.js
|
|
33
33
|
var r = typeof window > "u" || "Deno" in globalThis;
|
|
34
34
|
function i() {}
|
|
35
35
|
function a(e, t) {
|
|
@@ -112,7 +112,7 @@ function h(e, t, n = 0) {
|
|
|
112
112
|
}
|
|
113
113
|
function g(e, t) {
|
|
114
114
|
if (!t || Object.keys(e).length !== Object.keys(t).length) return !1;
|
|
115
|
-
for (let n
|
|
115
|
+
for (let n of Object.keys(e)) if (!m.call(t, n) || e[n] !== t[n]) return !1;
|
|
116
116
|
return !0;
|
|
117
117
|
}
|
|
118
118
|
function _(e) {
|
|
@@ -148,11 +148,11 @@ function x(e, t, n) {
|
|
|
148
148
|
}
|
|
149
149
|
function S(e, t, n = 0) {
|
|
150
150
|
let r = [...e, t];
|
|
151
|
-
return n && r.length > n ? r.slice(
|
|
151
|
+
return n && r.length > n ? r.slice(-n) : r;
|
|
152
152
|
}
|
|
153
153
|
function C(e, t, n = 0) {
|
|
154
154
|
let r = [t, ...e];
|
|
155
|
-
return n && r.length > n ? r.slice(0,
|
|
155
|
+
return n && r.length > n ? r.slice(0, n) : r;
|
|
156
156
|
}
|
|
157
157
|
var w = Symbol();
|
|
158
158
|
function T(e, t) {
|
|
@@ -161,15 +161,19 @@ function T(e, t) {
|
|
|
161
161
|
function E(e, t) {
|
|
162
162
|
return typeof e == "function" ? e(...t) : !!e;
|
|
163
163
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
164
|
+
var D = Symbol();
|
|
165
|
+
function O(e, t, n, r) {
|
|
166
|
+
let i = !1, a;
|
|
167
|
+
return Object.defineProperties(e, {
|
|
168
|
+
[D]: { value: r },
|
|
169
|
+
signal: {
|
|
170
|
+
enumerable: !0,
|
|
171
|
+
get: () => (a ??= t(), i || (i = !0, a.aborted ? n() : a.addEventListener("abort", n, { once: !0 })), a)
|
|
172
|
+
}
|
|
169
173
|
}), e;
|
|
170
174
|
}
|
|
171
|
-
// ../../node_modules/.pnpm/@tanstack+query-core@5.
|
|
172
|
-
var
|
|
175
|
+
// ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/environmentManager.js
|
|
176
|
+
var k = () => r, A = () => k(), j = class {
|
|
173
177
|
constructor() {
|
|
174
178
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
175
179
|
}
|
|
@@ -183,7 +187,7 @@ var O = () => r, k = () => O(), A = class {
|
|
|
183
187
|
}
|
|
184
188
|
onSubscribe() {}
|
|
185
189
|
onUnsubscribe() {}
|
|
186
|
-
},
|
|
190
|
+
}, M = new class extends j {
|
|
187
191
|
#e;
|
|
188
192
|
#t;
|
|
189
193
|
#n;
|
|
@@ -220,13 +224,13 @@ var O = () => r, k = () => O(), A = class {
|
|
|
220
224
|
isFocused() {
|
|
221
225
|
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
222
226
|
}
|
|
223
|
-
}(),
|
|
224
|
-
function
|
|
227
|
+
}(), N = n;
|
|
228
|
+
function P() {
|
|
225
229
|
let e = [], t = 0, n = (e) => {
|
|
226
230
|
e();
|
|
227
231
|
}, r = (e) => {
|
|
228
232
|
e();
|
|
229
|
-
}, i =
|
|
233
|
+
}, i = N, a = (r) => {
|
|
230
234
|
t ? e.push(r) : i(() => {
|
|
231
235
|
n(r);
|
|
232
236
|
});
|
|
@@ -268,7 +272,7 @@ function N() {
|
|
|
268
272
|
}
|
|
269
273
|
};
|
|
270
274
|
}
|
|
271
|
-
var
|
|
275
|
+
var F = P(), I = new class extends j {
|
|
272
276
|
#e = !0;
|
|
273
277
|
#t;
|
|
274
278
|
#n;
|
|
@@ -300,33 +304,33 @@ var P = N(), F = new class extends A {
|
|
|
300
304
|
return this.#e;
|
|
301
305
|
}
|
|
302
306
|
}();
|
|
303
|
-
// ../../node_modules/.pnpm/@tanstack+query-core@5.
|
|
304
|
-
function
|
|
307
|
+
// ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/retryer.js
|
|
308
|
+
function L(e) {
|
|
305
309
|
return Math.min(1e3 * 2 ** e, 3e4);
|
|
306
310
|
}
|
|
307
|
-
function
|
|
308
|
-
return (e ?? "online") !== "online" ||
|
|
311
|
+
function R(e) {
|
|
312
|
+
return (e ?? "online") !== "online" || I.isOnline();
|
|
309
313
|
}
|
|
310
|
-
var
|
|
314
|
+
var z = class extends Error {
|
|
311
315
|
constructor(e) {
|
|
312
316
|
super("CancelledError"), this.revert = e?.revert, this.silent = e?.silent;
|
|
313
317
|
}
|
|
314
318
|
};
|
|
315
|
-
function
|
|
319
|
+
function B(e) {
|
|
316
320
|
let t = !1, n = 0, r, a = "pending", o, s, c = new Promise((e, t) => {
|
|
317
321
|
o = e, s = t;
|
|
318
322
|
});
|
|
319
323
|
c.catch(i);
|
|
320
324
|
let l = () => a !== "pending", u = (t) => {
|
|
321
325
|
if (!l()) {
|
|
322
|
-
let n = new
|
|
326
|
+
let n = new z(t);
|
|
323
327
|
g(n), e.onCancel?.(n);
|
|
324
328
|
}
|
|
325
329
|
}, d = () => {
|
|
326
330
|
t = !0;
|
|
327
331
|
}, f = () => {
|
|
328
332
|
t = !1;
|
|
329
|
-
}, p = () =>
|
|
333
|
+
}, p = () => M.isFocused() && (e.networkMode === "always" || I.isOnline()) && e.canRun(), m = () => R(e.networkMode) && e.canRun(), h = (e) => {
|
|
330
334
|
l() || (r?.(), a = "resolved", o(e));
|
|
331
335
|
}, g = (e) => {
|
|
332
336
|
l() || (r?.(), a = "rejected", s(e));
|
|
@@ -346,8 +350,8 @@ function z(e) {
|
|
|
346
350
|
}
|
|
347
351
|
Promise.resolve(r).then(h).catch((r) => {
|
|
348
352
|
if (l()) return;
|
|
349
|
-
let i = e.retry ?? (
|
|
350
|
-
t || !s ? g(r) : (n++, e.onFail?.(n, r), b(o).then(() => p() ? void 0 : _(p)).then(() => {
|
|
353
|
+
let i = e.retry ?? (A() ? 0 : 3), a = e.retryDelay ?? L, o = typeof a == "function" ? a(n, r) : a, s = i === !0 || typeof i == "number" && n < i || typeof i == "function" && i(n, r);
|
|
354
|
+
t || !s ? g(r) : (n++, e.onFail?.(n, r), b(o).then(() => l() || p() ? void 0 : _(p)).then(() => {
|
|
351
355
|
t ? g(r) : v();
|
|
352
356
|
}));
|
|
353
357
|
});
|
|
@@ -363,8 +367,8 @@ function z(e) {
|
|
|
363
367
|
start: () => (m() ? v() : _(m).then(v), c)
|
|
364
368
|
};
|
|
365
369
|
}
|
|
366
|
-
// ../../node_modules/.pnpm/@tanstack+query-core@5.
|
|
367
|
-
var
|
|
370
|
+
// ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/removable.js
|
|
371
|
+
var V = class {
|
|
368
372
|
#e;
|
|
369
373
|
destroy() {
|
|
370
374
|
this.clearGcTimeout();
|
|
@@ -375,22 +379,22 @@ var B = class {
|
|
|
375
379
|
}, this.gcTime));
|
|
376
380
|
}
|
|
377
381
|
updateGcTime(e) {
|
|
378
|
-
this.gcTime = Math.max(this.gcTime || 0, e ?? (
|
|
382
|
+
this.gcTime = Math.max(this.gcTime || 0, e ?? (A() ? Infinity : 3e5));
|
|
379
383
|
}
|
|
380
384
|
clearGcTimeout() {
|
|
381
385
|
this.#e !== void 0 && (t.clearTimeout(this.#e), this.#e = void 0);
|
|
382
386
|
}
|
|
383
387
|
};
|
|
384
|
-
// ../../node_modules/.pnpm/@tanstack+query-core@5.
|
|
385
|
-
function
|
|
388
|
+
// ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
|
|
389
|
+
function H(e) {
|
|
386
390
|
return { onFetch: (t, n) => {
|
|
387
391
|
let r = t.options, i = t.fetchOptions?.meta?.fetchMore?.direction, a = t.state.data?.pages || [], o = t.state.data?.pageParams || [], s = {
|
|
388
392
|
pages: [],
|
|
389
393
|
pageParams: []
|
|
390
394
|
}, c = 0, l = async () => {
|
|
391
|
-
let n = !1, l = (e) => {
|
|
392
|
-
|
|
393
|
-
},
|
|
395
|
+
let n = !1, l = t, u = (e) => {
|
|
396
|
+
O(e, () => t.signal, () => n = !0, l[D]);
|
|
397
|
+
}, d = T(t.options, t.fetchOptions), f = async (e, r, i) => {
|
|
394
398
|
if (n) return Promise.reject(t.signal.reason);
|
|
395
399
|
if (r == null && e.pages.length) return Promise.resolve(e);
|
|
396
400
|
let a = (() => {
|
|
@@ -401,25 +405,25 @@ function V(e) {
|
|
|
401
405
|
direction: i ? "backward" : "forward",
|
|
402
406
|
meta: t.options.meta
|
|
403
407
|
};
|
|
404
|
-
return
|
|
405
|
-
})(), o = await
|
|
408
|
+
return u(e), e;
|
|
409
|
+
})(), o = await d(a), { maxPages: s } = t.options, c = i ? C : S;
|
|
406
410
|
return {
|
|
407
411
|
pages: c(e.pages, o, s),
|
|
408
412
|
pageParams: c(e.pageParams, r, s)
|
|
409
413
|
};
|
|
410
414
|
};
|
|
411
415
|
if (i && a.length) {
|
|
412
|
-
let e = i === "backward", t = e ?
|
|
416
|
+
let e = i === "backward", t = e ? W : U, n = {
|
|
413
417
|
pages: a,
|
|
414
418
|
pageParams: o
|
|
415
419
|
};
|
|
416
|
-
s = await
|
|
420
|
+
s = await f(n, t(r, n), e);
|
|
417
421
|
} else {
|
|
418
422
|
let t = e ?? a.length;
|
|
419
423
|
do {
|
|
420
|
-
let e = c === 0 ? o[0] === void 0 ? r.initialPageParam : o[0] :
|
|
424
|
+
let e = c === 0 ? o[0] === void 0 ? r.initialPageParam : o[0] : U(r, s);
|
|
421
425
|
if (c > 0 && e == null) break;
|
|
422
|
-
s = await
|
|
426
|
+
s = await f(s, e), c++;
|
|
423
427
|
} while (c < t);
|
|
424
428
|
}
|
|
425
429
|
return s;
|
|
@@ -432,15 +436,15 @@ function V(e) {
|
|
|
432
436
|
}, n) : l;
|
|
433
437
|
} };
|
|
434
438
|
}
|
|
435
|
-
function
|
|
439
|
+
function U(e, { pages: t, pageParams: n }) {
|
|
436
440
|
let r = t.length - 1;
|
|
437
441
|
return t.length > 0 ? e.getNextPageParam(t[r], t, n[r], n) : void 0;
|
|
438
442
|
}
|
|
439
|
-
function
|
|
443
|
+
function W(e, { pages: t, pageParams: n }) {
|
|
440
444
|
return t.length > 0 ? e.getPreviousPageParam?.(t[0], t, n[0], n) : void 0;
|
|
441
445
|
}
|
|
442
|
-
// ../../node_modules/.pnpm/@tanstack+query-core@5.
|
|
443
|
-
var
|
|
446
|
+
// ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/query.js
|
|
447
|
+
var G = class extends V {
|
|
444
448
|
#e;
|
|
445
449
|
#t;
|
|
446
450
|
#n;
|
|
@@ -449,8 +453,9 @@ var W = class extends B {
|
|
|
449
453
|
#a;
|
|
450
454
|
#o;
|
|
451
455
|
#s;
|
|
456
|
+
#c;
|
|
452
457
|
constructor(e) {
|
|
453
|
-
super(), this.#
|
|
458
|
+
super(), this.#c = !1, this.#s = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#i = e.client, this.#r = this.#i.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#t = J(this.options), this.state = e.state ?? this.#t, this.scheduleGc();
|
|
454
459
|
}
|
|
455
460
|
get meta() {
|
|
456
461
|
return this.options.meta;
|
|
@@ -463,11 +468,11 @@ var W = class extends B {
|
|
|
463
468
|
}
|
|
464
469
|
setOptions(e) {
|
|
465
470
|
if (this.options = {
|
|
466
|
-
...this.#
|
|
471
|
+
...this.#s,
|
|
467
472
|
...e
|
|
468
473
|
}, e?._type && (this.#e = e._type), this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
|
|
469
|
-
let e =
|
|
470
|
-
e.data !== void 0 && (this.setState(
|
|
474
|
+
let e = J(this.options);
|
|
475
|
+
e.data !== void 0 && (this.setState(q(e.data, e.dataUpdatedAt)), this.#t = e);
|
|
471
476
|
}
|
|
472
477
|
}
|
|
473
478
|
optionalRemove() {
|
|
@@ -475,7 +480,7 @@ var W = class extends B {
|
|
|
475
480
|
}
|
|
476
481
|
setData(e, t) {
|
|
477
482
|
let n = x(this.state.data, e, this.options);
|
|
478
|
-
return this.#
|
|
483
|
+
return this.#l({
|
|
479
484
|
data: n,
|
|
480
485
|
type: "success",
|
|
481
486
|
dataUpdatedAt: t?.updatedAt,
|
|
@@ -483,7 +488,7 @@ var W = class extends B {
|
|
|
483
488
|
}), n;
|
|
484
489
|
}
|
|
485
490
|
setState(e) {
|
|
486
|
-
this.#
|
|
491
|
+
this.#l({
|
|
487
492
|
type: "setState",
|
|
488
493
|
state: e
|
|
489
494
|
});
|
|
@@ -511,7 +516,7 @@ var W = class extends B {
|
|
|
511
516
|
return this.state.dataUpdateCount + this.state.errorUpdateCount > 0;
|
|
512
517
|
}
|
|
513
518
|
isStatic() {
|
|
514
|
-
return this.getObserversCount() > 0 && this.observers.some((e) => c(e.options.staleTime, this) === "static");
|
|
519
|
+
return this.state.data !== void 0 && this.getObserversCount() > 0 && this.observers.some((e) => c(e.options.staleTime, this) === "static");
|
|
515
520
|
}
|
|
516
521
|
isStale() {
|
|
517
522
|
return this.getObserversCount() > 0 ? this.observers.some((e) => e.getCurrentResult().isStale) : this.state.data === void 0 || this.state.isInvalidated;
|
|
@@ -534,7 +539,7 @@ var W = class extends B {
|
|
|
534
539
|
}
|
|
535
540
|
removeObserver(e) {
|
|
536
541
|
let t = this.observers.indexOf(e);
|
|
537
|
-
t !== -1 && (this.observers.splice(t, 1), this.observers.length || (this.#a && (this.#
|
|
542
|
+
t !== -1 && (this.observers.splice(t, 1), this.observers.length || (this.#a && (this.#c || this.state.fetchStatus === "paused" && this.state.status === "pending" ? this.#a.cancel({ revert: !0 }) : this.#a.cancelRetry()), this.scheduleGc()), this.#r.notify({
|
|
538
543
|
type: "observerRemoved",
|
|
539
544
|
query: this,
|
|
540
545
|
observer: e
|
|
@@ -544,12 +549,12 @@ var W = class extends B {
|
|
|
544
549
|
return this.observers.length;
|
|
545
550
|
}
|
|
546
551
|
invalidate() {
|
|
547
|
-
this.state.isInvalidated || this.#
|
|
552
|
+
this.state.isInvalidated || this.#l({ type: "invalidate" });
|
|
548
553
|
}
|
|
549
554
|
async fetch(e, t) {
|
|
550
555
|
if (this.state.fetchStatus !== "idle" && this.#a?.status() !== "rejected") {
|
|
551
556
|
if (this.state.data !== void 0 && t?.cancelRefetch) this.cancel({ silent: !0 });
|
|
552
|
-
else if (this.#a) return this.#a.continueRetry(), this.#
|
|
557
|
+
else if (this.#a && this.#o) return this.#a.continueRetry(), this.#o;
|
|
553
558
|
}
|
|
554
559
|
if (e && this.setOptions(e), !this.options.queryFn) {
|
|
555
560
|
let e = this.observers.find((e) => e.options.queryFn);
|
|
@@ -557,9 +562,15 @@ var W = class extends B {
|
|
|
557
562
|
}
|
|
558
563
|
process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));
|
|
559
564
|
let n = new AbortController(), r = (e) => {
|
|
560
|
-
Object.
|
|
561
|
-
|
|
562
|
-
|
|
565
|
+
Object.defineProperties(e, {
|
|
566
|
+
[D]: {
|
|
567
|
+
value: n.signal,
|
|
568
|
+
enumerable: !0
|
|
569
|
+
},
|
|
570
|
+
signal: {
|
|
571
|
+
enumerable: !0,
|
|
572
|
+
get: () => (this.#c = !0, n.signal)
|
|
573
|
+
}
|
|
563
574
|
});
|
|
564
575
|
}, i = () => {
|
|
565
576
|
let e = T(this.options, t), n = (() => {
|
|
@@ -570,7 +581,7 @@ var W = class extends B {
|
|
|
570
581
|
};
|
|
571
582
|
return r(e), e;
|
|
572
583
|
})();
|
|
573
|
-
return this.#
|
|
584
|
+
return this.#c = !1, this.options.persister ? this.options.persister(e, n, this) : e(n);
|
|
574
585
|
}, a = (() => {
|
|
575
586
|
let e = {
|
|
576
587
|
fetchOptions: t,
|
|
@@ -582,58 +593,63 @@ var W = class extends B {
|
|
|
582
593
|
};
|
|
583
594
|
return r(e), e;
|
|
584
595
|
})();
|
|
585
|
-
(this.#e === "infinite" ?
|
|
596
|
+
(this.#e === "infinite" ? H(this.options.pages) : this.options.behavior)?.onFetch(a, this), this.#n = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== a.fetchOptions?.meta) && this.#l({
|
|
586
597
|
type: "fetch",
|
|
587
598
|
meta: a.fetchOptions?.meta
|
|
588
599
|
});
|
|
589
|
-
let o = this.#a =
|
|
600
|
+
let o = this.#a = B({
|
|
590
601
|
initialPromise: t?.initialPromise,
|
|
591
602
|
fn: a.fetchFn,
|
|
592
603
|
onCancel: (e) => {
|
|
593
|
-
e instanceof
|
|
604
|
+
e instanceof z && e.revert && this.setState({
|
|
594
605
|
...this.#n,
|
|
595
606
|
fetchStatus: "idle"
|
|
596
607
|
}), n.abort();
|
|
597
608
|
},
|
|
598
609
|
onFail: (e, t) => {
|
|
599
|
-
this.#
|
|
610
|
+
this.#l({
|
|
600
611
|
type: "failed",
|
|
601
612
|
failureCount: e,
|
|
602
613
|
error: t
|
|
603
614
|
});
|
|
604
615
|
},
|
|
605
616
|
onPause: () => {
|
|
606
|
-
this.#
|
|
617
|
+
this.#l({ type: "pause" });
|
|
607
618
|
},
|
|
608
619
|
onContinue: () => {
|
|
609
|
-
this.#
|
|
620
|
+
this.#l({ type: "continue" });
|
|
610
621
|
},
|
|
611
622
|
retry: a.options.retry,
|
|
612
623
|
retryDelay: a.options.retryDelay,
|
|
613
624
|
networkMode: a.options.networkMode,
|
|
614
625
|
canRun: () => !0
|
|
615
|
-
})
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
+
}), s = (async () => {
|
|
627
|
+
try {
|
|
628
|
+
let e = await o.promise;
|
|
629
|
+
if (e === void 0) throw process.env.NODE_ENV !== "production" && console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`), Error(`${this.queryHash} data is undefined`);
|
|
630
|
+
return this.setData(e), this.#r.config.onSuccess?.(e, this), this.#r.config.onSettled?.(e, this.state.error, this), e;
|
|
631
|
+
} catch (e) {
|
|
632
|
+
if (e instanceof z) {
|
|
633
|
+
if (e.silent) {
|
|
634
|
+
if (this.#a !== o && this.#o) return this.#o;
|
|
635
|
+
throw e;
|
|
636
|
+
}
|
|
637
|
+
if (e.revert) {
|
|
638
|
+
if (this.state.data === void 0) throw e;
|
|
639
|
+
return this.state.data;
|
|
640
|
+
}
|
|
626
641
|
}
|
|
642
|
+
throw this.#l({
|
|
643
|
+
type: "error",
|
|
644
|
+
error: e
|
|
645
|
+
}), this.#r.config.onError?.(e, this), this.#r.config.onSettled?.(this.state.data, e, this), e;
|
|
646
|
+
} finally {
|
|
647
|
+
this.#a === o && (this.#a = void 0, this.#o = void 0), this.scheduleGc();
|
|
627
648
|
}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
error: e
|
|
631
|
-
}), this.#r.config.onError?.(e, this), this.#r.config.onSettled?.(this.state.data, e, this), e;
|
|
632
|
-
} finally {
|
|
633
|
-
this.#a === o && (this.#a = void 0), this.scheduleGc();
|
|
634
|
-
}
|
|
649
|
+
})();
|
|
650
|
+
return this.#o = s, o.start(), s;
|
|
635
651
|
}
|
|
636
|
-
#
|
|
652
|
+
#l(e) {
|
|
637
653
|
let t = (t) => {
|
|
638
654
|
switch (e.type) {
|
|
639
655
|
case "failed": return {
|
|
@@ -651,13 +667,13 @@ var W = class extends B {
|
|
|
651
667
|
};
|
|
652
668
|
case "fetch": return {
|
|
653
669
|
...t,
|
|
654
|
-
...
|
|
670
|
+
...K(t.data, this.options),
|
|
655
671
|
fetchMeta: e.meta ?? null
|
|
656
672
|
};
|
|
657
673
|
case "success":
|
|
658
674
|
let n = {
|
|
659
675
|
...t,
|
|
660
|
-
...
|
|
676
|
+
...q(e.data, e.dataUpdatedAt),
|
|
661
677
|
dataUpdateCount: t.dataUpdateCount + 1,
|
|
662
678
|
...!e.manual && {
|
|
663
679
|
fetchStatus: "idle",
|
|
@@ -689,7 +705,7 @@ var W = class extends B {
|
|
|
689
705
|
};
|
|
690
706
|
}
|
|
691
707
|
};
|
|
692
|
-
this.state = t(this.state),
|
|
708
|
+
this.state = t(this.state), F.batch(() => {
|
|
693
709
|
this.observers.slice().forEach((e) => {
|
|
694
710
|
e.onQueryUpdate();
|
|
695
711
|
}), this.#r.notify({
|
|
@@ -700,18 +716,18 @@ var W = class extends B {
|
|
|
700
716
|
});
|
|
701
717
|
}
|
|
702
718
|
};
|
|
703
|
-
function
|
|
719
|
+
function K(e, t) {
|
|
704
720
|
return {
|
|
705
721
|
fetchFailureCount: 0,
|
|
706
722
|
fetchFailureReason: null,
|
|
707
|
-
fetchStatus:
|
|
723
|
+
fetchStatus: R(t.networkMode) ? "fetching" : "paused",
|
|
708
724
|
...e === void 0 && {
|
|
709
725
|
error: null,
|
|
710
726
|
status: "pending"
|
|
711
727
|
}
|
|
712
728
|
};
|
|
713
729
|
}
|
|
714
|
-
function
|
|
730
|
+
function q(e, t) {
|
|
715
731
|
return {
|
|
716
732
|
data: e,
|
|
717
733
|
dataUpdatedAt: t ?? Date.now(),
|
|
@@ -720,7 +736,7 @@ function K(e, t) {
|
|
|
720
736
|
status: "success"
|
|
721
737
|
};
|
|
722
738
|
}
|
|
723
|
-
function
|
|
739
|
+
function J(e) {
|
|
724
740
|
let t = typeof e.initialData == "function" ? e.initialData() : e.initialData, n = t !== void 0, r = n ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
|
|
725
741
|
return {
|
|
726
742
|
data: t,
|
|
@@ -737,6 +753,6 @@ function q(e) {
|
|
|
737
753
|
fetchStatus: "idle"
|
|
738
754
|
};
|
|
739
755
|
}
|
|
740
|
-
export { s as C, w as S, p as _,
|
|
756
|
+
export { s as C, w as S, p as _, I as a, g as b, j as c, f as d, d as f, i as g, l as h, B as i, A as l, u as m, K as n, F as o, o as p, V as r, M as s, G as t, a as u, x as v, t as w, E as x, c as y };
|
|
741
757
|
|
|
742
758
|
//# sourceMappingURL=query.js.map
|