aq-fe-framework 0.1.1006 → 0.1.1007
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-WRGTKT6A.mjs → chunk-5F4MYOZX.mjs} +5 -5
- package/dist/{chunk-KWZCXNJK.mjs → chunk-Z76CSZFI.mjs} +2 -47
- package/dist/components/index.d.mts +1 -1
- package/dist/components/index.mjs +3 -3
- package/dist/const/index.mjs +1 -1
- package/dist/core/index.d.mts +1 -1
- package/dist/core/index.mjs +3 -3
- package/dist/hooks/index.d.mts +5 -23
- package/dist/hooks/index.mjs +1 -3
- package/dist/modules-features/index.mjs +3 -3
- package/dist/shared/index.mjs +3 -3
- package/package.json +1 -1
- package/dist/{chunk-OHAOJE5F.mjs → chunk-C74M5VPE.mjs} +1 -1
|
@@ -24,6 +24,10 @@ import {
|
|
|
24
24
|
utils_mantineReactTable,
|
|
25
25
|
utils_text
|
|
26
26
|
} from "./chunk-7ZI7IOEP.mjs";
|
|
27
|
+
import {
|
|
28
|
+
const_object_colors,
|
|
29
|
+
const_object_documentTypes
|
|
30
|
+
} from "./chunk-C74M5VPE.mjs";
|
|
27
31
|
import {
|
|
28
32
|
createGenericStore
|
|
29
33
|
} from "./chunk-BTITP4TN.mjs";
|
|
@@ -31,10 +35,6 @@ import {
|
|
|
31
35
|
enumLabel_gender,
|
|
32
36
|
enum_daysOfWeek
|
|
33
37
|
} from "./chunk-J4WTZ3B4.mjs";
|
|
34
|
-
import {
|
|
35
|
-
const_object_colors,
|
|
36
|
-
const_object_documentTypes
|
|
37
|
-
} from "./chunk-OHAOJE5F.mjs";
|
|
38
38
|
import {
|
|
39
39
|
baseAxios_default,
|
|
40
40
|
createBaseApi,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
useMyReactMutation,
|
|
46
46
|
useMyReactQuery,
|
|
47
47
|
useQ_AQ_GetAQModule
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-Z76CSZFI.mjs";
|
|
49
49
|
import {
|
|
50
50
|
__objRest,
|
|
51
51
|
__restKey,
|
|
@@ -47,50 +47,6 @@ function useExportData(table) {
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
// src/hooks/useMutationForm.ts
|
|
51
|
-
import { useForm } from "@mantine/form";
|
|
52
|
-
import { useDisclosure } from "@mantine/hooks";
|
|
53
|
-
import { useEffect } from "react";
|
|
54
|
-
function useCreateUpdate({
|
|
55
|
-
initValues,
|
|
56
|
-
createFn,
|
|
57
|
-
updateFn,
|
|
58
|
-
mapInitToForm,
|
|
59
|
-
mapFormToMutateValue,
|
|
60
|
-
validate
|
|
61
|
-
}) {
|
|
62
|
-
const disclosure = useDisclosure();
|
|
63
|
-
const form = useForm({
|
|
64
|
-
mode: "uncontrolled",
|
|
65
|
-
validate
|
|
66
|
-
});
|
|
67
|
-
const mutation = useMyReactMutation({
|
|
68
|
-
axiosFn: (values) => initValues ? updateFn(values) : createFn(values),
|
|
69
|
-
mutationType: initValues ? "update" : "create",
|
|
70
|
-
options: {
|
|
71
|
-
onSuccess: () => {
|
|
72
|
-
disclosure[1].close();
|
|
73
|
-
form.reset();
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
useEffect(() => {
|
|
78
|
-
if (initValues) {
|
|
79
|
-
form.initialize(mapInitToForm(initValues));
|
|
80
|
-
}
|
|
81
|
-
}, [initValues]);
|
|
82
|
-
const handleSubmit = (formValues) => {
|
|
83
|
-
const entity = mapFormToMutateValue(formValues, initValues);
|
|
84
|
-
mutation.mutate(entity);
|
|
85
|
-
};
|
|
86
|
-
return {
|
|
87
|
-
form,
|
|
88
|
-
disclosure,
|
|
89
|
-
mutation,
|
|
90
|
-
handleSubmit
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
50
|
// src/hooks/useMyDevice.ts
|
|
95
51
|
import { useMediaQuery } from "@mantine/hooks";
|
|
96
52
|
function useMyDevice() {
|
|
@@ -365,14 +321,14 @@ baseAxios.interceptors.request.use(
|
|
|
365
321
|
var baseAxios_default = baseAxios;
|
|
366
322
|
|
|
367
323
|
// src/hooks/custom-hooks/useLoadAxiosConfig.ts
|
|
368
|
-
import { useEffect
|
|
324
|
+
import { useEffect, useState as useState3 } from "react";
|
|
369
325
|
var useLoadAxiosConfig = ({
|
|
370
326
|
axiosInstance = baseAxios_default,
|
|
371
327
|
url,
|
|
372
328
|
prefix = ""
|
|
373
329
|
}) => {
|
|
374
330
|
const [flag, setFlag] = useState3(false);
|
|
375
|
-
|
|
331
|
+
useEffect(() => {
|
|
376
332
|
const loadConfig = async () => {
|
|
377
333
|
try {
|
|
378
334
|
const res = await fetch(`${prefix}/config.json`);
|
|
@@ -414,7 +370,6 @@ import { useQuery as useQuery4 } from "@tanstack/react-query";
|
|
|
414
370
|
export {
|
|
415
371
|
useEditableRows,
|
|
416
372
|
useExportData,
|
|
417
|
-
useCreateUpdate,
|
|
418
373
|
useMyDevice,
|
|
419
374
|
useMyRouter,
|
|
420
375
|
createBaseApi,
|
|
@@ -2,8 +2,8 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import react__default, { ReactNode, ComponentProps } from 'react';
|
|
3
3
|
import { t as type_action } from '../type_action-hMF6_2Mr.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
|
-
import { AxiosResponse } from 'axios';
|
|
6
5
|
import { M as MyApiResponse, a as MyReactMutationProps } from '../useMyReactMutation-XkhMBQeB.mjs';
|
|
6
|
+
import { AxiosResponse } from 'axios';
|
|
7
7
|
import { type_mantineSize } from '../types/index.mjs';
|
|
8
8
|
import { useDisclosure, useListState } from '@mantine/hooks';
|
|
9
9
|
import { UseFormReturnType, useForm } from '@mantine/form';
|
|
@@ -69,15 +69,15 @@ import {
|
|
|
69
69
|
useHeaderMegaMenuStore,
|
|
70
70
|
useS_ButtonImport,
|
|
71
71
|
useStore_BasicAppShell
|
|
72
|
-
} from "../chunk-
|
|
72
|
+
} from "../chunk-5F4MYOZX.mjs";
|
|
73
73
|
import "../chunk-PKP6EDBO.mjs";
|
|
74
74
|
import "../chunk-KGBXMHKR.mjs";
|
|
75
75
|
import "../chunk-7ZI7IOEP.mjs";
|
|
76
|
+
import "../chunk-C74M5VPE.mjs";
|
|
76
77
|
import "../chunk-LEFFCELO.mjs";
|
|
77
78
|
import "../chunk-BTITP4TN.mjs";
|
|
78
79
|
import "../chunk-J4WTZ3B4.mjs";
|
|
79
|
-
import "../chunk-
|
|
80
|
-
import "../chunk-KWZCXNJK.mjs";
|
|
80
|
+
import "../chunk-Z76CSZFI.mjs";
|
|
81
81
|
import "../chunk-WZ6PXGGC.mjs";
|
|
82
82
|
import "../chunk-JD6AELXS.mjs";
|
|
83
83
|
export {
|
package/dist/const/index.mjs
CHANGED
package/dist/core/index.d.mts
CHANGED
|
@@ -7,8 +7,8 @@ export { d as MyActionIcon, e as MyButton, f as MyButtonModal } from '../MyDataT
|
|
|
7
7
|
import { UseReactToPrintOptions } from 'react-to-print';
|
|
8
8
|
import { I as IAQFileDetail } from '../utils_file-JlhzjLGS.mjs';
|
|
9
9
|
import { useDisclosure } from '@mantine/hooks';
|
|
10
|
-
import { AxiosResponse } from 'axios';
|
|
11
10
|
import { M as MyApiResponse, a as MyReactMutationProps } from '../useMyReactMutation-XkhMBQeB.mjs';
|
|
11
|
+
import { AxiosResponse } from 'axios';
|
|
12
12
|
import { UseQueryResult, QueryKey, UseQueryOptions } from '@tanstack/react-query';
|
|
13
13
|
import { MRT_RowData, MRT_ColumnDef } from 'mantine-react-table';
|
|
14
14
|
import { TablerIcon } from '@tabler/icons-react';
|
package/dist/core/index.mjs
CHANGED
|
@@ -31,15 +31,15 @@ import {
|
|
|
31
31
|
MyStatsCard,
|
|
32
32
|
MyTextInput2 as MyTextInput,
|
|
33
33
|
MyWeeklySessionSchedulerPicker
|
|
34
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-5F4MYOZX.mjs";
|
|
35
35
|
import "../chunk-PKP6EDBO.mjs";
|
|
36
36
|
import "../chunk-KGBXMHKR.mjs";
|
|
37
37
|
import "../chunk-7ZI7IOEP.mjs";
|
|
38
|
+
import "../chunk-C74M5VPE.mjs";
|
|
38
39
|
import "../chunk-LEFFCELO.mjs";
|
|
39
40
|
import "../chunk-BTITP4TN.mjs";
|
|
40
41
|
import "../chunk-J4WTZ3B4.mjs";
|
|
41
|
-
import "../chunk-
|
|
42
|
-
import "../chunk-KWZCXNJK.mjs";
|
|
42
|
+
import "../chunk-Z76CSZFI.mjs";
|
|
43
43
|
import "../chunk-WZ6PXGGC.mjs";
|
|
44
44
|
import "../chunk-JD6AELXS.mjs";
|
|
45
45
|
export {
|
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { MRT_RowData, MRT_TableInstance } from 'mantine-react-table';
|
|
3
|
+
import * as next_dist_shared_lib_app_router_context_shared_runtime from 'next/dist/shared/lib/app-router-context.shared-runtime';
|
|
4
|
+
import { B as BaseApiType, M as MyApiResponse } from '../useMyReactMutation-XkhMBQeB.mjs';
|
|
5
|
+
export { I as IPagingParams, a as MyReactMutationProps, c as createBaseApi, u as useMyReactMutation } from '../useMyReactMutation-XkhMBQeB.mjs';
|
|
3
6
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
4
7
|
import { QueryKey, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
|
|
5
|
-
import
|
|
6
|
-
import * as _mantine_form from '@mantine/form';
|
|
7
|
-
import { FormValidateInput } from '@mantine/form';
|
|
8
|
-
import { AxiosResponse, AxiosInstance } from 'axios';
|
|
9
|
-
import { M as MyApiResponse, B as BaseApiType } from '../useMyReactMutation-XkhMBQeB.mjs';
|
|
10
|
-
export { I as IPagingParams, a as MyReactMutationProps, c as createBaseApi, u as useMyReactMutation } from '../useMyReactMutation-XkhMBQeB.mjs';
|
|
11
|
-
import * as next_dist_shared_lib_app_router_context_shared_runtime from 'next/dist/shared/lib/app-router-context.shared-runtime';
|
|
8
|
+
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
12
9
|
import { I as IAQModule } from '../IAQModule-bW0dxQvX.mjs';
|
|
13
10
|
import '../type_mutation-CCtnyeP3.mjs';
|
|
14
11
|
import '../IBaseEntity-Am9Cgybw.mjs';
|
|
@@ -36,21 +33,6 @@ declare function useExportData<T extends MRT_RowData>(table: MRT_TableInstance<T
|
|
|
36
33
|
isUsingSelected: boolean;
|
|
37
34
|
};
|
|
38
35
|
|
|
39
|
-
interface UseCreateUpdateProps<TForm extends Record<string, any>, TEntity> {
|
|
40
|
-
initValues?: TEntity;
|
|
41
|
-
createFn: (initData: TEntity) => Promise<AxiosResponse<MyApiResponse<TEntity>>>;
|
|
42
|
-
updateFn: (initData: TEntity) => Promise<AxiosResponse<MyApiResponse<TEntity>>>;
|
|
43
|
-
mapInitToForm: (initData: TEntity) => TForm;
|
|
44
|
-
mapFormToMutateValue: (formData: TForm, initData?: TEntity) => TEntity;
|
|
45
|
-
validate?: FormValidateInput<TForm>;
|
|
46
|
-
}
|
|
47
|
-
declare function useCreateUpdate<TForm extends Record<string, any>, TEntity>({ initValues, createFn, updateFn, mapInitToForm, mapFormToMutateValue, validate, }: UseCreateUpdateProps<TForm, TEntity>): {
|
|
48
|
-
form: _mantine_form.UseFormReturnType<TForm, (values: TForm) => TForm>;
|
|
49
|
-
disclosure: _mantine_hooks.UseDisclosureReturnValue;
|
|
50
|
-
mutation: _tanstack_react_query.UseMutationResult<TEntity, Error, TEntity, unknown>;
|
|
51
|
-
handleSubmit: (formValues: TForm) => void;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
36
|
declare function useMyDevice(): {
|
|
55
37
|
isMobile: boolean;
|
|
56
38
|
isTablet: boolean;
|
|
@@ -106,4 +88,4 @@ declare function useMyReactQuery<IRes, IBody, TData = IRes>({ queryKey, axiosFn,
|
|
|
106
88
|
|
|
107
89
|
declare function useQ_AQ_GetAQModule(): _tanstack_react_query.UseQueryResult<IAQModule, Error>;
|
|
108
90
|
|
|
109
|
-
export { BaseApiType, MyApiResponse, type MyReactQueryProps, useConfig,
|
|
91
|
+
export { BaseApiType, MyApiResponse, type MyReactQueryProps, useConfig, useCrudService, useEditableRows, useExportData, useLoadAxiosConfig, useMyDevice, useMyReactQuery, useMyRouter, useQ_AQ_GetAQModule };
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createBaseApi,
|
|
3
3
|
useConfig,
|
|
4
|
-
useCreateUpdate,
|
|
5
4
|
useCrudService,
|
|
6
5
|
useEditableRows,
|
|
7
6
|
useExportData,
|
|
@@ -11,13 +10,12 @@ import {
|
|
|
11
10
|
useMyReactQuery,
|
|
12
11
|
useMyRouter,
|
|
13
12
|
useQ_AQ_GetAQModule
|
|
14
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-Z76CSZFI.mjs";
|
|
15
14
|
import "../chunk-WZ6PXGGC.mjs";
|
|
16
15
|
import "../chunk-JD6AELXS.mjs";
|
|
17
16
|
export {
|
|
18
17
|
createBaseApi,
|
|
19
18
|
useConfig,
|
|
20
|
-
useCreateUpdate,
|
|
21
19
|
useCrudService,
|
|
22
20
|
useEditableRows,
|
|
23
21
|
useExportData,
|
|
@@ -103,15 +103,15 @@ import {
|
|
|
103
103
|
MailTemplateDeleteButton,
|
|
104
104
|
useS_moduleConfig,
|
|
105
105
|
useStore_Authenticate
|
|
106
|
-
} from "../chunk-
|
|
106
|
+
} from "../chunk-5F4MYOZX.mjs";
|
|
107
107
|
import "../chunk-PKP6EDBO.mjs";
|
|
108
108
|
import "../chunk-KGBXMHKR.mjs";
|
|
109
109
|
import "../chunk-7ZI7IOEP.mjs";
|
|
110
|
+
import "../chunk-C74M5VPE.mjs";
|
|
110
111
|
import "../chunk-LEFFCELO.mjs";
|
|
111
112
|
import "../chunk-BTITP4TN.mjs";
|
|
112
113
|
import "../chunk-J4WTZ3B4.mjs";
|
|
113
|
-
import "../chunk-
|
|
114
|
-
import "../chunk-KWZCXNJK.mjs";
|
|
114
|
+
import "../chunk-Z76CSZFI.mjs";
|
|
115
115
|
import "../chunk-WZ6PXGGC.mjs";
|
|
116
116
|
import "../chunk-JD6AELXS.mjs";
|
|
117
117
|
export {
|
package/dist/shared/index.mjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import "../chunk-NMY3UEY5.mjs";
|
|
2
2
|
import {
|
|
3
3
|
MySelect
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-5F4MYOZX.mjs";
|
|
5
5
|
import "../chunk-PKP6EDBO.mjs";
|
|
6
6
|
import "../chunk-KGBXMHKR.mjs";
|
|
7
7
|
import {
|
|
8
8
|
utils_converter
|
|
9
9
|
} from "../chunk-7ZI7IOEP.mjs";
|
|
10
|
+
import "../chunk-C74M5VPE.mjs";
|
|
10
11
|
import "../chunk-LEFFCELO.mjs";
|
|
11
12
|
import "../chunk-BTITP4TN.mjs";
|
|
12
13
|
import {
|
|
13
14
|
enumLabel_gender,
|
|
14
15
|
enum_gender
|
|
15
16
|
} from "../chunk-J4WTZ3B4.mjs";
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-KWZCXNJK.mjs";
|
|
17
|
+
import "../chunk-Z76CSZFI.mjs";
|
|
18
18
|
import "../chunk-WZ6PXGGC.mjs";
|
|
19
19
|
import {
|
|
20
20
|
__objRest,
|
package/package.json
CHANGED