fui-material 2.7.3 → 2.7.5
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/f-ui-kit.es.js +14 -11
- package/dist/f-ui-kit.es.js.map +1 -1
- package/dist/f-ui-kit.umd.js +2 -2
- package/dist/f-ui-kit.umd.js.map +1 -1
- package/dist/types/hooks/index.d.ts +3 -3
- package/dist/types/hooks/useFApiMutation/index.d.ts +1 -0
- package/dist/types/hooks/{useApiMutation/useApiMutation.d.ts → useFApiMutation/useFApiMutation.d.ts} +4 -4
- package/dist/types/hooks/useFApiQuery/index.d.ts +1 -0
- package/dist/types/hooks/{useApiQuery/useApiQuery.d.ts → useFApiQuery/useFApiQuery.d.ts} +4 -4
- package/dist/types/hooks/useFManualApiQuery/index.d.ts +1 -0
- package/dist/types/hooks/{useManualApiQuery/useManualApiQuery.d.ts → useFManualApiQuery/useFManualApiQuery.d.ts} +7 -7
- package/package.json +1 -1
- package/dist/types/hooks/useApiMutation/index.d.ts +0 -1
- package/dist/types/hooks/useApiQuery/index.d.ts +0 -1
- package/dist/types/hooks/useManualApiQuery/index.d.ts +0 -1
package/dist/f-ui-kit.es.js
CHANGED
|
@@ -5,8 +5,8 @@ import JSZip from "jszip";
|
|
|
5
5
|
import initializeModule from "allorion-exporting-html-to-docx";
|
|
6
6
|
import { renderToStaticMarkup } from "react-dom/server";
|
|
7
7
|
import { initializeModule as initializeModule$1, installFormatCode } from "allorion-exporting-html-to-xlsx";
|
|
8
|
-
import { useQueryClient, useMutation, useQuery } from "@tanstack/react-query";
|
|
9
8
|
import axios from "axios";
|
|
9
|
+
import { useQueryClient, useMutation, useQuery } from "@tanstack/react-query";
|
|
10
10
|
import './index.css';const btn = "_btn_ch6o3_1";
|
|
11
11
|
const stylesBtn = {
|
|
12
12
|
btn,
|
|
@@ -7954,7 +7954,7 @@ const useLibraryContext = () => {
|
|
|
7954
7954
|
}
|
|
7955
7955
|
return context;
|
|
7956
7956
|
};
|
|
7957
|
-
const
|
|
7957
|
+
const useFApiMutation = (url, config, options) => {
|
|
7958
7958
|
const { apiService } = useLibraryContext();
|
|
7959
7959
|
const queryClient = useQueryClient();
|
|
7960
7960
|
const mutation = useMutation({
|
|
@@ -8075,7 +8075,7 @@ function useNotificationEffects(options, state) {
|
|
|
8075
8075
|
}
|
|
8076
8076
|
}, [state.isSuccess, onSuccessNotification, successNotificationTitle, successNotificationBody]);
|
|
8077
8077
|
}
|
|
8078
|
-
const
|
|
8078
|
+
const useFApiQuery = (queryKey, url, config, options) => {
|
|
8079
8079
|
const { apiService } = useLibraryContext();
|
|
8080
8080
|
const {
|
|
8081
8081
|
onErrorNotification = false,
|
|
@@ -8148,7 +8148,7 @@ const useApiQuery = (queryKey, url, config, options) => {
|
|
|
8148
8148
|
}, [query.isLoading, onLoadingLog, loadingNotificationTitle, loadingNotificationBody]);
|
|
8149
8149
|
return query;
|
|
8150
8150
|
};
|
|
8151
|
-
function
|
|
8151
|
+
function useFManualApiQuery(queryKey, url, initialParams, config, options) {
|
|
8152
8152
|
const { apiService } = useLibraryContext();
|
|
8153
8153
|
const queryClient = useQueryClient();
|
|
8154
8154
|
const [params, setParams] = useState(initialParams);
|
|
@@ -8204,7 +8204,7 @@ function useManualApiQuery(queryKey, url, initialParams, config, options) {
|
|
|
8204
8204
|
}, [onErrorNotification, notificationTitle, notificationBody, onErrorLog]);
|
|
8205
8205
|
useEffect(() => {
|
|
8206
8206
|
if (onLoadingLog && query.isFetching) {
|
|
8207
|
-
console.log(`[
|
|
8207
|
+
console.log(`[useFManualApiQuery] Loading: ${url}`);
|
|
8208
8208
|
}
|
|
8209
8209
|
}, [query.isFetching, onLoadingLog, url]);
|
|
8210
8210
|
const run = useCallback(async ({
|
|
@@ -8224,18 +8224,21 @@ function useManualApiQuery(queryKey, url, initialParams, config, options) {
|
|
|
8224
8224
|
if (updatedParams) nextQueryKey.push(updatedParams);
|
|
8225
8225
|
if (updatedUrlParams) nextQueryKey.push(updatedUrlParams);
|
|
8226
8226
|
try {
|
|
8227
|
-
const
|
|
8227
|
+
const rawResult = await queryClient.fetchQuery({
|
|
8228
8228
|
queryKey: nextQueryKey,
|
|
8229
8229
|
queryFn: ({ signal }) => fetcher(updatedParams, updatedUrlParams, updatedDopUrl, signal),
|
|
8230
8230
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8231
8231
|
staleTime: restOptions.staleTime
|
|
8232
8232
|
});
|
|
8233
|
-
|
|
8233
|
+
if (restOptions.select) {
|
|
8234
|
+
return restOptions.select(rawResult);
|
|
8235
|
+
}
|
|
8236
|
+
return rawResult;
|
|
8234
8237
|
} catch (error2) {
|
|
8235
8238
|
handleSideErrors(error2);
|
|
8236
8239
|
throw error2;
|
|
8237
8240
|
}
|
|
8238
|
-
}, [params, urlParams, dopUrl, queryKey, fetcher, queryClient, restOptions
|
|
8241
|
+
}, [params, urlParams, dopUrl, queryKey, fetcher, queryClient, restOptions, handleSideErrors]);
|
|
8239
8242
|
return { ...query, run, params, urlParams };
|
|
8240
8243
|
}
|
|
8241
8244
|
const waterError = "_waterError_10t7p_1";
|
|
@@ -8427,9 +8430,9 @@ export {
|
|
|
8427
8430
|
fNotification,
|
|
8428
8431
|
fNotificationDelete,
|
|
8429
8432
|
fPrompt,
|
|
8430
|
-
useApiMutation,
|
|
8431
|
-
useApiQuery,
|
|
8432
8433
|
useFApi,
|
|
8433
|
-
|
|
8434
|
+
useFApiMutation,
|
|
8435
|
+
useFApiQuery,
|
|
8436
|
+
useFManualApiQuery
|
|
8434
8437
|
};
|
|
8435
8438
|
//# sourceMappingURL=f-ui-kit.es.js.map
|