fastapi-rtk 0.1.26 → 0.1.27
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/.external/cjs/{@tanstack_react-query@5.80.2_react@18.3.1 → @tanstack_react-query@5.80.6_react@18.3.1}/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs +1 -1
- package/dist/.external/cjs/{@tanstack_react-query@5.80.2_react@18.3.1 → @tanstack_react-query@5.80.6_react@18.3.1}/@tanstack/react-query/build/modern/useBaseQuery.cjs +2 -2
- package/dist/.external/cjs/{@tanstack_react-query@5.80.2_react@18.3.1 → @tanstack_react-query@5.80.6_react@18.3.1}/@tanstack/react-query/build/modern/useQuery.cjs +1 -1
- package/dist/.external/cjs/lodash@4.17.21/lodash/lodash.cjs +5 -5
- package/dist/.external/cjs/lodash@4.17.21/lodash/toFinite.cjs +1 -1
- package/dist/.external/esm/{@tanstack_react-query@5.80.2_react@18.3.1 → @tanstack_react-query@5.80.6_react@18.3.1}/@tanstack/react-query/build/modern/errorBoundaryUtils.mjs +1 -1
- package/dist/.external/esm/{@tanstack_react-query@5.80.2_react@18.3.1 → @tanstack_react-query@5.80.6_react@18.3.1}/@tanstack/react-query/build/modern/useBaseQuery.mjs +2 -2
- package/dist/.external/esm/{@tanstack_react-query@5.80.2_react@18.3.1 → @tanstack_react-query@5.80.6_react@18.3.1}/@tanstack/react-query/build/modern/useQuery.mjs +1 -1
- package/dist/.external/esm/lodash@4.17.21/lodash/lodash.mjs +5 -5
- package/dist/.external/esm/lodash@4.17.21/lodash/toFinite.mjs +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilterInput/ColumnHeaderFilterInput.cjs +4 -18
- package/dist/core/cjs/Wrappers/ApiProvider/Contexts/ApiContext.cjs +1 -1
- package/dist/core/cjs/Wrappers/ApiProvider/hooks/useProvideApi.cjs +14 -19
- package/dist/core/cjs/Wrappers/InfiniteScroll/InfiniteScroll.cjs +12 -11
- package/dist/core/cjs/Wrappers/Provider/Provider.cjs +3 -3
- package/dist/core/cjs/Wrappers/Provider/hooks/useProvideAuth.cjs +2 -2
- package/dist/core/cjs/Wrappers/Provider/hooks/useProvideInfo.cjs +1 -1
- package/dist/core/cjs/fab-react-toolkit-patch/api/hooks/useProvideApi.cjs +14 -19
- package/dist/core/cjs/fab-react-toolkit-patch/auth/hooks/useProvideAuth.cjs +2 -2
- package/dist/core/cjs/fab-react-toolkit-patch/auth/hooks/useProvideInfo.cjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilterInput/ColumnHeaderFilterInput.mjs +4 -18
- package/dist/core/esm/Wrappers/ApiProvider/Contexts/ApiContext.mjs +1 -1
- package/dist/core/esm/Wrappers/ApiProvider/hooks/useProvideApi.mjs +14 -19
- package/dist/core/esm/Wrappers/InfiniteScroll/InfiniteScroll.mjs +12 -11
- package/dist/core/esm/Wrappers/Provider/Provider.mjs +3 -3
- package/dist/core/esm/Wrappers/Provider/hooks/useProvideAuth.mjs +2 -2
- package/dist/core/esm/Wrappers/Provider/hooks/useProvideInfo.mjs +1 -1
- package/dist/core/esm/fab-react-toolkit-patch/api/hooks/useProvideApi.mjs +14 -19
- package/dist/core/esm/fab-react-toolkit-patch/auth/hooks/useProvideAuth.mjs +2 -2
- package/dist/core/esm/fab-react-toolkit-patch/auth/hooks/useProvideInfo.mjs +1 -1
- package/dist/core/lib/Tables/NextGenDataGrid/NextGenDataGrid.d.ts +3 -3
- package/dist/core/lib/Wrappers/ApiProvider/ApiProvider.d.ts +55 -13
- package/dist/core/lib/Wrappers/ApiProvider/Contexts/ApiContext.d.ts +2 -1
- package/dist/core/lib/Wrappers/ApiProvider/hooks/useProvideApi.d.ts +1 -1
- package/dist/core/lib/Wrappers/InfiniteScroll/InfiniteScroll.d.ts +29 -0
- package/dist/core/lib/Wrappers/Provider/Provider.d.ts +4 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/hooks/useProvideApi.d.ts +1 -1
- package/dist/core/lib/hooks/api/useApi.d.ts +1 -0
- package/dist/hooks/cjs/useSyncValues/useSyncValues.cjs +5 -8
- package/dist/hooks/esm/useSyncValues/useSyncValues.mjs +5 -8
- package/dist/hooks/lib/useSyncValues/useSyncValues.d.ts +1 -1
- package/package.json +1 -1
- /package/dist/.external/cjs/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/focusManager.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/mutation.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/mutationCache.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/notifyManager.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/onlineManager.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/query.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/queryCache.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/queryClient.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/queryObserver.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/removable.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/retryer.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/subscribable.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/thenable.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/utils.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_react-query@5.80.2_react@18.3.1 → @tanstack_react-query@5.80.6_react@18.3.1}/@tanstack/react-query/build/modern/IsRestoringProvider.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_react-query@5.80.2_react@18.3.1 → @tanstack_react-query@5.80.6_react@18.3.1}/@tanstack/react-query/build/modern/QueryClientProvider.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_react-query@5.80.2_react@18.3.1 → @tanstack_react-query@5.80.6_react@18.3.1}/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_react-query@5.80.2_react@18.3.1 → @tanstack_react-query@5.80.6_react@18.3.1}/@tanstack/react-query/build/modern/suspense.cjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/focusManager.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/infiniteQueryBehavior.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/mutation.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/mutationCache.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/notifyManager.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/onlineManager.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/query.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/queryCache.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/queryClient.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/queryObserver.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/removable.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/retryer.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/subscribable.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/thenable.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.80.2 → @tanstack_query-core@5.80.6}/@tanstack/query-core/build/modern/utils.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_react-query@5.80.2_react@18.3.1 → @tanstack_react-query@5.80.6_react@18.3.1}/@tanstack/react-query/build/modern/IsRestoringProvider.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_react-query@5.80.2_react@18.3.1 → @tanstack_react-query@5.80.6_react@18.3.1}/@tanstack/react-query/build/modern/QueryClientProvider.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_react-query@5.80.2_react@18.3.1 → @tanstack_react-query@5.80.6_react@18.3.1}/@tanstack/react-query/build/modern/QueryErrorResetBoundary.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_react-query@5.80.2_react@18.3.1 → @tanstack_react-query@5.80.6_react@18.3.1}/@tanstack/react-query/build/modern/suspense.mjs +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
|
-
const utils = require("../../../../../@tanstack_query-core@5.80.
|
|
4
|
+
const utils = require("../../../../../@tanstack_query-core@5.80.6/@tanstack/query-core/build/modern/utils.cjs");
|
|
5
5
|
function _interopNamespaceDefault(e) {
|
|
6
6
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
7
7
|
if (e) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
|
-
const notifyManager = require("../../../../../@tanstack_query-core@5.80.
|
|
5
|
-
const utils = require("../../../../../@tanstack_query-core@5.80.
|
|
4
|
+
const notifyManager = require("../../../../../@tanstack_query-core@5.80.6/@tanstack/query-core/build/modern/notifyManager.cjs");
|
|
5
|
+
const utils = require("../../../../../@tanstack_query-core@5.80.6/@tanstack/query-core/build/modern/utils.cjs");
|
|
6
6
|
const QueryClientProvider = require("./QueryClientProvider.cjs");
|
|
7
7
|
const QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs");
|
|
8
8
|
const errorBoundaryUtils = require("./errorBoundaryUtils.cjs");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const queryObserver = require("../../../../../@tanstack_query-core@5.80.
|
|
3
|
+
const queryObserver = require("../../../../../@tanstack_query-core@5.80.6/@tanstack/query-core/build/modern/queryObserver.cjs");
|
|
4
4
|
const useBaseQuery = require("./useBaseQuery.cjs");
|
|
5
5
|
function useQuery(options, queryClient) {
|
|
6
6
|
return useBaseQuery.useBaseQuery(options, queryObserver.QueryObserver);
|
|
@@ -1902,7 +1902,7 @@ function requireLodash() {
|
|
|
1902
1902
|
return symbolToString ? symbolToString.call(value) : "";
|
|
1903
1903
|
}
|
|
1904
1904
|
var result2 = value + "";
|
|
1905
|
-
return result2 == "0" && 1 / value == -
|
|
1905
|
+
return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2;
|
|
1906
1906
|
}
|
|
1907
1907
|
function baseUniq(array, iteratee2, comparator) {
|
|
1908
1908
|
var index = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen = result2;
|
|
@@ -3109,7 +3109,7 @@ function requireLodash() {
|
|
|
3109
3109
|
return value;
|
|
3110
3110
|
}
|
|
3111
3111
|
var result2 = value + "";
|
|
3112
|
-
return result2 == "0" && 1 / value == -
|
|
3112
|
+
return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2;
|
|
3113
3113
|
}
|
|
3114
3114
|
function toSource(func) {
|
|
3115
3115
|
if (func != null) {
|
|
@@ -4173,7 +4173,7 @@ function requireLodash() {
|
|
|
4173
4173
|
}
|
|
4174
4174
|
var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
|
|
4175
4175
|
function isSafeInteger(value) {
|
|
4176
|
-
return isInteger(value) && value >= -
|
|
4176
|
+
return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
|
|
4177
4177
|
}
|
|
4178
4178
|
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
4179
4179
|
function isString(value) {
|
|
@@ -4214,7 +4214,7 @@ function requireLodash() {
|
|
|
4214
4214
|
return value === 0 ? value : 0;
|
|
4215
4215
|
}
|
|
4216
4216
|
value = toNumber(value);
|
|
4217
|
-
if (value === INFINITY || value === -
|
|
4217
|
+
if (value === INFINITY || value === -INFINITY) {
|
|
4218
4218
|
var sign = value < 0 ? -1 : 1;
|
|
4219
4219
|
return sign * MAX_INTEGER;
|
|
4220
4220
|
}
|
|
@@ -4249,7 +4249,7 @@ function requireLodash() {
|
|
|
4249
4249
|
return copyObject(value, keysIn(value));
|
|
4250
4250
|
}
|
|
4251
4251
|
function toSafeInteger(value) {
|
|
4252
|
-
return value ? baseClamp(toInteger(value), -
|
|
4252
|
+
return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0;
|
|
4253
4253
|
}
|
|
4254
4254
|
function toString(value) {
|
|
4255
4255
|
return value == null ? "" : baseToString(value);
|
|
@@ -13,7 +13,7 @@ function requireToFinite() {
|
|
|
13
13
|
return value === 0 ? value : 0;
|
|
14
14
|
}
|
|
15
15
|
value = toNumber$1(value);
|
|
16
|
-
if (value === INFINITY || value === -
|
|
16
|
+
if (value === INFINITY || value === -INFINITY) {
|
|
17
17
|
var sign = value < 0 ? -1 : 1;
|
|
18
18
|
return sign * MAX_INTEGER;
|
|
19
19
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { shouldThrowError } from "../../../../../@tanstack_query-core@5.80.
|
|
2
|
+
import { shouldThrowError } from "../../../../../@tanstack_query-core@5.80.6/@tanstack/query-core/build/modern/utils.mjs";
|
|
3
3
|
var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {
|
|
4
4
|
if (options.suspense || options.throwOnError || options.experimental_prefetchInRender) {
|
|
5
5
|
if (!errorResetBoundary.isReset()) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { notifyManager } from "../../../../../@tanstack_query-core@5.80.
|
|
3
|
-
import { noop, isServer } from "../../../../../@tanstack_query-core@5.80.
|
|
2
|
+
import { notifyManager } from "../../../../../@tanstack_query-core@5.80.6/@tanstack/query-core/build/modern/notifyManager.mjs";
|
|
3
|
+
import { noop, isServer } from "../../../../../@tanstack_query-core@5.80.6/@tanstack/query-core/build/modern/utils.mjs";
|
|
4
4
|
import { useQueryClient } from "./QueryClientProvider.mjs";
|
|
5
5
|
import { useQueryErrorResetBoundary } from "./QueryErrorResetBoundary.mjs";
|
|
6
6
|
import { ensurePreventErrorBoundaryRetry, useClearResetErrorBoundary, getHasError } from "./errorBoundaryUtils.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { QueryObserver } from "../../../../../@tanstack_query-core@5.80.
|
|
1
|
+
import { QueryObserver } from "../../../../../@tanstack_query-core@5.80.6/@tanstack/query-core/build/modern/queryObserver.mjs";
|
|
2
2
|
import { useBaseQuery } from "./useBaseQuery.mjs";
|
|
3
3
|
function useQuery(options, queryClient) {
|
|
4
4
|
return useBaseQuery(options, QueryObserver);
|
|
@@ -1900,7 +1900,7 @@ function requireLodash() {
|
|
|
1900
1900
|
return symbolToString ? symbolToString.call(value) : "";
|
|
1901
1901
|
}
|
|
1902
1902
|
var result2 = value + "";
|
|
1903
|
-
return result2 == "0" && 1 / value == -
|
|
1903
|
+
return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2;
|
|
1904
1904
|
}
|
|
1905
1905
|
function baseUniq(array, iteratee2, comparator) {
|
|
1906
1906
|
var index = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen = result2;
|
|
@@ -3107,7 +3107,7 @@ function requireLodash() {
|
|
|
3107
3107
|
return value;
|
|
3108
3108
|
}
|
|
3109
3109
|
var result2 = value + "";
|
|
3110
|
-
return result2 == "0" && 1 / value == -
|
|
3110
|
+
return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2;
|
|
3111
3111
|
}
|
|
3112
3112
|
function toSource(func) {
|
|
3113
3113
|
if (func != null) {
|
|
@@ -4171,7 +4171,7 @@ function requireLodash() {
|
|
|
4171
4171
|
}
|
|
4172
4172
|
var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
|
|
4173
4173
|
function isSafeInteger(value) {
|
|
4174
|
-
return isInteger(value) && value >= -
|
|
4174
|
+
return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
|
|
4175
4175
|
}
|
|
4176
4176
|
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
4177
4177
|
function isString(value) {
|
|
@@ -4212,7 +4212,7 @@ function requireLodash() {
|
|
|
4212
4212
|
return value === 0 ? value : 0;
|
|
4213
4213
|
}
|
|
4214
4214
|
value = toNumber(value);
|
|
4215
|
-
if (value === INFINITY || value === -
|
|
4215
|
+
if (value === INFINITY || value === -INFINITY) {
|
|
4216
4216
|
var sign = value < 0 ? -1 : 1;
|
|
4217
4217
|
return sign * MAX_INTEGER;
|
|
4218
4218
|
}
|
|
@@ -4247,7 +4247,7 @@ function requireLodash() {
|
|
|
4247
4247
|
return copyObject(value, keysIn(value));
|
|
4248
4248
|
}
|
|
4249
4249
|
function toSafeInteger(value) {
|
|
4250
|
-
return value ? baseClamp(toInteger(value), -
|
|
4250
|
+
return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0;
|
|
4251
4251
|
}
|
|
4252
4252
|
function toString(value) {
|
|
4253
4253
|
return value == null ? "" : baseToString(value);
|
|
@@ -11,7 +11,7 @@ function requireToFinite() {
|
|
|
11
11
|
return value === 0 ? value : 0;
|
|
12
12
|
}
|
|
13
13
|
value = toNumber(value);
|
|
14
|
-
if (value === INFINITY || value === -
|
|
14
|
+
if (value === INFINITY || value === -INFINITY) {
|
|
15
15
|
var sign = value < 0 ? -1 : 1;
|
|
16
16
|
return sign * MAX_INTEGER;
|
|
17
17
|
}
|
|
@@ -54,22 +54,9 @@ function ColumnHeaderFilterInput({
|
|
|
54
54
|
const field = form.useField({ mode: "controlled" });
|
|
55
55
|
hooks$1.useSyncValues(
|
|
56
56
|
[
|
|
57
|
-
{
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
log: (value) => console.log(`Field value changed to: ${value}`)
|
|
61
|
-
},
|
|
62
|
-
...filterState ? [
|
|
63
|
-
{
|
|
64
|
-
...filterState,
|
|
65
|
-
log: (value) => console.log(`filterState value changed to: ${value}`)
|
|
66
|
-
}
|
|
67
|
-
] : [],
|
|
68
|
-
{
|
|
69
|
-
value: column.getFilterValue(),
|
|
70
|
-
onChange: column.setFilterValue,
|
|
71
|
-
log: (value) => console.log(`Column filter value changed to: ${value}`)
|
|
72
|
-
},
|
|
57
|
+
{ value: field.getValue(), onChange: field.getInputProps().onChange },
|
|
58
|
+
{ value: column.getFilterValue(), onChange: column.setFilterValue },
|
|
59
|
+
...filterState ? [filterState] : [],
|
|
73
60
|
...updateQueryParams ? [
|
|
74
61
|
{
|
|
75
62
|
value: (_b = (_a = queryParams == null ? void 0 : queryParams.filters) == null ? void 0 : _a.find((qpFilter) => qpFilter.id === column.id)) == null ? void 0 : _b.value,
|
|
@@ -93,8 +80,7 @@ function ColumnHeaderFilterInput({
|
|
|
93
80
|
}
|
|
94
81
|
return { ...prev, filters: newFilters };
|
|
95
82
|
});
|
|
96
|
-
}
|
|
97
|
-
log: (value) => console.log(`Query Params filter value changed to: ${value}`)
|
|
83
|
+
}
|
|
98
84
|
}
|
|
99
85
|
] : []
|
|
100
86
|
],
|
|
@@ -4,7 +4,7 @@ const React = require("react");
|
|
|
4
4
|
const ApiContext = React.createContext({
|
|
5
5
|
path: "",
|
|
6
6
|
/**
|
|
7
|
-
* @type {{count: number, description_columns: Record<string, string>, ids: number[] | string[], label_columns: Record<string, string>, list_columns: string[], list_title: string, order_columns: string[], result: Record<string, any>[], path: string} | null}
|
|
7
|
+
* @type {{count: number, description_columns: Record<string, string>, ids: number[] | string[], label_columns: Record<string, string>, list_columns: string[], list_title: string, order_columns: string[], result: Record<string, any>[], path: string, queryParams: Record<string, any>} | null}
|
|
8
8
|
*/
|
|
9
9
|
data: null,
|
|
10
10
|
/**
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const utils = require("fastapi-rtk/utils");
|
|
5
5
|
const hooks = require("@mantine/hooks");
|
|
6
|
-
const useQuery = require("../../../../../.external/cjs/@tanstack_react-query@5.80.
|
|
6
|
+
const useQuery = require("../../../../../.external/cjs/@tanstack_react-query@5.80.6_react@18.3.1/@tanstack/react-query/build/modern/useQuery.cjs");
|
|
7
7
|
const createItem = require("../utils/api/createItem.cjs");
|
|
8
8
|
const deleteItem = require("../utils/api/deleteItem.cjs");
|
|
9
9
|
const downloadItems = require("../utils/api/downloadItems.cjs");
|
|
@@ -15,7 +15,7 @@ const uploadItems = require("../utils/api/uploadItems.cjs");
|
|
|
15
15
|
const convertId = require("../utils/convertId.cjs");
|
|
16
16
|
const convertInfo = require("../utils/convertInfo.cjs");
|
|
17
17
|
const createQueryParams = require("../utils/createQueryParams.cjs");
|
|
18
|
-
const utils$1 = require("../../../../../.external/cjs/@tanstack_query-core@5.80.
|
|
18
|
+
const utils$1 = require("../../../../../.external/cjs/@tanstack_query-core@5.80.6/@tanstack/query-core/build/modern/utils.cjs");
|
|
19
19
|
function useProvideApi({
|
|
20
20
|
path,
|
|
21
21
|
initialQueryParams,
|
|
@@ -112,7 +112,8 @@ function useProvideApi({
|
|
|
112
112
|
queryFn: ({ signal }) => memoizedQueryParams ? getItems.getItems(utils.urlJoin(memoizedQueryParamsPathRef.current, "/"), memoizedQueryParams, signal).then((data2) => ({
|
|
113
113
|
...data2,
|
|
114
114
|
result: data2.result.map((item, index) => ({ ...item, id: data2.ids[index] })),
|
|
115
|
-
path: memoizedQueryParamsPathRef.current
|
|
115
|
+
path: memoizedQueryParamsPathRef.current,
|
|
116
|
+
queryParams: memoizedQueryParams
|
|
116
117
|
})) : null,
|
|
117
118
|
placeholderData: clearDataOnRefetch ? null : utils$1.keepPreviousData,
|
|
118
119
|
retry: false,
|
|
@@ -232,16 +233,8 @@ function useProvideApi({
|
|
|
232
233
|
const [streaming, setStreaming] = hooks.useSetState({
|
|
233
234
|
data: {},
|
|
234
235
|
isEnd: false,
|
|
235
|
-
fetch: () => null
|
|
236
|
+
fetch: streamingMode ? () => setQueryParamsCallback({ page: 0, streaming: true }) : () => null
|
|
236
237
|
});
|
|
237
|
-
React.useEffect(() => {
|
|
238
|
-
if (!streamingMode) {
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
241
|
-
setStreaming({
|
|
242
|
-
fetch: () => setQueryParamsCallback({ page: 0, streaming: true })
|
|
243
|
-
});
|
|
244
|
-
}, [setQueryParamsCallback, setStreaming, streamingMode]);
|
|
245
238
|
React.useEffect(() => {
|
|
246
239
|
if (!streamingMode) {
|
|
247
240
|
return;
|
|
@@ -250,19 +243,21 @@ function useProvideApi({
|
|
|
250
243
|
return;
|
|
251
244
|
}
|
|
252
245
|
setStreaming((prev) => {
|
|
253
|
-
|
|
246
|
+
var _a;
|
|
254
247
|
const newStreaming = { isEnd: false };
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
248
|
+
const currentPage = Object.keys(prev.data).length;
|
|
249
|
+
const nextPage = ((_a = data.queryParams) == null ? void 0 : _a.page) ?? 0;
|
|
250
|
+
if (nextPage < currentPage) {
|
|
251
|
+
newStreaming.data = {};
|
|
258
252
|
} else {
|
|
259
|
-
newStreaming.data = { ...prev.data
|
|
253
|
+
newStreaming.data = { ...prev.data };
|
|
260
254
|
}
|
|
261
|
-
|
|
255
|
+
newStreaming.data[nextPage] = data.result;
|
|
256
|
+
if (data.result.length < data.queryParams.page_size) {
|
|
262
257
|
newStreaming.isEnd = true;
|
|
263
258
|
newStreaming.fetch = () => null;
|
|
264
259
|
} else {
|
|
265
|
-
newStreaming.fetch = () => setQueryParamsCallback({ page:
|
|
260
|
+
newStreaming.fetch = () => setQueryParamsCallback({ page: nextPage + 1, streaming: true });
|
|
266
261
|
}
|
|
267
262
|
return newStreaming;
|
|
268
263
|
});
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const utils = require("fastapi-rtk/utils");
|
|
4
5
|
const core = require("@mantine/core");
|
|
5
6
|
const hooks = require("@mantine/hooks");
|
|
6
7
|
const React = require("react");
|
|
7
8
|
const useApi = require("../../hooks/api/useApi.cjs");
|
|
8
|
-
|
|
9
|
+
const InfiniteScroll = ({
|
|
9
10
|
children,
|
|
10
11
|
fetch = true,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
components: {
|
|
13
|
+
Loading = /* @__PURE__ */ jsxRuntime.jsx(core.Center, { children: /* @__PURE__ */ jsxRuntime.jsx(core.Loader, {}) }),
|
|
14
|
+
End = /* @__PURE__ */ jsxRuntime.jsx(core.Center, { children: "End of data" }),
|
|
15
|
+
FetchWrapper = core.Center
|
|
16
|
+
} = {},
|
|
14
17
|
fetchWrapperProps
|
|
15
|
-
}) {
|
|
18
|
+
}) => {
|
|
16
19
|
const { streaming, loading } = useApi.useApi();
|
|
17
20
|
const { ref, inViewport } = hooks.useInViewport();
|
|
18
21
|
const items = React.useMemo(() => Object.values(streaming.data).flat(), [streaming.data]);
|
|
19
|
-
const Children = React.useMemo(() => typeof children === "function" ? children(items) : children, [children, items]);
|
|
20
22
|
React.useEffect(() => {
|
|
21
23
|
if (inViewport && fetch) {
|
|
22
24
|
streaming.fetch();
|
|
23
25
|
}
|
|
24
|
-
}, [inViewport]);
|
|
26
|
+
}, [fetch, inViewport]);
|
|
25
27
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
26
|
-
|
|
27
|
-
loading && Loading,
|
|
28
|
+
utils.parseFromValuesOrFunc(children, { items, loading }),
|
|
28
29
|
streaming.isEnd && End,
|
|
29
|
-
/* @__PURE__ */ jsxRuntime.jsx(FetchWrapper, { ref, id: "IS-load-trigger", mih: "1%", ...fetchWrapperProps })
|
|
30
|
+
loading ? Loading : /* @__PURE__ */ jsxRuntime.jsx(FetchWrapper, { ref, id: "IS-load-trigger", mih: "1%", ...fetchWrapperProps })
|
|
30
31
|
] });
|
|
31
|
-
}
|
|
32
|
+
};
|
|
32
33
|
exports.InfiniteScroll = InfiniteScroll;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const zustand = require("fastapi-rtk/zustand");
|
|
5
|
-
const queryClient = require("../../../../.external/cjs/@tanstack_query-core@5.80.
|
|
6
|
-
const QueryClientProvider = require("../../../../.external/cjs/@tanstack_react-query@5.80.
|
|
5
|
+
const queryClient = require("../../../../.external/cjs/@tanstack_query-core@5.80.6/@tanstack/query-core/build/modern/queryClient.cjs");
|
|
6
|
+
const QueryClientProvider = require("../../../../.external/cjs/@tanstack_react-query@5.80.6_react@18.3.1/@tanstack/react-query/build/modern/QueryClientProvider.cjs");
|
|
7
7
|
const React = require("react");
|
|
8
8
|
const useProvideAuth = require("../../fab-react-toolkit-patch/auth/hooks/useProvideAuth.cjs");
|
|
9
9
|
const useProvideInfo = require("../../fab-react-toolkit-patch/auth/hooks/useProvideInfo.cjs");
|
|
@@ -33,7 +33,7 @@ function InnerProvider(props) {
|
|
|
33
33
|
return /* @__PURE__ */ jsxRuntime.jsx(AuthContext.AuthContext.Provider, { value: authProxy, children: /* @__PURE__ */ jsxRuntime.jsx(InfoContext.InfoContext.Provider, { value: infoProxy, children }) });
|
|
34
34
|
}
|
|
35
35
|
const Provider = (props) => {
|
|
36
|
-
const [queryClient$1] = React.useState(() => new queryClient.QueryClient());
|
|
36
|
+
const [queryClient$1] = React.useState(() => new queryClient.QueryClient(props.queryClientProps));
|
|
37
37
|
return /* @__PURE__ */ jsxRuntime.jsx(QueryClientProvider.QueryClientProvider, { client: queryClient$1, children: /* @__PURE__ */ jsxRuntime.jsx(InnerProvider, { ...props }) });
|
|
38
38
|
};
|
|
39
39
|
exports.Provider = Provider;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const useQuery = require("../../../../../.external/cjs/@tanstack_react-query@5.80.
|
|
4
|
-
const QueryClientProvider = require("../../../../../.external/cjs/@tanstack_react-query@5.80.
|
|
3
|
+
const useQuery = require("../../../../../.external/cjs/@tanstack_react-query@5.80.6_react@18.3.1/@tanstack/react-query/build/modern/useQuery.cjs");
|
|
4
|
+
const QueryClientProvider = require("../../../../../.external/cjs/@tanstack_react-query@5.80.6_react@18.3.1/@tanstack/react-query/build/modern/QueryClientProvider.cjs");
|
|
5
5
|
const React = require("react");
|
|
6
6
|
const authFetch = require("../utils/authFetch.cjs");
|
|
7
7
|
const userCRUD = require("../utils/userCRUD.cjs");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const useQuery = require("../../../../../.external/cjs/@tanstack_react-query@5.80.
|
|
3
|
+
const useQuery = require("../../../../../.external/cjs/@tanstack_react-query@5.80.6_react@18.3.1/@tanstack/react-query/build/modern/useQuery.cjs");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const authFetch = require("../utils/authFetch.cjs");
|
|
6
6
|
function useProvideInfo(baseUrl, auth) {
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const utils = require("fastapi-rtk/utils");
|
|
5
5
|
const hooks = require("@mantine/hooks");
|
|
6
|
-
const utils$1 = require("../../../../../.external/cjs/@tanstack_query-core@5.80.
|
|
7
|
-
const useQuery = require("../../../../../.external/cjs/@tanstack_react-query@5.80.
|
|
6
|
+
const utils$1 = require("../../../../../.external/cjs/@tanstack_query-core@5.80.6/@tanstack/query-core/build/modern/utils.cjs");
|
|
7
|
+
const useQuery = require("../../../../../.external/cjs/@tanstack_react-query@5.80.6_react@18.3.1/@tanstack/react-query/build/modern/useQuery.cjs");
|
|
8
8
|
const createItem = require("../utils/api/createItem.cjs");
|
|
9
9
|
const deleteItem = require("../utils/api/deleteItem.cjs");
|
|
10
10
|
const downloadItems = require("../utils/api/downloadItems.cjs");
|
|
@@ -112,7 +112,8 @@ function useFabProvideApi({
|
|
|
112
112
|
queryFn: ({ signal }) => memoizedQueryParams ? getItems.getItems(utils.urlJoin(memoizedQueryParamsPathRef.current, "/"), memoizedQueryParams, signal).then((data2) => ({
|
|
113
113
|
...data2,
|
|
114
114
|
result: data2.result.map((item, index) => ({ ...item, id: data2.ids[index] })),
|
|
115
|
-
path: memoizedQueryParamsPathRef.current
|
|
115
|
+
path: memoizedQueryParamsPathRef.current,
|
|
116
|
+
queryParams: memoizedQueryParams
|
|
116
117
|
})) : null,
|
|
117
118
|
placeholderData: clearDataOnRefetch ? null : utils$1.keepPreviousData,
|
|
118
119
|
retry: false,
|
|
@@ -232,16 +233,8 @@ function useFabProvideApi({
|
|
|
232
233
|
const [streaming, setStreaming] = hooks.useSetState({
|
|
233
234
|
data: {},
|
|
234
235
|
isEnd: false,
|
|
235
|
-
fetch: () => null
|
|
236
|
+
fetch: streamingMode ? () => setQueryParamsCallback({ page: 0, streaming: true }) : () => null
|
|
236
237
|
});
|
|
237
|
-
React.useEffect(() => {
|
|
238
|
-
if (!streamingMode) {
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
241
|
-
setStreaming({
|
|
242
|
-
fetch: () => setQueryParamsCallback({ page: 0, streaming: true })
|
|
243
|
-
});
|
|
244
|
-
}, [setQueryParamsCallback, setStreaming, streamingMode]);
|
|
245
238
|
React.useEffect(() => {
|
|
246
239
|
if (!streamingMode) {
|
|
247
240
|
return;
|
|
@@ -250,19 +243,21 @@ function useFabProvideApi({
|
|
|
250
243
|
return;
|
|
251
244
|
}
|
|
252
245
|
setStreaming((prev) => {
|
|
253
|
-
|
|
246
|
+
var _a;
|
|
254
247
|
const newStreaming = { isEnd: false };
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
248
|
+
const currentPage = Object.keys(prev.data).length;
|
|
249
|
+
const nextPage = ((_a = data.queryParams) == null ? void 0 : _a.page) ?? 0;
|
|
250
|
+
if (nextPage < currentPage) {
|
|
251
|
+
newStreaming.data = {};
|
|
258
252
|
} else {
|
|
259
|
-
newStreaming.data = { ...prev.data
|
|
253
|
+
newStreaming.data = { ...prev.data };
|
|
260
254
|
}
|
|
261
|
-
|
|
255
|
+
newStreaming.data[nextPage] = data.result;
|
|
256
|
+
if (data.result.length < data.queryParams.page_size) {
|
|
262
257
|
newStreaming.isEnd = true;
|
|
263
258
|
newStreaming.fetch = () => null;
|
|
264
259
|
} else {
|
|
265
|
-
newStreaming.fetch = () => setQueryParamsCallback({ page:
|
|
260
|
+
newStreaming.fetch = () => setQueryParamsCallback({ page: nextPage + 1, streaming: true });
|
|
266
261
|
}
|
|
267
262
|
return newStreaming;
|
|
268
263
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const useQuery = require("../../../../../.external/cjs/@tanstack_react-query@5.80.
|
|
4
|
-
const QueryClientProvider = require("../../../../../.external/cjs/@tanstack_react-query@5.80.
|
|
3
|
+
const useQuery = require("../../../../../.external/cjs/@tanstack_react-query@5.80.6_react@18.3.1/@tanstack/react-query/build/modern/useQuery.cjs");
|
|
4
|
+
const QueryClientProvider = require("../../../../../.external/cjs/@tanstack_react-query@5.80.6_react@18.3.1/@tanstack/react-query/build/modern/QueryClientProvider.cjs");
|
|
5
5
|
const React = require("react");
|
|
6
6
|
const authFetch = require("../utils/authFetch.cjs");
|
|
7
7
|
const userCRUD = require("../utils/userCRUD.cjs");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const useQuery = require("../../../../../.external/cjs/@tanstack_react-query@5.80.
|
|
3
|
+
const useQuery = require("../../../../../.external/cjs/@tanstack_react-query@5.80.6_react@18.3.1/@tanstack/react-query/build/modern/useQuery.cjs");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const authFetch = require("../utils/authFetch.cjs");
|
|
6
6
|
function useFabProvideInfo(baseUrl, auth) {
|
|
@@ -52,22 +52,9 @@ function ColumnHeaderFilterInput({
|
|
|
52
52
|
const field = useField({ mode: "controlled" });
|
|
53
53
|
useSyncValues(
|
|
54
54
|
[
|
|
55
|
-
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
log: (value) => console.log(`Field value changed to: ${value}`)
|
|
59
|
-
},
|
|
60
|
-
...filterState ? [
|
|
61
|
-
{
|
|
62
|
-
...filterState,
|
|
63
|
-
log: (value) => console.log(`filterState value changed to: ${value}`)
|
|
64
|
-
}
|
|
65
|
-
] : [],
|
|
66
|
-
{
|
|
67
|
-
value: column.getFilterValue(),
|
|
68
|
-
onChange: column.setFilterValue,
|
|
69
|
-
log: (value) => console.log(`Column filter value changed to: ${value}`)
|
|
70
|
-
},
|
|
55
|
+
{ value: field.getValue(), onChange: field.getInputProps().onChange },
|
|
56
|
+
{ value: column.getFilterValue(), onChange: column.setFilterValue },
|
|
57
|
+
...filterState ? [filterState] : [],
|
|
71
58
|
...updateQueryParams ? [
|
|
72
59
|
{
|
|
73
60
|
value: (_b = (_a = queryParams == null ? void 0 : queryParams.filters) == null ? void 0 : _a.find((qpFilter) => qpFilter.id === column.id)) == null ? void 0 : _b.value,
|
|
@@ -91,8 +78,7 @@ function ColumnHeaderFilterInput({
|
|
|
91
78
|
}
|
|
92
79
|
return { ...prev, filters: newFilters };
|
|
93
80
|
});
|
|
94
|
-
}
|
|
95
|
-
log: (value) => console.log(`Query Params filter value changed to: ${value}`)
|
|
81
|
+
}
|
|
96
82
|
}
|
|
97
83
|
] : []
|
|
98
84
|
],
|
|
@@ -2,7 +2,7 @@ import { createContext } from "react";
|
|
|
2
2
|
const ApiContext = createContext({
|
|
3
3
|
path: "",
|
|
4
4
|
/**
|
|
5
|
-
* @type {{count: number, description_columns: Record<string, string>, ids: number[] | string[], label_columns: Record<string, string>, list_columns: string[], list_title: string, order_columns: string[], result: Record<string, any>[], path: string} | null}
|
|
5
|
+
* @type {{count: number, description_columns: Record<string, string>, ids: number[] | string[], label_columns: Record<string, string>, list_columns: string[], list_title: string, order_columns: string[], result: Record<string, any>[], path: string, queryParams: Record<string, any>} | null}
|
|
6
6
|
*/
|
|
7
7
|
data: null,
|
|
8
8
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState, useRef, useEffect, useMemo, useCallback } from "react";
|
|
2
2
|
import { getItemId, urlJoin } from "fastapi-rtk/utils";
|
|
3
3
|
import { useDidUpdate, useSetState } from "@mantine/hooks";
|
|
4
|
-
import { useQuery } from "../../../../../.external/esm/@tanstack_react-query@5.80.
|
|
4
|
+
import { useQuery } from "../../../../../.external/esm/@tanstack_react-query@5.80.6_react@18.3.1/@tanstack/react-query/build/modern/useQuery.mjs";
|
|
5
5
|
import { createItem } from "../utils/api/createItem.mjs";
|
|
6
6
|
import { deleteItem } from "../utils/api/deleteItem.mjs";
|
|
7
7
|
import { downloadItems } from "../utils/api/downloadItems.mjs";
|
|
@@ -13,7 +13,7 @@ import { uploadItems } from "../utils/api/uploadItems.mjs";
|
|
|
13
13
|
import { convertId } from "../utils/convertId.mjs";
|
|
14
14
|
import { convertInfo } from "../utils/convertInfo.mjs";
|
|
15
15
|
import { createQueryParams } from "../utils/createQueryParams.mjs";
|
|
16
|
-
import { keepPreviousData } from "../../../../../.external/esm/@tanstack_query-core@5.80.
|
|
16
|
+
import { keepPreviousData } from "../../../../../.external/esm/@tanstack_query-core@5.80.6/@tanstack/query-core/build/modern/utils.mjs";
|
|
17
17
|
function useProvideApi({
|
|
18
18
|
path,
|
|
19
19
|
initialQueryParams,
|
|
@@ -110,7 +110,8 @@ function useProvideApi({
|
|
|
110
110
|
queryFn: ({ signal }) => memoizedQueryParams ? getItems(urlJoin(memoizedQueryParamsPathRef.current, "/"), memoizedQueryParams, signal).then((data2) => ({
|
|
111
111
|
...data2,
|
|
112
112
|
result: data2.result.map((item, index) => ({ ...item, id: data2.ids[index] })),
|
|
113
|
-
path: memoizedQueryParamsPathRef.current
|
|
113
|
+
path: memoizedQueryParamsPathRef.current,
|
|
114
|
+
queryParams: memoizedQueryParams
|
|
114
115
|
})) : null,
|
|
115
116
|
placeholderData: clearDataOnRefetch ? null : keepPreviousData,
|
|
116
117
|
retry: false,
|
|
@@ -230,16 +231,8 @@ function useProvideApi({
|
|
|
230
231
|
const [streaming, setStreaming] = useSetState({
|
|
231
232
|
data: {},
|
|
232
233
|
isEnd: false,
|
|
233
|
-
fetch: () => null
|
|
234
|
+
fetch: streamingMode ? () => setQueryParamsCallback({ page: 0, streaming: true }) : () => null
|
|
234
235
|
});
|
|
235
|
-
useEffect(() => {
|
|
236
|
-
if (!streamingMode) {
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
setStreaming({
|
|
240
|
-
fetch: () => setQueryParamsCallback({ page: 0, streaming: true })
|
|
241
|
-
});
|
|
242
|
-
}, [setQueryParamsCallback, setStreaming, streamingMode]);
|
|
243
236
|
useEffect(() => {
|
|
244
237
|
if (!streamingMode) {
|
|
245
238
|
return;
|
|
@@ -248,19 +241,21 @@ function useProvideApi({
|
|
|
248
241
|
return;
|
|
249
242
|
}
|
|
250
243
|
setStreaming((prev) => {
|
|
251
|
-
|
|
244
|
+
var _a;
|
|
252
245
|
const newStreaming = { isEnd: false };
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
246
|
+
const currentPage = Object.keys(prev.data).length;
|
|
247
|
+
const nextPage = ((_a = data.queryParams) == null ? void 0 : _a.page) ?? 0;
|
|
248
|
+
if (nextPage < currentPage) {
|
|
249
|
+
newStreaming.data = {};
|
|
256
250
|
} else {
|
|
257
|
-
newStreaming.data = { ...prev.data
|
|
251
|
+
newStreaming.data = { ...prev.data };
|
|
258
252
|
}
|
|
259
|
-
|
|
253
|
+
newStreaming.data[nextPage] = data.result;
|
|
254
|
+
if (data.result.length < data.queryParams.page_size) {
|
|
260
255
|
newStreaming.isEnd = true;
|
|
261
256
|
newStreaming.fetch = () => null;
|
|
262
257
|
} else {
|
|
263
|
-
newStreaming.fetch = () => setQueryParamsCallback({ page:
|
|
258
|
+
newStreaming.fetch = () => setQueryParamsCallback({ page: nextPage + 1, streaming: true });
|
|
264
259
|
}
|
|
265
260
|
return newStreaming;
|
|
266
261
|
});
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { parseFromValuesOrFunc } from "fastapi-rtk/utils";
|
|
2
3
|
import { Center, Loader } from "@mantine/core";
|
|
3
4
|
import { useInViewport } from "@mantine/hooks";
|
|
4
5
|
import { useMemo, useEffect } from "react";
|
|
5
6
|
import { useApi } from "../../hooks/api/useApi.mjs";
|
|
6
|
-
|
|
7
|
+
const InfiniteScroll = ({
|
|
7
8
|
children,
|
|
8
9
|
fetch = true,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
components: {
|
|
11
|
+
Loading = /* @__PURE__ */ jsx(Center, { children: /* @__PURE__ */ jsx(Loader, {}) }),
|
|
12
|
+
End = /* @__PURE__ */ jsx(Center, { children: "End of data" }),
|
|
13
|
+
FetchWrapper = Center
|
|
14
|
+
} = {},
|
|
12
15
|
fetchWrapperProps
|
|
13
|
-
}) {
|
|
16
|
+
}) => {
|
|
14
17
|
const { streaming, loading } = useApi();
|
|
15
18
|
const { ref, inViewport } = useInViewport();
|
|
16
19
|
const items = useMemo(() => Object.values(streaming.data).flat(), [streaming.data]);
|
|
17
|
-
const Children = useMemo(() => typeof children === "function" ? children(items) : children, [children, items]);
|
|
18
20
|
useEffect(() => {
|
|
19
21
|
if (inViewport && fetch) {
|
|
20
22
|
streaming.fetch();
|
|
21
23
|
}
|
|
22
|
-
}, [inViewport]);
|
|
24
|
+
}, [fetch, inViewport]);
|
|
23
25
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
|
-
|
|
25
|
-
loading && Loading,
|
|
26
|
+
parseFromValuesOrFunc(children, { items, loading }),
|
|
26
27
|
streaming.isEnd && End,
|
|
27
|
-
/* @__PURE__ */ jsx(FetchWrapper, { ref, id: "IS-load-trigger", mih: "1%", ...fetchWrapperProps })
|
|
28
|
+
loading ? Loading : /* @__PURE__ */ jsx(FetchWrapper, { ref, id: "IS-load-trigger", mih: "1%", ...fetchWrapperProps })
|
|
28
29
|
] });
|
|
29
|
-
}
|
|
30
|
+
};
|
|
30
31
|
export {
|
|
31
32
|
InfiniteScroll
|
|
32
33
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useProxy } from "fastapi-rtk/zustand";
|
|
3
|
-
import { QueryClient } from "../../../../.external/esm/@tanstack_query-core@5.80.
|
|
4
|
-
import { QueryClientProvider } from "../../../../.external/esm/@tanstack_react-query@5.80.
|
|
3
|
+
import { QueryClient } from "../../../../.external/esm/@tanstack_query-core@5.80.6/@tanstack/query-core/build/modern/queryClient.mjs";
|
|
4
|
+
import { QueryClientProvider } from "../../../../.external/esm/@tanstack_react-query@5.80.6_react@18.3.1/@tanstack/react-query/build/modern/QueryClientProvider.mjs";
|
|
5
5
|
import { useState } from "react";
|
|
6
6
|
import { useFabProvideAuth } from "../../fab-react-toolkit-patch/auth/hooks/useProvideAuth.mjs";
|
|
7
7
|
import { useFabProvideInfo } from "../../fab-react-toolkit-patch/auth/hooks/useProvideInfo.mjs";
|
|
@@ -31,7 +31,7 @@ function InnerProvider(props) {
|
|
|
31
31
|
return /* @__PURE__ */ jsx(AuthContext.Provider, { value: authProxy, children: /* @__PURE__ */ jsx(InfoContext.Provider, { value: infoProxy, children }) });
|
|
32
32
|
}
|
|
33
33
|
const Provider = (props) => {
|
|
34
|
-
const [queryClient] = useState(() => new QueryClient());
|
|
34
|
+
const [queryClient] = useState(() => new QueryClient(props.queryClientProps));
|
|
35
35
|
return /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(InnerProvider, { ...props }) });
|
|
36
36
|
};
|
|
37
37
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useQuery } from "../../../../../.external/esm/@tanstack_react-query@5.80.
|
|
2
|
-
import { useQueryClient } from "../../../../../.external/esm/@tanstack_react-query@5.80.
|
|
1
|
+
import { useQuery } from "../../../../../.external/esm/@tanstack_react-query@5.80.6_react@18.3.1/@tanstack/react-query/build/modern/useQuery.mjs";
|
|
2
|
+
import { useQueryClient } from "../../../../../.external/esm/@tanstack_react-query@5.80.6_react@18.3.1/@tanstack/react-query/build/modern/QueryClientProvider.mjs";
|
|
3
3
|
import { useState, useCallback } from "react";
|
|
4
4
|
import { authSignin, authSignout, authResetPassword, authOAuthSignin } from "../utils/authFetch.mjs";
|
|
5
5
|
import { getUser, updateUser } from "../utils/userCRUD.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useQuery } from "../../../../../.external/esm/@tanstack_react-query@5.80.
|
|
1
|
+
import { useQuery } from "../../../../../.external/esm/@tanstack_react-query@5.80.6_react@18.3.1/@tanstack/react-query/build/modern/useQuery.mjs";
|
|
2
2
|
import { useEffect } from "react";
|
|
3
3
|
import { authInfo } from "../utils/authFetch.mjs";
|
|
4
4
|
function useProvideInfo(baseUrl, auth) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useState, useRef, useEffect, useMemo, useCallback } from "react";
|
|
2
2
|
import { getItemId, urlJoin } from "fastapi-rtk/utils";
|
|
3
3
|
import { useDidUpdate, useSetState } from "@mantine/hooks";
|
|
4
|
-
import { keepPreviousData } from "../../../../../.external/esm/@tanstack_query-core@5.80.
|
|
5
|
-
import { useQuery } from "../../../../../.external/esm/@tanstack_react-query@5.80.
|
|
4
|
+
import { keepPreviousData } from "../../../../../.external/esm/@tanstack_query-core@5.80.6/@tanstack/query-core/build/modern/utils.mjs";
|
|
5
|
+
import { useQuery } from "../../../../../.external/esm/@tanstack_react-query@5.80.6_react@18.3.1/@tanstack/react-query/build/modern/useQuery.mjs";
|
|
6
6
|
import { createItem } from "../utils/api/createItem.mjs";
|
|
7
7
|
import { deleteItem } from "../utils/api/deleteItem.mjs";
|
|
8
8
|
import { downloadItems } from "../utils/api/downloadItems.mjs";
|
|
@@ -110,7 +110,8 @@ function useFabProvideApi({
|
|
|
110
110
|
queryFn: ({ signal }) => memoizedQueryParams ? getItems(urlJoin(memoizedQueryParamsPathRef.current, "/"), memoizedQueryParams, signal).then((data2) => ({
|
|
111
111
|
...data2,
|
|
112
112
|
result: data2.result.map((item, index) => ({ ...item, id: data2.ids[index] })),
|
|
113
|
-
path: memoizedQueryParamsPathRef.current
|
|
113
|
+
path: memoizedQueryParamsPathRef.current,
|
|
114
|
+
queryParams: memoizedQueryParams
|
|
114
115
|
})) : null,
|
|
115
116
|
placeholderData: clearDataOnRefetch ? null : keepPreviousData,
|
|
116
117
|
retry: false,
|
|
@@ -230,16 +231,8 @@ function useFabProvideApi({
|
|
|
230
231
|
const [streaming, setStreaming] = useSetState({
|
|
231
232
|
data: {},
|
|
232
233
|
isEnd: false,
|
|
233
|
-
fetch: () => null
|
|
234
|
+
fetch: streamingMode ? () => setQueryParamsCallback({ page: 0, streaming: true }) : () => null
|
|
234
235
|
});
|
|
235
|
-
useEffect(() => {
|
|
236
|
-
if (!streamingMode) {
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
setStreaming({
|
|
240
|
-
fetch: () => setQueryParamsCallback({ page: 0, streaming: true })
|
|
241
|
-
});
|
|
242
|
-
}, [setQueryParamsCallback, setStreaming, streamingMode]);
|
|
243
236
|
useEffect(() => {
|
|
244
237
|
if (!streamingMode) {
|
|
245
238
|
return;
|
|
@@ -248,19 +241,21 @@ function useFabProvideApi({
|
|
|
248
241
|
return;
|
|
249
242
|
}
|
|
250
243
|
setStreaming((prev) => {
|
|
251
|
-
|
|
244
|
+
var _a;
|
|
252
245
|
const newStreaming = { isEnd: false };
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
246
|
+
const currentPage = Object.keys(prev.data).length;
|
|
247
|
+
const nextPage = ((_a = data.queryParams) == null ? void 0 : _a.page) ?? 0;
|
|
248
|
+
if (nextPage < currentPage) {
|
|
249
|
+
newStreaming.data = {};
|
|
256
250
|
} else {
|
|
257
|
-
newStreaming.data = { ...prev.data
|
|
251
|
+
newStreaming.data = { ...prev.data };
|
|
258
252
|
}
|
|
259
|
-
|
|
253
|
+
newStreaming.data[nextPage] = data.result;
|
|
254
|
+
if (data.result.length < data.queryParams.page_size) {
|
|
260
255
|
newStreaming.isEnd = true;
|
|
261
256
|
newStreaming.fetch = () => null;
|
|
262
257
|
} else {
|
|
263
|
-
newStreaming.fetch = () => setQueryParamsCallback({ page:
|
|
258
|
+
newStreaming.fetch = () => setQueryParamsCallback({ page: nextPage + 1, streaming: true });
|
|
264
259
|
}
|
|
265
260
|
return newStreaming;
|
|
266
261
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useQuery } from "../../../../../.external/esm/@tanstack_react-query@5.80.
|
|
2
|
-
import { useQueryClient } from "../../../../../.external/esm/@tanstack_react-query@5.80.
|
|
1
|
+
import { useQuery } from "../../../../../.external/esm/@tanstack_react-query@5.80.6_react@18.3.1/@tanstack/react-query/build/modern/useQuery.mjs";
|
|
2
|
+
import { useQueryClient } from "../../../../../.external/esm/@tanstack_react-query@5.80.6_react@18.3.1/@tanstack/react-query/build/modern/QueryClientProvider.mjs";
|
|
3
3
|
import { useState, useCallback } from "react";
|
|
4
4
|
import { authSignin, authSignout, authResetPassword, authOAuthSignin } from "../utils/authFetch.mjs";
|
|
5
5
|
import { getUser, updateUser } from "../utils/userCRUD.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useQuery } from "../../../../../.external/esm/@tanstack_react-query@5.80.
|
|
1
|
+
import { useQuery } from "../../../../../.external/esm/@tanstack_react-query@5.80.6_react@18.3.1/@tanstack/react-query/build/modern/useQuery.mjs";
|
|
2
2
|
import { useEffect } from "react";
|
|
3
3
|
import { authInfo } from "../utils/authFetch.mjs";
|
|
4
4
|
function useFabProvideInfo(baseUrl, auth) {
|
|
@@ -10,11 +10,11 @@ export type NextGenDataGridChildrenProps = {
|
|
|
10
10
|
};
|
|
11
11
|
export type NextGenDataGridFilterStateProps = {
|
|
12
12
|
/**
|
|
13
|
-
* - Filter value
|
|
13
|
+
* - Filter value. When provided, the value will be synchronized with the inner filter state.
|
|
14
14
|
*/
|
|
15
|
-
value
|
|
15
|
+
value?: any;
|
|
16
16
|
/**
|
|
17
|
-
* - Callback when the filter value changes
|
|
17
|
+
* - Callback when the inner filter value changes.
|
|
18
18
|
*/
|
|
19
19
|
onChange: (value: any) => void;
|
|
20
20
|
/**
|
|
@@ -1,14 +1,56 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* ApiProvider component that wraps the application and provides the API context, bulk actions context, and form contexts.
|
|
3
|
+
* @param {ApiProviderProps} props
|
|
4
|
+
* @returns {JSX.Element}
|
|
5
|
+
*/
|
|
6
|
+
export function ApiProvider({ resource_name, initialQueryParams, relation, fetchInfo, clearInfoOnRefetch, clearDataOnRefetch, resetQueryParamsOnPathChange, infoQueryProps, dataQueryProps, throwOnError, streaming, children, }: ApiProviderProps): JSX.Element;
|
|
7
|
+
export type ApiProviderProps = {
|
|
8
|
+
/**
|
|
9
|
+
* - The name of the resource to be used in the API path
|
|
10
|
+
*/
|
|
2
11
|
resource_name?: string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
/**
|
|
13
|
+
* - The initial query parameters to be used in the API requests
|
|
14
|
+
*/
|
|
15
|
+
initialQueryParams?: Record<string, any>;
|
|
16
|
+
/**
|
|
17
|
+
* - The relation to be used in the API requests
|
|
18
|
+
*/
|
|
19
|
+
relation?: string;
|
|
20
|
+
/**
|
|
21
|
+
* - Whether to fetch the `info` for the API requests when the component mounts
|
|
22
|
+
*/
|
|
23
|
+
fetchInfo?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* - Whether to clear the `info` on refetch
|
|
26
|
+
*/
|
|
27
|
+
clearInfoOnRefetch?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* - Whether to clear the `data` on refetch
|
|
30
|
+
*/
|
|
31
|
+
clearDataOnRefetch?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* - Whether to reset the `queryParams` on path change
|
|
34
|
+
*/
|
|
35
|
+
resetQueryParamsOnPathChange?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* - The react-query props for the info query
|
|
38
|
+
*/
|
|
39
|
+
infoQueryProps?: Record<string, any>;
|
|
40
|
+
/**
|
|
41
|
+
* - The react-query props for the data query
|
|
42
|
+
*/
|
|
43
|
+
dataQueryProps?: Record<string, any>;
|
|
44
|
+
/**
|
|
45
|
+
* - Whether to throw an error on API request failure
|
|
46
|
+
*/
|
|
47
|
+
throwOnError?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* - Whether to enable streaming for the API requests
|
|
50
|
+
*/
|
|
51
|
+
streaming?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* - The children to be rendered inside the provider
|
|
54
|
+
*/
|
|
55
|
+
children: ReactNode;
|
|
56
|
+
};
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
export const ApiContext: import('react').Context<{
|
|
27
27
|
path: string;
|
|
28
28
|
/**
|
|
29
|
-
* @type {{count: number, description_columns: Record<string, string>, ids: number[] | string[], label_columns: Record<string, string>, list_columns: string[], list_title: string, order_columns: string[], result: Record<string, any>[], path: string} | null}
|
|
29
|
+
* @type {{count: number, description_columns: Record<string, string>, ids: number[] | string[], label_columns: Record<string, string>, list_columns: string[], list_title: string, order_columns: string[], result: Record<string, any>[], path: string, queryParams: Record<string, any>} | null}
|
|
30
30
|
*/
|
|
31
31
|
data: {
|
|
32
32
|
count: number;
|
|
@@ -38,6 +38,7 @@ export const ApiContext: import('react').Context<{
|
|
|
38
38
|
order_columns: string[];
|
|
39
39
|
result: Record<string, any>[];
|
|
40
40
|
path: string;
|
|
41
|
+
queryParams: Record<string, any>;
|
|
41
42
|
} | null;
|
|
42
43
|
/**
|
|
43
44
|
* @type {{add_columns: Record<string, ColumnInfo>[], add_title: string, add_schema: Record<string, any>, add_uischema: Record<string, any>, edit_columns: Record<string, ColumnInfo>[], edit_title: string, edit_schema: Record<string, any>, edit_uischema: Record<string, any>, filter_options: Record<string, any>, filters: Record<string, Filter>, permissions: string[], relations: string[] | null, path: string} | null}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export function InfiniteScroll({ children, fetch, components: { Loading, End, FetchWrapper, }, fetchWrapperProps, }: {
|
|
2
|
+
children: React.ReactNode | ((props: InfiniteScrollChildrenProps) => React.ReactNode);
|
|
3
|
+
components: InfiniteScrollComponentsProps;
|
|
4
|
+
fetchWrapperProps: any;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
export type InfiniteScrollComponentsProps = {
|
|
7
|
+
/**
|
|
8
|
+
* - Component to render while loading more items.
|
|
9
|
+
*/
|
|
10
|
+
Loading?: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* - Component to render when all items have been loaded.
|
|
13
|
+
*/
|
|
14
|
+
End?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* - Component to use as a wrapper for the fetch trigger.
|
|
17
|
+
*/
|
|
18
|
+
FetchWrapper?: React.ReactNode;
|
|
19
|
+
};
|
|
20
|
+
export type InfiniteScrollChildrenProps = {
|
|
21
|
+
/**
|
|
22
|
+
* - The items fetched from the API.
|
|
23
|
+
*/
|
|
24
|
+
items: Record<string, any>[];
|
|
25
|
+
/**
|
|
26
|
+
* - Indicates whether the data is currently being loaded.
|
|
27
|
+
*/
|
|
28
|
+
loading: boolean;
|
|
29
|
+
};
|
|
@@ -4,6 +4,10 @@ export type ProviderProps = {
|
|
|
4
4
|
* - The base URL for the API
|
|
5
5
|
*/
|
|
6
6
|
baseUrl: string;
|
|
7
|
+
/**
|
|
8
|
+
* - The props for the QueryClient. See here `https://tanstack.com/query/latest/docs/reference/QueryClient`
|
|
9
|
+
*/
|
|
10
|
+
queryClientProps?: Record<string, any>;
|
|
7
11
|
/**
|
|
8
12
|
* - The react-query props for the auth. See here `https://tanstack.com/query/latest/docs/framework/react/reference/useQuery`
|
|
9
13
|
*/
|
|
@@ -10,6 +10,7 @@ export function useApi(): {
|
|
|
10
10
|
order_columns: string[];
|
|
11
11
|
result: Record<string, any>[];
|
|
12
12
|
path: string;
|
|
13
|
+
queryParams: Record<string, any>;
|
|
13
14
|
} | null;
|
|
14
15
|
info: {
|
|
15
16
|
add_columns: Record<string, import('../../Wrappers/ApiProvider/Contexts/ApiContext').ColumnInfo>[];
|
|
@@ -7,18 +7,15 @@ const useSyncValues = (states, { equals = (a, b) => a === b, delay = constants.D
|
|
|
7
7
|
const timeoutRef = react.useRef(null);
|
|
8
8
|
react.useEffect(
|
|
9
9
|
() => {
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
10
|
+
const changedIndex = states.findIndex((state) => "value" in state && !equals(state.value, lastValueRef.current));
|
|
11
|
+
if (changedIndex === -1) {
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
clearTimeout(timeoutRef.current);
|
|
15
15
|
timeoutRef.current = setTimeout(() => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
state.onChange(lastValueRef.current);
|
|
20
|
-
}
|
|
21
|
-
});
|
|
16
|
+
const newValue = states[changedIndex].value;
|
|
17
|
+
lastValueRef.current = newValue;
|
|
18
|
+
states.filter((state, index) => index !== changedIndex && !equals(state.value, newValue)).forEach((state) => state.onChange(newValue));
|
|
22
19
|
}, delay);
|
|
23
20
|
return () => clearTimeout(timeoutRef.current);
|
|
24
21
|
},
|
|
@@ -5,18 +5,15 @@ const useSyncValues = (states, { equals = (a, b) => a === b, delay = DEBOUNCE_DE
|
|
|
5
5
|
const timeoutRef = useRef(null);
|
|
6
6
|
useEffect(
|
|
7
7
|
() => {
|
|
8
|
-
const
|
|
9
|
-
if (
|
|
8
|
+
const changedIndex = states.findIndex((state) => "value" in state && !equals(state.value, lastValueRef.current));
|
|
9
|
+
if (changedIndex === -1) {
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
12
|
clearTimeout(timeoutRef.current);
|
|
13
13
|
timeoutRef.current = setTimeout(() => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
state.onChange(lastValueRef.current);
|
|
18
|
-
}
|
|
19
|
-
});
|
|
14
|
+
const newValue = states[changedIndex].value;
|
|
15
|
+
lastValueRef.current = newValue;
|
|
16
|
+
states.filter((state, index) => index !== changedIndex && !equals(state.value, newValue)).forEach((state) => state.onChange(newValue));
|
|
20
17
|
}, delay);
|
|
21
18
|
return () => clearTimeout(timeoutRef.current);
|
|
22
19
|
},
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|