@lark-apaas/client-toolkit 1.1.31 → 1.1.32
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as QueryProvider, getDefaultQueryClient } from '../../components/QueryProvider';
|
|
@@ -16,6 +16,7 @@ import { TrackKey } from "../../types/tea.js";
|
|
|
16
16
|
import safety from "./safety.js";
|
|
17
17
|
import { getAppId } from "../../utils/getAppId.js";
|
|
18
18
|
import { ServerLogPoller } from "../../server-log/index.js";
|
|
19
|
+
import QueryProvider from "../QueryProvider/index.js";
|
|
19
20
|
registerDayjsPlugins();
|
|
20
21
|
initAxiosConfig();
|
|
21
22
|
const isMiaodaPreview = window.IS_MIAODA_PREVIEW;
|
|
@@ -221,17 +222,19 @@ const AppContainer_AppContainer = (props)=>{
|
|
|
221
222
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
222
223
|
children: [
|
|
223
224
|
/*#__PURE__*/ jsx(safety, {}),
|
|
224
|
-
/*#__PURE__*/ jsx(
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
225
|
+
/*#__PURE__*/ jsx(QueryProvider, {
|
|
226
|
+
children: /*#__PURE__*/ jsx(ConfigProvider, {
|
|
227
|
+
theme: {
|
|
228
|
+
token: antdThemeToken,
|
|
229
|
+
components: {
|
|
230
|
+
Table: antdTableToken,
|
|
231
|
+
Pagination: antdPaginationToken
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
children: /*#__PURE__*/ jsx(App, {
|
|
235
|
+
themeMeta: props.themeMeta,
|
|
236
|
+
children: children
|
|
237
|
+
})
|
|
235
238
|
})
|
|
236
239
|
})
|
|
237
240
|
]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
3
|
+
declare const getDefaultQueryClient: () => QueryClient;
|
|
4
|
+
export type QueryProviderProps = {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
client?: QueryClient;
|
|
7
|
+
};
|
|
8
|
+
declare const QueryProvider: React.FC<QueryProviderProps>;
|
|
9
|
+
export default QueryProvider;
|
|
10
|
+
export { getDefaultQueryClient };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
4
|
+
let defaultQueryClient = null;
|
|
5
|
+
const getDefaultQueryClient = ()=>{
|
|
6
|
+
if (!defaultQueryClient) defaultQueryClient = new QueryClient({
|
|
7
|
+
defaultOptions: {
|
|
8
|
+
queries: {
|
|
9
|
+
retry: 1,
|
|
10
|
+
refetchOnWindowFocus: false
|
|
11
|
+
},
|
|
12
|
+
mutations: {
|
|
13
|
+
retry: 1
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return defaultQueryClient;
|
|
18
|
+
};
|
|
19
|
+
const QueryProvider = ({ children, client })=>{
|
|
20
|
+
const qc = client ?? getDefaultQueryClient();
|
|
21
|
+
return /*#__PURE__*/ jsx(QueryClientProvider, {
|
|
22
|
+
client: qc,
|
|
23
|
+
children: children
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
const components_QueryProvider = QueryProvider;
|
|
27
|
+
export { components_QueryProvider as default, getDefaultQueryClient };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/client-toolkit",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.32",
|
|
4
4
|
"types": "./lib/index.d.ts",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -148,6 +148,7 @@
|
|
|
148
148
|
"vitest": "^3.2.4"
|
|
149
149
|
},
|
|
150
150
|
"peerDependencies": {
|
|
151
|
+
"@tanstack/react-query": "^5.90.12",
|
|
151
152
|
"antd": ">=5.26.6",
|
|
152
153
|
"react": ">=16.14.0",
|
|
153
154
|
"react-dom": ">=16.14.0",
|