aq-fe-framework 0.1.561 → 0.1.563

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.
@@ -491,7 +491,6 @@ function MyActionIconDelete(_a) {
491
491
 
492
492
  // src/components/ActionIcons/ActionIconCRUD/MyActionIconUpdate.tsx
493
493
  import { useDisclosure as useDisclosure3 } from "@mantine/hooks";
494
- import { useQueryClient as useQueryClient2 } from "@tanstack/react-query";
495
494
  import { useEffect as useEffect2 } from "react";
496
495
  import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
497
496
  function MyActionIconUpdate(_a) {
@@ -513,61 +512,45 @@ function MyActionIconUpdate(_a) {
513
512
  "useMyReactMutationProps"
514
513
  ]);
515
514
  const disc = useDisclosure3();
516
- const queryClient = useQueryClient2();
517
515
  const mutation = useMyReactMutation(__spreadValues({
518
516
  axiosFn: (values) => {
519
- if (process.env.NEXT_PUBLIC_APP_PROTOTYPE == "1") {
520
- console.log("S\u1EEDa th\xE0nh c\xF4ng (gi\u1EA3 l\u1EADp)");
521
- return Promise.resolve({
522
- data: {
523
- message: "S\u1EEDa th\xE0nh c\xF4ng (gi\u1EA3 l\u1EADp)",
524
- data: {},
525
- isSuccess: 1
526
- },
527
- status: 200,
528
- statusText: "OK",
529
- headers: {},
530
- config: {}
531
- });
532
- }
533
- const result = onSubmit(values);
534
- if (result === void 0) {
535
- return Promise.resolve({
536
- data: {
537
- message: "S\u1EEDa th\xE0nh c\xF4ng (gi\u1EA3 l\u1EADp)",
538
- data: {},
539
- isSuccess: 1
540
- },
541
- status: 200,
542
- statusText: "OK",
543
- headers: {},
544
- config: {}
545
- });
546
- }
547
- return result;
517
+ return values;
548
518
  },
549
- options: __spreadValues(__spreadValues({
550
- onSuccess: () => {
551
- queryClient.invalidateQueries();
552
- disc[1].close();
553
- }
554
- }, onSuccess && {
555
- onSuccess: () => {
556
- onSuccess();
557
- }
558
- }), onError && {
559
- onError: () => {
560
- onError();
519
+ options: {
520
+ onSuccess: (...args) => {
521
+ onSuccess == null ? void 0 : onSuccess(...args);
522
+ },
523
+ onError: (...args) => {
524
+ onError == null ? void 0 : onError(...args);
561
525
  }
562
- })
526
+ }
563
527
  }, useMyReactMutationProps));
564
528
  useEffect2(() => {
565
529
  if (!resetFormWhenclose) return;
566
530
  if (disc[0] == true) return;
567
531
  form.reset();
568
532
  }, [disc[0]]);
569
- return /* @__PURE__ */ jsx11(MyActionIconModal, __spreadProps(__spreadValues({ disclosure: disc, crudType: "update" }, rest), { children: /* @__PURE__ */ jsx11("form", { onSubmit: form.onSubmit((values) => {
570
- mutation.mutate(values);
533
+ return /* @__PURE__ */ jsx11(MyActionIconModal, __spreadProps(__spreadValues({ disclosure: disc, crudType: "update" }, rest), { children: /* @__PURE__ */ jsx11("form", { onSubmit: form.onSubmit((values, event) => {
534
+ event.stopPropagation();
535
+ const result = onSubmit(values);
536
+ let axiosPromise;
537
+ if (result == false) return;
538
+ if (result == void 0) {
539
+ axiosPromise = Promise.resolve({
540
+ data: {
541
+ message: "T\u1EA1o th\xE0nh c\xF4ng (gi\u1EA3 l\u1EADp)",
542
+ data: {},
543
+ isSuccess: 1
544
+ },
545
+ status: 200,
546
+ statusText: "OK",
547
+ headers: {},
548
+ config: {}
549
+ });
550
+ } else {
551
+ axiosPromise = result;
552
+ }
553
+ mutation.mutate(axiosPromise);
571
554
  }), children: /* @__PURE__ */ jsxs5(MyFlexColumn, { children: [
572
555
  children,
573
556
  /* @__PURE__ */ jsx11(
@@ -836,7 +819,7 @@ function MyAnchorViewPDF({ label, pdfLink }) {
836
819
  import { FileInput } from "@mantine/core";
837
820
  import { useDisclosure as useDisclosure6 } from "@mantine/hooks";
838
821
  import { IconFileTypeXls } from "@tabler/icons-react";
839
- import { useMutation, useQueryClient as useQueryClient3 } from "@tanstack/react-query";
822
+ import { useMutation, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
840
823
  import * as XLSX from "xlsx";
841
824
 
842
825
  // src/components/Button/ButtonModal/MyButtonModal.tsx
@@ -964,7 +947,7 @@ function AQButtonCreateByImportFile(_a) {
964
947
  "setImportedData"
965
948
  ]);
966
949
  const disc = useDisclosure6();
967
- const queryClient = useQueryClient3();
950
+ const queryClient = useQueryClient2();
968
951
  const mutation = useMutation({
969
952
  mutationFn: async () => {
970
953
  return await onSubmit();
@@ -1062,7 +1045,7 @@ function AQButtonExportData({
1062
1045
 
1063
1046
  // src/components/Button/ButtonCRUD/MyButtonCreate.tsx
1064
1047
  import { useDisclosure as useDisclosure7 } from "@mantine/hooks";
1065
- import { useQueryClient as useQueryClient4 } from "@tanstack/react-query";
1048
+ import { useQueryClient as useQueryClient3 } from "@tanstack/react-query";
1066
1049
  import { jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
1067
1050
  function MyButtonCreate(_a) {
1068
1051
  var _b = _a, {
@@ -1086,7 +1069,7 @@ function MyButtonCreate(_a) {
1086
1069
  ]);
1087
1070
  const defaultDisclosure = useDisclosure7();
1088
1071
  const disclosure = externalDisclosure != null ? externalDisclosure : defaultDisclosure;
1089
- const queryClient = useQueryClient4();
1072
+ const queryClient = useQueryClient3();
1090
1073
  const mutation = useMyReactMutation({
1091
1074
  axiosFn: (values) => {
1092
1075
  const result = onSubmit(values);
@@ -1138,7 +1121,7 @@ function MyButtonCreate(_a) {
1138
1121
  // src/components/Button/ButtonCRUD/MyButtonDeleteList.tsx
1139
1122
  import { Group as Group5, Highlight as Highlight2 } from "@mantine/core";
1140
1123
  import { useDisclosure as useDisclosure8 } from "@mantine/hooks";
1141
- import { useMutation as useMutation2, useQueryClient as useQueryClient5 } from "@tanstack/react-query";
1124
+ import { useMutation as useMutation2, useQueryClient as useQueryClient4 } from "@tanstack/react-query";
1142
1125
  import { useState as useState7 } from "react";
1143
1126
  import { jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
1144
1127
  function MyButtonDeleteList(_a) {
@@ -1153,7 +1136,7 @@ function MyButtonDeleteList(_a) {
1153
1136
  "onError",
1154
1137
  "contextData"
1155
1138
  ]);
1156
- const queryClient = useQueryClient5();
1139
+ const queryClient = useQueryClient4();
1157
1140
  const disc = useDisclosure8();
1158
1141
  const loadingState = useState7();
1159
1142
  const mutation = useMutation2({
@@ -2,7 +2,7 @@ import {
2
2
  MyDataTable,
3
3
  MyFlexColumn,
4
4
  MyFlexRow
5
- } from "./chunk-YUS7RADW.mjs";
5
+ } from "./chunk-HETWN2YJ.mjs";
6
6
  import {
7
7
  const_object_colors
8
8
  } from "./chunk-OMJJAHOC.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MyButton
3
- } from "./chunk-YUS7RADW.mjs";
3
+ } from "./chunk-HETWN2YJ.mjs";
4
4
  import {
5
5
  __objRest,
6
6
  __spreadProps,
@@ -67,12 +67,12 @@ declare function MyActionIconDelete<IRes>({ onSubmit, onSuccess, onError, contex
67
67
 
68
68
  interface IActionIconUpdate<IReq, IRes> extends Omit<ComponentProps<typeof MyActionIconModal>, "form" | "disclosure" | "onSubmit"> {
69
69
  resetFormWhenclose?: boolean;
70
- onSubmit: (values: IReq) => Promise<AxiosResponse<MyApiResponse<IRes>>> | void;
71
- onSuccess?: () => void;
72
- onError?: () => void;
70
+ onSubmit: (values: IReq) => Promise<AxiosResponse<MyApiResponse<IRes>>> | false | void;
71
+ onSuccess?: (...args: any[]) => void;
72
+ onError?: (...args: any[]) => void;
73
73
  form: UseFormReturnType<IReq>;
74
74
  disclosure?: ReturnType<typeof useDisclosure>;
75
- useMyReactMutationProps?: Omit<MyReactMutationProps<IReq, IRes>, 'axiosFn'>;
75
+ useMyReactMutationProps?: Omit<MyReactMutationProps<Promise<AxiosResponse<MyApiResponse<IRes>, any>>, IRes>, "axiosFn">;
76
76
  }
77
77
  declare function MyActionIconUpdate<IReq, IRes>({ resetFormWhenclose, form, onSubmit, onSuccess, onError, children, useMyReactMutationProps, ...rest }: IActionIconUpdate<IReq, IRes>): react_jsx_runtime.JSX.Element;
78
78
 
@@ -67,7 +67,7 @@ import {
67
67
  useS_BasicAppShell,
68
68
  useS_ButtonImport,
69
69
  utils_layout_getItemsWithoutLinks
70
- } from "../chunk-YUS7RADW.mjs";
70
+ } from "../chunk-HETWN2YJ.mjs";
71
71
  import "../chunk-U62R2QKJ.mjs";
72
72
  import "../chunk-5U2JSHSJ.mjs";
73
73
  import "../chunk-OMJJAHOC.mjs";
@@ -18,12 +18,12 @@ import {
18
18
  MyStatsCard,
19
19
  MyTextInput,
20
20
  MyWeeklySessionSchedulerPicker
21
- } from "../chunk-7RR5RJTA.mjs";
21
+ } from "../chunk-NJ3WGV35.mjs";
22
22
  import "../chunk-GFEMKKFH.mjs";
23
23
  import {
24
24
  MyModalDelete
25
- } from "../chunk-DCEXN776.mjs";
26
- import "../chunk-YUS7RADW.mjs";
25
+ } from "../chunk-RHSY3L7P.mjs";
26
+ import "../chunk-HETWN2YJ.mjs";
27
27
  import "../chunk-U62R2QKJ.mjs";
28
28
  import "../chunk-5U2JSHSJ.mjs";
29
29
  import "../chunk-OMJJAHOC.mjs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  MyModalDelete
3
- } from "../chunk-DCEXN776.mjs";
4
- import "../chunk-YUS7RADW.mjs";
3
+ } from "../chunk-RHSY3L7P.mjs";
4
+ import "../chunk-HETWN2YJ.mjs";
5
5
  import "../chunk-U62R2QKJ.mjs";
6
6
  import "../chunk-5U2JSHSJ.mjs";
7
7
  import "../chunk-OMJJAHOC.mjs";
@@ -12,20 +12,20 @@ import {
12
12
  U0DateToDDMMYYYString
13
13
  } from "../chunk-EWDS5IOF.mjs";
14
14
  import {
15
- MyButton,
15
+ MyButton as MyButton2,
16
16
  MyDataTableSelectOne,
17
17
  MyTextInput as MyTextInput2
18
- } from "../chunk-7RR5RJTA.mjs";
18
+ } from "../chunk-NJ3WGV35.mjs";
19
19
  import {
20
20
  const_object_documentTypes
21
21
  } from "../chunk-GFEMKKFH.mjs";
22
- import "../chunk-DCEXN776.mjs";
22
+ import "../chunk-RHSY3L7P.mjs";
23
23
  import {
24
24
  F_authenticate_Logout,
25
25
  MyActionIconDelete,
26
26
  MyActionIconUpdate,
27
27
  MyBoxesBackground,
28
- MyButton as MyButton2,
28
+ MyButton,
29
29
  MyButtonCreate,
30
30
  MyButtonModal,
31
31
  MyButtonViewPDF,
@@ -45,7 +45,7 @@ import {
45
45
  groupToTwoLevels,
46
46
  useS_authenticate,
47
47
  utils_layout_getItemsWithoutLinks
48
- } from "../chunk-YUS7RADW.mjs";
48
+ } from "../chunk-HETWN2YJ.mjs";
49
49
  import {
50
50
  createGenericStore
51
51
  } from "../chunk-U62R2QKJ.mjs";
@@ -210,7 +210,7 @@ function Permission_SaveMenuPermission({
210
210
  }
211
211
  });
212
212
  return /* @__PURE__ */ jsx3(
213
- MyButton,
213
+ MyButton2,
214
214
  {
215
215
  onClick: () => {
216
216
  mutation.mutate((values == null ? void 0 : values.filter((item) => item.id != "0").map((item) => ({
@@ -831,7 +831,7 @@ function F_accessControl_Save() {
831
831
  }
832
832
  disable[1](false);
833
833
  }, [store.state.rolePermissions]);
834
- return /* @__PURE__ */ jsx9(MyButton2, { disabled: disable[0], crudType: "save", onClick: handleSave });
834
+ return /* @__PURE__ */ jsx9(MyButton, { disabled: disable[0], crudType: "save", onClick: handleSave });
835
835
  }
836
836
 
837
837
  // src/modules-features/admin/core/accessControl/old/F_accessControl.tsx
@@ -1285,7 +1285,7 @@ function F_accessControlLevel_Save() {
1285
1285
  }
1286
1286
  disable[1](false);
1287
1287
  }, [store.state.rolePermissions]);
1288
- return /* @__PURE__ */ jsx16(MyButton2, { disabled: disable[0], crudType: "save", onClick: handleSave });
1288
+ return /* @__PURE__ */ jsx16(MyButton, { disabled: disable[0], crudType: "save", onClick: handleSave });
1289
1289
  }
1290
1290
 
1291
1291
  // src/modules-features/admin/core/accessControlLevel/old/F_accessControlLevel.tsx
@@ -3056,7 +3056,7 @@ function F_core35923() {
3056
3056
  /* @__PURE__ */ jsx49(Grid5.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ jsx49(MyFileInput, { label: "Favicon (16px x 16px)" }) }),
3057
3057
  /* @__PURE__ */ jsx49(Grid5.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ jsx49(MyFileInput, { label: "Logo (330px x 115px)" }) })
3058
3058
  ] }),
3059
- /* @__PURE__ */ jsx49(MyFlexEnd, { children: /* @__PURE__ */ jsx49(MyButton2, { crudType: "save" }) })
3059
+ /* @__PURE__ */ jsx49(MyFlexEnd, { children: /* @__PURE__ */ jsx49(MyButton, { crudType: "save" }) })
3060
3060
  ] });
3061
3061
  }
3062
3062
 
@@ -4443,7 +4443,7 @@ function F_moduleConfig_Save({
4443
4443
  });
4444
4444
  }
4445
4445
  return /* @__PURE__ */ jsx83(
4446
- MyButton2,
4446
+ MyButton,
4447
4447
  {
4448
4448
  disabled: !form.isDirty(),
4449
4449
  crudType: "save",
@@ -4899,13 +4899,13 @@ import { useMemo as useMemo20 } from "react";
4899
4899
  // src/modules-features/admin/core/pageContentConfig/F_pageContentConfig_DeleteDescription.tsx
4900
4900
  import { jsx as jsx91 } from "react/jsx-runtime";
4901
4901
  function F_pageContentConfig_DeleteDescription() {
4902
- return /* @__PURE__ */ jsx91(MyButton, { actionType: "delete" });
4902
+ return /* @__PURE__ */ jsx91(MyButton2, { actionType: "delete" });
4903
4903
  }
4904
4904
 
4905
4905
  // src/modules-features/admin/core/pageContentConfig/F_pageContentConfig_Export.tsx
4906
4906
  import { jsx as jsx92 } from "react/jsx-runtime";
4907
4907
  function F_pageContentConfig_Export() {
4908
- return /* @__PURE__ */ jsx92(MyButton, { actionType: "export" });
4908
+ return /* @__PURE__ */ jsx92(MyButton2, { actionType: "export" });
4909
4909
  }
4910
4910
 
4911
4911
  // src/modules-features/admin/core/pageContentConfig/F_pageContentConfig_Save.tsx
@@ -4917,7 +4917,7 @@ function F_pageContentConfig_Save({ menuValues }) {
4917
4917
  return service_pageContent.updateList([{ id: 1 }]);
4918
4918
  }
4919
4919
  });
4920
- return /* @__PURE__ */ jsx93(MyButton, { actionType: "save", onClick: () => updatePageConfigMutation.mutate({}) });
4920
+ return /* @__PURE__ */ jsx93(MyButton2, { actionType: "save", onClick: () => updatePageConfigMutation.mutate({}) });
4921
4921
  }
4922
4922
 
4923
4923
  // src/modules-features/admin/core/pageContentConfig/F_pageContentConfig_ReadMenu.tsx
package/package.json CHANGED
@@ -46,7 +46,7 @@
46
46
  "types": "./dist/coreService/index.d.mts"
47
47
  }
48
48
  },
49
- "version": "0.1.561",
49
+ "version": "0.1.563",
50
50
  "private": false,
51
51
  "files": [
52
52
  "dist"