aq-fe-framework 0.1.511 → 0.1.512
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-JYZUJKAM.mjs → chunk-4RT3JFPJ.mjs} +1 -1
- package/dist/{chunk-5IELATPH.mjs → chunk-GIBGEGLU.mjs} +14 -2
- package/dist/{chunk-TXRNH2ZM.mjs → chunk-H6JXSSOQ.mjs} +2 -2
- package/dist/chunk-Z4DYBTYB.mjs +17 -0
- package/dist/components/index.mjs +3 -2
- package/dist/core/index.mjs +5 -4
- package/dist/enum/index.d.mts +2 -0
- package/dist/enum/index.mjs +7 -1
- package/dist/enum_mutationType-Dn5oi0sv.d.mts +8 -0
- package/dist/hooks/index.d.mts +3 -1
- package/dist/hooks/index.mjs +2 -1
- package/dist/modules-features/index.mjs +17 -16
- package/package.json +1 -1
@@ -1,3 +1,6 @@
|
|
1
|
+
import {
|
2
|
+
enumLabel_mutationTypeNotification
|
3
|
+
} from "./chunk-Z4DYBTYB.mjs";
|
1
4
|
import {
|
2
5
|
__spreadProps,
|
3
6
|
__spreadValues
|
@@ -149,17 +152,26 @@ import { useQueryClient } from "@tanstack/react-query";
|
|
149
152
|
|
150
153
|
// src/hooks/custom-hooks/useMyReactMutation.ts
|
151
154
|
import { notifications } from "@mantine/notifications";
|
152
|
-
import { useMutation } from "@tanstack/react-query";
|
155
|
+
import { useMutation, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
153
156
|
function useMyReactMutation({
|
154
157
|
axiosFn,
|
155
|
-
options
|
158
|
+
options,
|
159
|
+
mutationType = "create" /* Create */
|
156
160
|
}) {
|
161
|
+
const queryClient = useQueryClient2();
|
157
162
|
return useMutation(__spreadValues({
|
158
163
|
mutationFn: async (values) => {
|
159
164
|
const res = await axiosFn(values);
|
160
165
|
if (res.data.isSuccess == 0) throw new Error(res.data.message);
|
161
166
|
return res.data.data;
|
162
167
|
},
|
168
|
+
onSuccess: () => {
|
169
|
+
notifications.show({
|
170
|
+
message: enumLabel_mutationTypeNotification[mutationType],
|
171
|
+
color: "green"
|
172
|
+
});
|
173
|
+
queryClient.invalidateQueries();
|
174
|
+
},
|
163
175
|
onError: (e) => {
|
164
176
|
if (e.message === null || e.message === "null") {
|
165
177
|
notifications.show({
|
@@ -2,7 +2,7 @@ import {
|
|
2
2
|
MyDataTable,
|
3
3
|
MyFlexColumn,
|
4
4
|
MyFlexRow
|
5
|
-
} from "./chunk-
|
5
|
+
} from "./chunk-4RT3JFPJ.mjs";
|
6
6
|
import {
|
7
7
|
const_object_colors
|
8
8
|
} from "./chunk-OMJJAHOC.mjs";
|
@@ -12,7 +12,7 @@ import {
|
|
12
12
|
import {
|
13
13
|
useMyReactMutation,
|
14
14
|
useMyReactQuery
|
15
|
-
} from "./chunk-
|
15
|
+
} from "./chunk-GIBGEGLU.mjs";
|
16
16
|
import {
|
17
17
|
utils_notification_show
|
18
18
|
} from "./chunk-7ZCOFATU.mjs";
|
@@ -0,0 +1,17 @@
|
|
1
|
+
// src/enum/enum_mutationType.ts
|
2
|
+
var enum_mutationType = /* @__PURE__ */ ((enum_mutationType2) => {
|
3
|
+
enum_mutationType2["Create"] = "create";
|
4
|
+
enum_mutationType2["Update"] = "update";
|
5
|
+
enum_mutationType2["Delete"] = "delete";
|
6
|
+
return enum_mutationType2;
|
7
|
+
})(enum_mutationType || {});
|
8
|
+
var enumLabel_mutationTypeNotification = {
|
9
|
+
["create" /* Create */]: "T\u1EA1o m\u1EDBi th\xE0nh c\xF4ng!",
|
10
|
+
["update" /* Update */]: "C\u1EADp nh\u1EADt th\xE0nh c\xF4ng!",
|
11
|
+
["delete" /* Delete */]: "Xo\xE1 th\xE0nh c\xF4ng!"
|
12
|
+
};
|
13
|
+
|
14
|
+
export {
|
15
|
+
enum_mutationType,
|
16
|
+
enumLabel_mutationTypeNotification
|
17
|
+
};
|
@@ -67,12 +67,13 @@ import {
|
|
67
67
|
useS_BasicAppShell,
|
68
68
|
useS_ButtonImport,
|
69
69
|
utils_layout_getItemsWithoutLinks
|
70
|
-
} from "../chunk-
|
70
|
+
} from "../chunk-4RT3JFPJ.mjs";
|
71
71
|
import "../chunk-U62R2QKJ.mjs";
|
72
72
|
import "../chunk-5U2JSHSJ.mjs";
|
73
73
|
import "../chunk-OMJJAHOC.mjs";
|
74
|
-
import "../chunk-
|
74
|
+
import "../chunk-GIBGEGLU.mjs";
|
75
75
|
import "../chunk-7ZCOFATU.mjs";
|
76
|
+
import "../chunk-Z4DYBTYB.mjs";
|
76
77
|
import "../chunk-FWCSY2DS.mjs";
|
77
78
|
export {
|
78
79
|
AQButtonCreateByImportFile,
|
package/dist/core/index.mjs
CHANGED
@@ -18,15 +18,16 @@ import {
|
|
18
18
|
MyStatsCard,
|
19
19
|
MyTextInput,
|
20
20
|
MyWeeklySessionSchedulerPicker
|
21
|
-
} from "../chunk-
|
22
|
-
import "../chunk-
|
21
|
+
} from "../chunk-H6JXSSOQ.mjs";
|
22
|
+
import "../chunk-GFEMKKFH.mjs";
|
23
|
+
import "../chunk-4RT3JFPJ.mjs";
|
23
24
|
import "../chunk-U62R2QKJ.mjs";
|
24
25
|
import "../chunk-5U2JSHSJ.mjs";
|
25
|
-
import "../chunk-GFEMKKFH.mjs";
|
26
26
|
import "../chunk-OMJJAHOC.mjs";
|
27
27
|
import "../chunk-K6S7R6LU.mjs";
|
28
|
-
import "../chunk-
|
28
|
+
import "../chunk-GIBGEGLU.mjs";
|
29
29
|
import "../chunk-7ZCOFATU.mjs";
|
30
|
+
import "../chunk-Z4DYBTYB.mjs";
|
30
31
|
import "../chunk-FWCSY2DS.mjs";
|
31
32
|
export {
|
32
33
|
MyActionIcon,
|
package/dist/enum/index.d.mts
CHANGED
package/dist/enum/index.mjs
CHANGED
@@ -4,6 +4,10 @@ import {
|
|
4
4
|
import {
|
5
5
|
enum_daysOfWeek
|
6
6
|
} from "../chunk-K6S7R6LU.mjs";
|
7
|
+
import {
|
8
|
+
enumLabel_mutationTypeNotification,
|
9
|
+
enum_mutationType
|
10
|
+
} from "../chunk-Z4DYBTYB.mjs";
|
7
11
|
import "../chunk-FWCSY2DS.mjs";
|
8
12
|
|
9
13
|
// src/enum/enum_gender.ts
|
@@ -20,7 +24,9 @@ var enumLabel_gender = {
|
|
20
24
|
};
|
21
25
|
export {
|
22
26
|
enumLabel_gender,
|
27
|
+
enumLabel_mutationTypeNotification,
|
23
28
|
enum_daysOfWeek,
|
24
29
|
enum_emailConfigModule,
|
25
|
-
enum_gender
|
30
|
+
enum_gender,
|
31
|
+
enum_mutationType
|
26
32
|
};
|
package/dist/hooks/index.d.mts
CHANGED
@@ -5,6 +5,7 @@ import * as React from 'react';
|
|
5
5
|
import { AxiosInstance, AxiosResponse } from 'axios';
|
6
6
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
7
7
|
import { UseMutationOptions, QueryKey, UseQueryOptions } from '@tanstack/react-query';
|
8
|
+
import { e as enum_mutationType } from '../enum_mutationType-Dn5oi0sv.mjs';
|
8
9
|
import { I as IAQModule } from '../IAQModule-4U3n2emx.mjs';
|
9
10
|
import '../IBaseEntity-ChMy9RzQ.mjs';
|
10
11
|
|
@@ -46,8 +47,9 @@ declare const useLoadAxiosConfig: ({ axiosInstance, url, }: {
|
|
46
47
|
interface MyReactMutationProps<IReq, IRes> {
|
47
48
|
axiosFn: (values: IReq) => Promise<AxiosResponse<MyApiResponse<IRes>>>;
|
48
49
|
options?: UseMutationOptions<IRes, Error, IReq>;
|
50
|
+
mutationType?: enum_mutationType;
|
49
51
|
}
|
50
|
-
declare function useMyReactMutation<IReq, IRes>({ axiosFn, options, }: MyReactMutationProps<IReq, IRes>): _tanstack_react_query.UseMutationResult<IRes, Error, IReq, unknown>;
|
52
|
+
declare function useMyReactMutation<IReq, IRes>({ axiosFn, options, mutationType }: MyReactMutationProps<IReq, IRes>): _tanstack_react_query.UseMutationResult<IRes, Error, IReq, unknown>;
|
51
53
|
|
52
54
|
interface MyReactQueryProps<IRes, IBody> {
|
53
55
|
queryKey?: QueryKey;
|
package/dist/hooks/index.mjs
CHANGED
@@ -7,8 +7,9 @@ import {
|
|
7
7
|
useMyReactQuery,
|
8
8
|
useMyRouter,
|
9
9
|
useQ_AQ_GetAQModule
|
10
|
-
} from "../chunk-
|
10
|
+
} from "../chunk-GIBGEGLU.mjs";
|
11
11
|
import "../chunk-7ZCOFATU.mjs";
|
12
|
+
import "../chunk-Z4DYBTYB.mjs";
|
12
13
|
import "../chunk-FWCSY2DS.mjs";
|
13
14
|
export {
|
14
15
|
createBaseApi,
|
@@ -13,16 +13,19 @@ import {
|
|
13
13
|
U0DateToDDMMYYYString
|
14
14
|
} from "../chunk-EWDS5IOF.mjs";
|
15
15
|
import {
|
16
|
-
MyButton
|
16
|
+
MyButton,
|
17
17
|
MyDataTableSelectOne,
|
18
18
|
MyTextInput as MyTextInput2
|
19
|
-
} from "../chunk-
|
19
|
+
} from "../chunk-H6JXSSOQ.mjs";
|
20
|
+
import {
|
21
|
+
const_object_documentTypes
|
22
|
+
} from "../chunk-GFEMKKFH.mjs";
|
20
23
|
import {
|
21
24
|
F_authenticate_Logout,
|
22
25
|
MyActionIconDelete,
|
23
26
|
MyActionIconUpdate,
|
24
27
|
MyBoxesBackground,
|
25
|
-
MyButton,
|
28
|
+
MyButton as MyButton2,
|
26
29
|
MyButtonCreate,
|
27
30
|
MyButtonModal,
|
28
31
|
MyButtonViewPDF,
|
@@ -42,14 +45,11 @@ import {
|
|
42
45
|
groupToTwoLevels,
|
43
46
|
useS_authenticate,
|
44
47
|
utils_layout_getItemsWithoutLinks
|
45
|
-
} from "../chunk-
|
48
|
+
} from "../chunk-4RT3JFPJ.mjs";
|
46
49
|
import {
|
47
50
|
createGenericStore
|
48
51
|
} from "../chunk-U62R2QKJ.mjs";
|
49
52
|
import "../chunk-5U2JSHSJ.mjs";
|
50
|
-
import {
|
51
|
-
const_object_documentTypes
|
52
|
-
} from "../chunk-GFEMKKFH.mjs";
|
53
53
|
import {
|
54
54
|
const_object_colors
|
55
55
|
} from "../chunk-OMJJAHOC.mjs";
|
@@ -66,10 +66,11 @@ import {
|
|
66
66
|
useMyRouter,
|
67
67
|
useQ_AQ_GetAQModule,
|
68
68
|
useQ_SkillCenter_GetAll
|
69
|
-
} from "../chunk-
|
69
|
+
} from "../chunk-GIBGEGLU.mjs";
|
70
70
|
import {
|
71
71
|
utils_notification_show
|
72
72
|
} from "../chunk-7ZCOFATU.mjs";
|
73
|
+
import "../chunk-Z4DYBTYB.mjs";
|
73
74
|
import {
|
74
75
|
__objRest,
|
75
76
|
__spreadProps,
|
@@ -211,7 +212,7 @@ function Permission_SaveMenuPermission({
|
|
211
212
|
}
|
212
213
|
});
|
213
214
|
return /* @__PURE__ */ jsx3(
|
214
|
-
|
215
|
+
MyButton,
|
215
216
|
{
|
216
217
|
onClick: () => {
|
217
218
|
mutation.mutate((values == null ? void 0 : values.filter((item) => item.id != "0").map((item) => ({
|
@@ -832,7 +833,7 @@ function F_accessControl_Save() {
|
|
832
833
|
}
|
833
834
|
disable[1](false);
|
834
835
|
}, [store.state.rolePermissions]);
|
835
|
-
return /* @__PURE__ */ jsx9(
|
836
|
+
return /* @__PURE__ */ jsx9(MyButton2, { disabled: disable[0], crudType: "save", onClick: handleSave });
|
836
837
|
}
|
837
838
|
|
838
839
|
// src/modules-features/admin/core/accessControl/old/F_accessControl.tsx
|
@@ -1286,7 +1287,7 @@ function F_accessControlLevel_Save() {
|
|
1286
1287
|
}
|
1287
1288
|
disable[1](false);
|
1288
1289
|
}, [store.state.rolePermissions]);
|
1289
|
-
return /* @__PURE__ */ jsx16(
|
1290
|
+
return /* @__PURE__ */ jsx16(MyButton2, { disabled: disable[0], crudType: "save", onClick: handleSave });
|
1290
1291
|
}
|
1291
1292
|
|
1292
1293
|
// src/modules-features/admin/core/accessControlLevel/old/F_accessControlLevel.tsx
|
@@ -3057,7 +3058,7 @@ function F_core35923() {
|
|
3057
3058
|
/* @__PURE__ */ jsx49(Grid5.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ jsx49(MyFileInput, { label: "Favicon (16px x 16px)" }) }),
|
3058
3059
|
/* @__PURE__ */ jsx49(Grid5.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ jsx49(MyFileInput, { label: "Logo (330px x 115px)" }) })
|
3059
3060
|
] }),
|
3060
|
-
/* @__PURE__ */ jsx49(MyFlexEnd, { children: /* @__PURE__ */ jsx49(
|
3061
|
+
/* @__PURE__ */ jsx49(MyFlexEnd, { children: /* @__PURE__ */ jsx49(MyButton2, { crudType: "save" }) })
|
3061
3062
|
] });
|
3062
3063
|
}
|
3063
3064
|
|
@@ -4444,7 +4445,7 @@ function F_moduleConfig_Save({
|
|
4444
4445
|
});
|
4445
4446
|
}
|
4446
4447
|
return /* @__PURE__ */ jsx83(
|
4447
|
-
|
4448
|
+
MyButton2,
|
4448
4449
|
{
|
4449
4450
|
disabled: !form.isDirty(),
|
4450
4451
|
crudType: "save",
|
@@ -4900,13 +4901,13 @@ import { useMemo as useMemo20 } from "react";
|
|
4900
4901
|
// src/modules-features/admin/core/pageContentConfig/F_pageContentConfig_DeleteDescription.tsx
|
4901
4902
|
import { jsx as jsx91 } from "react/jsx-runtime";
|
4902
4903
|
function F_pageContentConfig_DeleteDescription() {
|
4903
|
-
return /* @__PURE__ */ jsx91(
|
4904
|
+
return /* @__PURE__ */ jsx91(MyButton, { actionType: "delete" });
|
4904
4905
|
}
|
4905
4906
|
|
4906
4907
|
// src/modules-features/admin/core/pageContentConfig/F_pageContentConfig_Export.tsx
|
4907
4908
|
import { jsx as jsx92 } from "react/jsx-runtime";
|
4908
4909
|
function F_pageContentConfig_Export() {
|
4909
|
-
return /* @__PURE__ */ jsx92(
|
4910
|
+
return /* @__PURE__ */ jsx92(MyButton, { actionType: "export" });
|
4910
4911
|
}
|
4911
4912
|
|
4912
4913
|
// src/modules-features/admin/core/pageContentConfig/F_pageContentConfig_Save.tsx
|
@@ -4918,7 +4919,7 @@ function F_pageContentConfig_Save({ menuValues }) {
|
|
4918
4919
|
return service_pageContent.updateList([{ id: 1 }]);
|
4919
4920
|
}
|
4920
4921
|
});
|
4921
|
-
return /* @__PURE__ */ jsx93(
|
4922
|
+
return /* @__PURE__ */ jsx93(MyButton, { actionType: "save", onClick: () => updatePageConfigMutation.mutate({}) });
|
4922
4923
|
}
|
4923
4924
|
|
4924
4925
|
// src/modules-features/admin/core/pageContentConfig/F_pageContentConfig_ReadMenu.tsx
|