aq-fe-framework 0.1.672 → 0.1.674
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/{chunk-GPJTAURQ.mjs → chunk-QD4ZNZCQ.mjs} +1 -1
- package/dist/{chunk-PV3DZKS2.mjs → chunk-V4I777HX.mjs} +97 -59
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.mjs +2 -2
- package/dist/core/index.d.mts +2 -2
- package/dist/core/index.mjs +2 -2
- package/dist/coreService/index.d.mts +1 -1
- package/dist/coreService/index.mjs +2 -2
- package/dist/{createBaseApi-CyDUrrHC.d.mts → createBaseApi-BlBEF93G.d.mts} +3 -1
- package/dist/hooks/index.d.mts +175 -4
- package/dist/hooks/index.mjs +3 -1
- package/dist/modules-features/index.mjs +2 -2
- package/dist/{useMyReactMutation-E74JAAZE.d.mts → useMyReactMutation-BAn-cO_2.d.mts} +1 -1
- package/package.json +1 -1
|
@@ -144,6 +144,12 @@ function createBaseApi(baseUrl, axiosInstance) {
|
|
|
144
144
|
id: item.id,
|
|
145
145
|
isEnabled: false
|
|
146
146
|
})));
|
|
147
|
+
},
|
|
148
|
+
deleteListIds: (ids) => {
|
|
149
|
+
return axiosInstance.post(`${baseUrl}/deleteList`, ids.map((id) => ({
|
|
150
|
+
id,
|
|
151
|
+
isEnabled: false
|
|
152
|
+
})));
|
|
147
153
|
}
|
|
148
154
|
};
|
|
149
155
|
}
|
|
@@ -192,62 +198,9 @@ function createMapper(config) {
|
|
|
192
198
|
};
|
|
193
199
|
}
|
|
194
200
|
|
|
195
|
-
// src/api/config/baseAxios.ts
|
|
196
|
-
import axios from "axios";
|
|
197
|
-
var baseAxios = axios.create({
|
|
198
|
-
baseURL: ""
|
|
199
|
-
// server
|
|
200
|
-
// baseURL: process.env.NEXT_PUBLIC_API_LOCAL, // local debug
|
|
201
|
-
});
|
|
202
|
-
baseAxios.interceptors.request.use(
|
|
203
|
-
(config) => {
|
|
204
|
-
var _a, _b;
|
|
205
|
-
const tokenData = localStorage.getItem("useS_authenticate");
|
|
206
|
-
const state = JSON.parse(tokenData);
|
|
207
|
-
const token = (_b = (_a = state == null ? void 0 : state.state) == null ? void 0 : _a.state) == null ? void 0 : _b.token;
|
|
208
|
-
if (token) {
|
|
209
|
-
config.headers.Authorization = `Bearer ${token}`;
|
|
210
|
-
}
|
|
211
|
-
return config;
|
|
212
|
-
},
|
|
213
|
-
(error) => {
|
|
214
|
-
return Promise.reject(error);
|
|
215
|
-
}
|
|
216
|
-
);
|
|
217
|
-
var baseAxios_default = baseAxios;
|
|
218
|
-
|
|
219
|
-
// src/hooks/custom-hooks/useLoadAxiosConfig.ts
|
|
220
|
-
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
221
|
-
var useLoadAxiosConfig = ({
|
|
222
|
-
axiosInstance = baseAxios_default,
|
|
223
|
-
url
|
|
224
|
-
}) => {
|
|
225
|
-
const [flag, setFlag] = useState2(false);
|
|
226
|
-
useEffect2(() => {
|
|
227
|
-
const loadConfig = async () => {
|
|
228
|
-
try {
|
|
229
|
-
const res = await fetch("/config.json");
|
|
230
|
-
const config = await res.json();
|
|
231
|
-
const finalUrl = url ? url : config.baseURL;
|
|
232
|
-
axiosInstance.defaults.baseURL = finalUrl;
|
|
233
|
-
baseAxios_default.defaults.baseURL = finalUrl;
|
|
234
|
-
console.log("\u2705 baseURL set to", finalUrl);
|
|
235
|
-
setFlag(true);
|
|
236
|
-
} catch (err) {
|
|
237
|
-
console.error("\u274C L\u1ED7i khi load config.json:", err);
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
loadConfig();
|
|
241
|
-
}, [axiosInstance, url]);
|
|
242
|
-
return { flag, setFlag };
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
// src/hooks/custom-hooks/useMutationAction.tsx
|
|
246
|
-
import { useQueryClient } from "@tanstack/react-query";
|
|
247
|
-
|
|
248
201
|
// src/hooks/custom-hooks/useMyReactMutation.ts
|
|
249
202
|
import { notifications } from "@mantine/notifications";
|
|
250
|
-
import { useMutation, useQueryClient
|
|
203
|
+
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
251
204
|
function useMyReactMutation({
|
|
252
205
|
isPrototype,
|
|
253
206
|
axiosFn,
|
|
@@ -257,7 +210,7 @@ function useMyReactMutation({
|
|
|
257
210
|
enableDefaultError = true,
|
|
258
211
|
successNotification
|
|
259
212
|
}) {
|
|
260
|
-
const queryClient =
|
|
213
|
+
const queryClient = useQueryClient();
|
|
261
214
|
return useMutation(__spreadProps(__spreadValues({
|
|
262
215
|
mutationFn: async (values) => {
|
|
263
216
|
if (isPrototype) {
|
|
@@ -301,14 +254,14 @@ function useMyReactMutation({
|
|
|
301
254
|
|
|
302
255
|
// src/hooks/custom-hooks/useMyReactQuery.ts
|
|
303
256
|
import { useQuery } from "@tanstack/react-query";
|
|
304
|
-
import { useState as
|
|
257
|
+
import { useState as useState2 } from "react";
|
|
305
258
|
function useMyReactQuery({
|
|
306
259
|
queryKey,
|
|
307
260
|
axiosFn,
|
|
308
261
|
options,
|
|
309
262
|
mockData
|
|
310
263
|
}) {
|
|
311
|
-
const [dataCount, setDataCount] =
|
|
264
|
+
const [dataCount, setDataCount] = useState2(0);
|
|
312
265
|
const queryResult = useQuery(__spreadValues({
|
|
313
266
|
queryKey: queryKey != null ? queryKey : [],
|
|
314
267
|
enabled: !!queryKey,
|
|
@@ -337,6 +290,90 @@ function useMyReactQuery({
|
|
|
337
290
|
});
|
|
338
291
|
}
|
|
339
292
|
|
|
293
|
+
// src/hooks/custom-hooks/useCrudService.ts
|
|
294
|
+
function useCrudService(service, queryKey) {
|
|
295
|
+
const query = useMyReactQuery({
|
|
296
|
+
queryKey: [queryKey],
|
|
297
|
+
axiosFn: () => service.getAll()
|
|
298
|
+
});
|
|
299
|
+
const create = useMyReactMutation({
|
|
300
|
+
axiosFn: (data) => service.create(data),
|
|
301
|
+
mutationType: "create"
|
|
302
|
+
});
|
|
303
|
+
const update = useMyReactMutation({
|
|
304
|
+
axiosFn: (data) => service.update(data),
|
|
305
|
+
mutationType: "update"
|
|
306
|
+
});
|
|
307
|
+
const deleteMutation = useMyReactMutation({
|
|
308
|
+
axiosFn: (id) => service.delete(id),
|
|
309
|
+
mutationType: "delete"
|
|
310
|
+
});
|
|
311
|
+
const deleteList = useMyReactMutation({
|
|
312
|
+
axiosFn: (list) => service.deleteListIds(list),
|
|
313
|
+
mutationType: "delete"
|
|
314
|
+
});
|
|
315
|
+
return {
|
|
316
|
+
query,
|
|
317
|
+
create,
|
|
318
|
+
update,
|
|
319
|
+
delete: deleteMutation,
|
|
320
|
+
deleteList
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// src/api/config/baseAxios.ts
|
|
325
|
+
import axios from "axios";
|
|
326
|
+
var baseAxios = axios.create({
|
|
327
|
+
baseURL: ""
|
|
328
|
+
// server
|
|
329
|
+
// baseURL: process.env.NEXT_PUBLIC_API_LOCAL, // local debug
|
|
330
|
+
});
|
|
331
|
+
baseAxios.interceptors.request.use(
|
|
332
|
+
(config) => {
|
|
333
|
+
var _a, _b;
|
|
334
|
+
const tokenData = localStorage.getItem("useS_authenticate");
|
|
335
|
+
const state = JSON.parse(tokenData);
|
|
336
|
+
const token = (_b = (_a = state == null ? void 0 : state.state) == null ? void 0 : _a.state) == null ? void 0 : _b.token;
|
|
337
|
+
if (token) {
|
|
338
|
+
config.headers.Authorization = `Bearer ${token}`;
|
|
339
|
+
}
|
|
340
|
+
return config;
|
|
341
|
+
},
|
|
342
|
+
(error) => {
|
|
343
|
+
return Promise.reject(error);
|
|
344
|
+
}
|
|
345
|
+
);
|
|
346
|
+
var baseAxios_default = baseAxios;
|
|
347
|
+
|
|
348
|
+
// src/hooks/custom-hooks/useLoadAxiosConfig.ts
|
|
349
|
+
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
350
|
+
var useLoadAxiosConfig = ({
|
|
351
|
+
axiosInstance = baseAxios_default,
|
|
352
|
+
url
|
|
353
|
+
}) => {
|
|
354
|
+
const [flag, setFlag] = useState3(false);
|
|
355
|
+
useEffect2(() => {
|
|
356
|
+
const loadConfig = async () => {
|
|
357
|
+
try {
|
|
358
|
+
const res = await fetch("/config.json");
|
|
359
|
+
const config = await res.json();
|
|
360
|
+
const finalUrl = url ? url : config.baseURL;
|
|
361
|
+
axiosInstance.defaults.baseURL = finalUrl;
|
|
362
|
+
baseAxios_default.defaults.baseURL = finalUrl;
|
|
363
|
+
console.log("\u2705 baseURL set to", finalUrl);
|
|
364
|
+
setFlag(true);
|
|
365
|
+
} catch (err) {
|
|
366
|
+
console.error("\u274C L\u1ED7i khi load config.json:", err);
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
loadConfig();
|
|
370
|
+
}, [axiosInstance, url]);
|
|
371
|
+
return { flag, setFlag };
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
// src/hooks/custom-hooks/useMutationAction.tsx
|
|
375
|
+
import { useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
376
|
+
|
|
340
377
|
// src/hooks/query/AQ/useQ_AQ_GetAQModule.ts
|
|
341
378
|
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
|
342
379
|
function useQ_AQ_GetAQModule() {
|
|
@@ -375,10 +412,11 @@ export {
|
|
|
375
412
|
createBaseApi,
|
|
376
413
|
createBaseUrl,
|
|
377
414
|
createMapper,
|
|
378
|
-
baseAxios_default,
|
|
379
|
-
useLoadAxiosConfig,
|
|
380
415
|
useMyReactMutation,
|
|
381
416
|
useMyReactQuery,
|
|
417
|
+
useCrudService,
|
|
418
|
+
baseAxios_default,
|
|
419
|
+
useLoadAxiosConfig,
|
|
382
420
|
useQ_AQ_GetAQModule,
|
|
383
421
|
useQ_SkillCenter_GetAll
|
|
384
422
|
};
|
|
@@ -3,10 +3,10 @@ import React__default, { ReactNode, ComponentProps } from 'react';
|
|
|
3
3
|
import { type_action, type_mantineSize } from '../types/index.mjs';
|
|
4
4
|
import { ActionIconProps, ButtonProps, useModalsStack, CheckboxProps, SelectProps, NumberFormatterProps, FieldsetProps, FileInputProps, NumberInputProps, TextareaProps, MantineSize, InputWrapperProps, TextInputProps, ContainerProps, FlexProps, GroupProps, TypographyStylesProviderProps, TabsProps, SkeletonProps } from '@mantine/core';
|
|
5
5
|
import { AxiosResponse } from 'axios';
|
|
6
|
-
import { M as MyApiResponse } from '../createBaseApi-
|
|
6
|
+
import { M as MyApiResponse } from '../createBaseApi-BlBEF93G.mjs';
|
|
7
7
|
import { useDisclosure, useListState } from '@mantine/hooks';
|
|
8
8
|
import { UseFormReturnType, useForm } from '@mantine/form';
|
|
9
|
-
import { M as MyReactMutationProps } from '../useMyReactMutation-
|
|
9
|
+
import { M as MyReactMutationProps } from '../useMyReactMutation-BAn-cO_2.mjs';
|
|
10
10
|
import { I as I_BasicAppShell_LinkItem, B as BasicAppShellProps } from '../types-km2g-xx5.mjs';
|
|
11
11
|
import { I as IUtils_Excel_ColumnConfig } from '../utils_excel-BYB9qbHd.mjs';
|
|
12
12
|
import { MRT_ColumnDef, MRT_RowData, MRT_TableOptions, MRT_TableInstance } from 'mantine-react-table';
|
|
@@ -70,14 +70,14 @@ import {
|
|
|
70
70
|
useHeaderMegaMenuStore,
|
|
71
71
|
useS_ButtonImport,
|
|
72
72
|
useStore_BasicAppShell
|
|
73
|
-
} from "../chunk-
|
|
73
|
+
} from "../chunk-QD4ZNZCQ.mjs";
|
|
74
74
|
import "../chunk-SUH3FFFV.mjs";
|
|
75
75
|
import "../chunk-GMM6RIVS.mjs";
|
|
76
76
|
import "../chunk-7PUDC2WF.mjs";
|
|
77
77
|
import "../chunk-EWDS5IOF.mjs";
|
|
78
78
|
import "../chunk-IUTUR43V.mjs";
|
|
79
79
|
import "../chunk-MNJNQRZU.mjs";
|
|
80
|
-
import "../chunk-
|
|
80
|
+
import "../chunk-V4I777HX.mjs";
|
|
81
81
|
import "../chunk-WZ6PXGGC.mjs";
|
|
82
82
|
import "../chunk-7ZCOFATU.mjs";
|
|
83
83
|
import "../chunk-FWCSY2DS.mjs";
|
package/dist/core/index.d.mts
CHANGED
|
@@ -4,9 +4,9 @@ import { ActionIconProps, ButtonProps, ModalProps, ScrollAreaAutosizeProps, Tool
|
|
|
4
4
|
import { ReactNode, ButtonHTMLAttributes, ComponentProps } from 'react';
|
|
5
5
|
import { UseFormReturnType } from '@mantine/form';
|
|
6
6
|
import { AxiosResponse } from 'axios';
|
|
7
|
-
import { M as MyApiResponse } from '../createBaseApi-
|
|
7
|
+
import { M as MyApiResponse } from '../createBaseApi-BlBEF93G.mjs';
|
|
8
8
|
import { useDisclosure } from '@mantine/hooks';
|
|
9
|
-
import { M as MyReactMutationProps } from '../useMyReactMutation-
|
|
9
|
+
import { M as MyReactMutationProps } from '../useMyReactMutation-BAn-cO_2.mjs';
|
|
10
10
|
import { UseReactToPrintOptions } from 'react-to-print';
|
|
11
11
|
import { I as IAQFileDetail } from '../utils_file-JlhzjLGS.mjs';
|
|
12
12
|
import { UseQueryResult, QueryKey, UseQueryOptions } from '@tanstack/react-query';
|
package/dist/core/index.mjs
CHANGED
|
@@ -24,14 +24,14 @@ import {
|
|
|
24
24
|
MyStatsCard,
|
|
25
25
|
MyTextInput2 as MyTextInput,
|
|
26
26
|
MyWeeklySessionSchedulerPicker
|
|
27
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-QD4ZNZCQ.mjs";
|
|
28
28
|
import "../chunk-SUH3FFFV.mjs";
|
|
29
29
|
import "../chunk-GMM6RIVS.mjs";
|
|
30
30
|
import "../chunk-7PUDC2WF.mjs";
|
|
31
31
|
import "../chunk-EWDS5IOF.mjs";
|
|
32
32
|
import "../chunk-IUTUR43V.mjs";
|
|
33
33
|
import "../chunk-MNJNQRZU.mjs";
|
|
34
|
-
import "../chunk-
|
|
34
|
+
import "../chunk-V4I777HX.mjs";
|
|
35
35
|
import "../chunk-WZ6PXGGC.mjs";
|
|
36
36
|
import "../chunk-7ZCOFATU.mjs";
|
|
37
37
|
import "../chunk-FWCSY2DS.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { M as MyModalDeleteProps } from '../MyModalDelete-BfH3xRRW.mjs';
|
|
3
3
|
import { AxiosResponse } from 'axios';
|
|
4
|
-
import { M as MyApiResponse } from '../createBaseApi-
|
|
4
|
+
import { M as MyApiResponse } from '../createBaseApi-BlBEF93G.mjs';
|
|
5
5
|
import '@mantine/core';
|
|
6
6
|
import '../IBaseEntity-ChMy9RzQ.mjs';
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MyModalDelete
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-QD4ZNZCQ.mjs";
|
|
4
4
|
import "../chunk-SUH3FFFV.mjs";
|
|
5
5
|
import "../chunk-GMM6RIVS.mjs";
|
|
6
6
|
import "../chunk-7PUDC2WF.mjs";
|
|
@@ -9,7 +9,7 @@ import "../chunk-IUTUR43V.mjs";
|
|
|
9
9
|
import "../chunk-MNJNQRZU.mjs";
|
|
10
10
|
import {
|
|
11
11
|
useMyReactMutation
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-V4I777HX.mjs";
|
|
13
13
|
import "../chunk-WZ6PXGGC.mjs";
|
|
14
14
|
import "../chunk-7ZCOFATU.mjs";
|
|
15
15
|
import {
|
|
@@ -6,6 +6,7 @@ interface IPagingParams {
|
|
|
6
6
|
pageNumber?: number;
|
|
7
7
|
pageSize?: number;
|
|
8
8
|
}
|
|
9
|
+
type BaseApiType<T> = ReturnType<typeof createBaseApi<T>>;
|
|
9
10
|
interface MyApiResponse<IRes> {
|
|
10
11
|
isSuccess: 1 | 0;
|
|
11
12
|
message: string;
|
|
@@ -29,6 +30,7 @@ declare function createBaseApi<T>(baseUrl: string, axiosInstance: AxiosInstance)
|
|
|
29
30
|
createOrUpdateList: (data: Partial<T[]>) => Promise<axios.AxiosResponse<MyApiResponse<T[]>, any>>;
|
|
30
31
|
delete: (id: number) => Promise<axios.AxiosResponse<any, any>>;
|
|
31
32
|
deleteList: (values: IBaseEntity[]) => Promise<axios.AxiosResponse<any, any>>;
|
|
33
|
+
deleteListIds: (ids: number[]) => Promise<axios.AxiosResponse<any, any>>;
|
|
32
34
|
};
|
|
33
35
|
|
|
34
|
-
export { type IPagingParams as I, type MyApiResponse as M, createBaseApi as c };
|
|
36
|
+
export { type BaseApiType as B, type IPagingParams as I, type MyApiResponse as M, createBaseApi as c };
|
package/dist/hooks/index.d.mts
CHANGED
|
@@ -3,11 +3,12 @@ import { QueryKey, UseQueryOptions } from '@tanstack/react-query';
|
|
|
3
3
|
import * as _mantine_form from '@mantine/form';
|
|
4
4
|
import { FormValidateInput } from '@mantine/form';
|
|
5
5
|
import { AxiosResponse, AxiosInstance } from 'axios';
|
|
6
|
-
import { M as MyApiResponse } from '../createBaseApi-
|
|
7
|
-
export { I as IPagingParams, c as createBaseApi } from '../createBaseApi-
|
|
6
|
+
import { M as MyApiResponse, B as BaseApiType } from '../createBaseApi-BlBEF93G.mjs';
|
|
7
|
+
export { I as IPagingParams, c as createBaseApi } from '../createBaseApi-BlBEF93G.mjs';
|
|
8
8
|
import * as next_dist_shared_lib_app_router_context_shared_runtime from 'next/dist/shared/lib/app-router-context.shared-runtime';
|
|
9
|
+
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
9
10
|
import * as React from 'react';
|
|
10
|
-
export { M as MyReactMutationProps, u as useMyReactMutation } from '../useMyReactMutation-
|
|
11
|
+
export { M as MyReactMutationProps, u as useMyReactMutation } from '../useMyReactMutation-BAn-cO_2.mjs';
|
|
11
12
|
import { I as IAQModule } from '../IAQModule-4U3n2emx.mjs';
|
|
12
13
|
import '../IBaseEntity-ChMy9RzQ.mjs';
|
|
13
14
|
import '../type_mutation-CCtnyeP3.mjs';
|
|
@@ -78,6 +79,176 @@ declare function createMapper<UI, API>(config: MapperConfig<UI, API>): {
|
|
|
78
79
|
toUI: (apiData: API) => UI;
|
|
79
80
|
};
|
|
80
81
|
|
|
82
|
+
declare function useCrudService<T>(service: BaseApiType<T>, queryKey: string): {
|
|
83
|
+
query: {
|
|
84
|
+
dataCount: number;
|
|
85
|
+
data: T[];
|
|
86
|
+
error: Error;
|
|
87
|
+
isError: true;
|
|
88
|
+
isPending: false;
|
|
89
|
+
isLoading: false;
|
|
90
|
+
isLoadingError: false;
|
|
91
|
+
isRefetchError: true;
|
|
92
|
+
isSuccess: false;
|
|
93
|
+
isPlaceholderData: false;
|
|
94
|
+
status: "error";
|
|
95
|
+
dataUpdatedAt: number;
|
|
96
|
+
errorUpdatedAt: number;
|
|
97
|
+
failureCount: number;
|
|
98
|
+
failureReason: Error | null;
|
|
99
|
+
errorUpdateCount: number;
|
|
100
|
+
isFetched: boolean;
|
|
101
|
+
isFetchedAfterMount: boolean;
|
|
102
|
+
isFetching: boolean;
|
|
103
|
+
isInitialLoading: boolean;
|
|
104
|
+
isPaused: boolean;
|
|
105
|
+
isRefetching: boolean;
|
|
106
|
+
isStale: boolean;
|
|
107
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<T[], Error>>;
|
|
108
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
109
|
+
promise: Promise<T[]>;
|
|
110
|
+
} | {
|
|
111
|
+
dataCount: number;
|
|
112
|
+
data: T[];
|
|
113
|
+
error: null;
|
|
114
|
+
isError: false;
|
|
115
|
+
isPending: false;
|
|
116
|
+
isLoading: false;
|
|
117
|
+
isLoadingError: false;
|
|
118
|
+
isRefetchError: false;
|
|
119
|
+
isSuccess: true;
|
|
120
|
+
isPlaceholderData: false;
|
|
121
|
+
status: "success";
|
|
122
|
+
dataUpdatedAt: number;
|
|
123
|
+
errorUpdatedAt: number;
|
|
124
|
+
failureCount: number;
|
|
125
|
+
failureReason: Error | null;
|
|
126
|
+
errorUpdateCount: number;
|
|
127
|
+
isFetched: boolean;
|
|
128
|
+
isFetchedAfterMount: boolean;
|
|
129
|
+
isFetching: boolean;
|
|
130
|
+
isInitialLoading: boolean;
|
|
131
|
+
isPaused: boolean;
|
|
132
|
+
isRefetching: boolean;
|
|
133
|
+
isStale: boolean;
|
|
134
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<T[], Error>>;
|
|
135
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
136
|
+
promise: Promise<T[]>;
|
|
137
|
+
} | {
|
|
138
|
+
dataCount: number;
|
|
139
|
+
data: undefined;
|
|
140
|
+
error: Error;
|
|
141
|
+
isError: true;
|
|
142
|
+
isPending: false;
|
|
143
|
+
isLoading: false;
|
|
144
|
+
isLoadingError: true;
|
|
145
|
+
isRefetchError: false;
|
|
146
|
+
isSuccess: false;
|
|
147
|
+
isPlaceholderData: false;
|
|
148
|
+
status: "error";
|
|
149
|
+
dataUpdatedAt: number;
|
|
150
|
+
errorUpdatedAt: number;
|
|
151
|
+
failureCount: number;
|
|
152
|
+
failureReason: Error | null;
|
|
153
|
+
errorUpdateCount: number;
|
|
154
|
+
isFetched: boolean;
|
|
155
|
+
isFetchedAfterMount: boolean;
|
|
156
|
+
isFetching: boolean;
|
|
157
|
+
isInitialLoading: boolean;
|
|
158
|
+
isPaused: boolean;
|
|
159
|
+
isRefetching: boolean;
|
|
160
|
+
isStale: boolean;
|
|
161
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<T[], Error>>;
|
|
162
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
163
|
+
promise: Promise<T[]>;
|
|
164
|
+
} | {
|
|
165
|
+
dataCount: number;
|
|
166
|
+
data: undefined;
|
|
167
|
+
error: null;
|
|
168
|
+
isError: false;
|
|
169
|
+
isPending: true;
|
|
170
|
+
isLoading: true;
|
|
171
|
+
isLoadingError: false;
|
|
172
|
+
isRefetchError: false;
|
|
173
|
+
isSuccess: false;
|
|
174
|
+
isPlaceholderData: false;
|
|
175
|
+
status: "pending";
|
|
176
|
+
dataUpdatedAt: number;
|
|
177
|
+
errorUpdatedAt: number;
|
|
178
|
+
failureCount: number;
|
|
179
|
+
failureReason: Error | null;
|
|
180
|
+
errorUpdateCount: number;
|
|
181
|
+
isFetched: boolean;
|
|
182
|
+
isFetchedAfterMount: boolean;
|
|
183
|
+
isFetching: boolean;
|
|
184
|
+
isInitialLoading: boolean;
|
|
185
|
+
isPaused: boolean;
|
|
186
|
+
isRefetching: boolean;
|
|
187
|
+
isStale: boolean;
|
|
188
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<T[], Error>>;
|
|
189
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
190
|
+
promise: Promise<T[]>;
|
|
191
|
+
} | {
|
|
192
|
+
dataCount: number;
|
|
193
|
+
data: undefined;
|
|
194
|
+
error: null;
|
|
195
|
+
isError: false;
|
|
196
|
+
isPending: true;
|
|
197
|
+
isLoadingError: false;
|
|
198
|
+
isRefetchError: false;
|
|
199
|
+
isSuccess: false;
|
|
200
|
+
isPlaceholderData: false;
|
|
201
|
+
status: "pending";
|
|
202
|
+
dataUpdatedAt: number;
|
|
203
|
+
errorUpdatedAt: number;
|
|
204
|
+
failureCount: number;
|
|
205
|
+
failureReason: Error | null;
|
|
206
|
+
errorUpdateCount: number;
|
|
207
|
+
isFetched: boolean;
|
|
208
|
+
isFetchedAfterMount: boolean;
|
|
209
|
+
isFetching: boolean;
|
|
210
|
+
isLoading: boolean;
|
|
211
|
+
isInitialLoading: boolean;
|
|
212
|
+
isPaused: boolean;
|
|
213
|
+
isRefetching: boolean;
|
|
214
|
+
isStale: boolean;
|
|
215
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<T[], Error>>;
|
|
216
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
217
|
+
promise: Promise<T[]>;
|
|
218
|
+
} | {
|
|
219
|
+
dataCount: number;
|
|
220
|
+
data: T[];
|
|
221
|
+
isError: false;
|
|
222
|
+
error: null;
|
|
223
|
+
isPending: false;
|
|
224
|
+
isLoading: false;
|
|
225
|
+
isLoadingError: false;
|
|
226
|
+
isRefetchError: false;
|
|
227
|
+
isSuccess: true;
|
|
228
|
+
isPlaceholderData: true;
|
|
229
|
+
status: "success";
|
|
230
|
+
dataUpdatedAt: number;
|
|
231
|
+
errorUpdatedAt: number;
|
|
232
|
+
failureCount: number;
|
|
233
|
+
failureReason: Error | null;
|
|
234
|
+
errorUpdateCount: number;
|
|
235
|
+
isFetched: boolean;
|
|
236
|
+
isFetchedAfterMount: boolean;
|
|
237
|
+
isFetching: boolean;
|
|
238
|
+
isInitialLoading: boolean;
|
|
239
|
+
isPaused: boolean;
|
|
240
|
+
isRefetching: boolean;
|
|
241
|
+
isStale: boolean;
|
|
242
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<T[], Error>>;
|
|
243
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
244
|
+
promise: Promise<T[]>;
|
|
245
|
+
};
|
|
246
|
+
create: _tanstack_react_query.UseMutationResult<T, Error, T, unknown>;
|
|
247
|
+
update: _tanstack_react_query.UseMutationResult<T, Error, T, unknown>;
|
|
248
|
+
delete: _tanstack_react_query.UseMutationResult<void, Error, number, unknown>;
|
|
249
|
+
deleteList: _tanstack_react_query.UseMutationResult<void, Error, number[], unknown>;
|
|
250
|
+
};
|
|
251
|
+
|
|
81
252
|
declare const useLoadAxiosConfig: ({ axiosInstance, url, }: {
|
|
82
253
|
axiosInstance?: AxiosInstance;
|
|
83
254
|
url?: string;
|
|
@@ -258,4 +429,4 @@ declare function useMyReactQuery<IRes, IBody>({ queryKey, axiosFn, options, mock
|
|
|
258
429
|
|
|
259
430
|
declare function useQ_AQ_GetAQModule(): _tanstack_react_query.UseQueryResult<IAQModule, Error>;
|
|
260
431
|
|
|
261
|
-
export { MyApiResponse, type MyReactQueryProps, createBaseUrl, createMapper, useCreateUpdate, useEditableRows, useLoadAxiosConfig, useMyDevice, useMyReactQuery, useMyRouter, useQ_AQ_GetAQModule };
|
|
432
|
+
export { BaseApiType, MyApiResponse, type MyReactQueryProps, createBaseUrl, createMapper, useCreateUpdate, useCrudService, useEditableRows, useLoadAxiosConfig, useMyDevice, useMyReactQuery, useMyRouter, useQ_AQ_GetAQModule };
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
createBaseUrl,
|
|
4
4
|
createMapper,
|
|
5
5
|
useCreateUpdate,
|
|
6
|
+
useCrudService,
|
|
6
7
|
useEditableRows,
|
|
7
8
|
useLoadAxiosConfig,
|
|
8
9
|
useMyDevice,
|
|
@@ -10,7 +11,7 @@ import {
|
|
|
10
11
|
useMyReactQuery,
|
|
11
12
|
useMyRouter,
|
|
12
13
|
useQ_AQ_GetAQModule
|
|
13
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-V4I777HX.mjs";
|
|
14
15
|
import "../chunk-WZ6PXGGC.mjs";
|
|
15
16
|
import "../chunk-7ZCOFATU.mjs";
|
|
16
17
|
import "../chunk-FWCSY2DS.mjs";
|
|
@@ -19,6 +20,7 @@ export {
|
|
|
19
20
|
createBaseUrl,
|
|
20
21
|
createMapper,
|
|
21
22
|
useCreateUpdate,
|
|
23
|
+
useCrudService,
|
|
22
24
|
useEditableRows,
|
|
23
25
|
useLoadAxiosConfig,
|
|
24
26
|
useMyDevice,
|
|
@@ -106,14 +106,14 @@ import {
|
|
|
106
106
|
Feat_accessControlLevel,
|
|
107
107
|
useS_authenticate,
|
|
108
108
|
useS_moduleConfig
|
|
109
|
-
} from "../chunk-
|
|
109
|
+
} from "../chunk-QD4ZNZCQ.mjs";
|
|
110
110
|
import "../chunk-SUH3FFFV.mjs";
|
|
111
111
|
import "../chunk-GMM6RIVS.mjs";
|
|
112
112
|
import "../chunk-7PUDC2WF.mjs";
|
|
113
113
|
import "../chunk-EWDS5IOF.mjs";
|
|
114
114
|
import "../chunk-IUTUR43V.mjs";
|
|
115
115
|
import "../chunk-MNJNQRZU.mjs";
|
|
116
|
-
import "../chunk-
|
|
116
|
+
import "../chunk-V4I777HX.mjs";
|
|
117
117
|
import "../chunk-WZ6PXGGC.mjs";
|
|
118
118
|
import "../chunk-7ZCOFATU.mjs";
|
|
119
119
|
import "../chunk-FWCSY2DS.mjs";
|
|
@@ -2,7 +2,7 @@ import * as _tanstack_react_query from '@tanstack/react-query';
|
|
|
2
2
|
import { UseMutationOptions } from '@tanstack/react-query';
|
|
3
3
|
import { t as type_mutation } from './type_mutation-CCtnyeP3.mjs';
|
|
4
4
|
import { AxiosResponse } from 'axios';
|
|
5
|
-
import { M as MyApiResponse } from './createBaseApi-
|
|
5
|
+
import { M as MyApiResponse } from './createBaseApi-BlBEF93G.mjs';
|
|
6
6
|
|
|
7
7
|
interface MyReactMutationProps<IReq = void, IRes = void> {
|
|
8
8
|
isPrototype?: boolean;
|