aq-fe-framework 0.1.1087 → 0.1.1089

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.
@@ -1,5 +1,5 @@
1
1
  import {
2
- createGenericStore,
2
+ createGenericStore as createGenericStore2,
3
3
  useAppStore,
4
4
  useStore_Permission,
5
5
  useStore_ProjectInfo
@@ -27,7 +27,7 @@ import {
27
27
  utils_text
28
28
  } from "./chunk-7ZI7IOEP.mjs";
29
29
  import {
30
- createGenericStore as createGenericStore2
30
+ createGenericStore
31
31
  } from "./chunk-BTITP4TN.mjs";
32
32
  import {
33
33
  const_object_colors,
@@ -609,8 +609,6 @@ function MyButtonCreateUpdate({
609
609
  submitButtonProps,
610
610
  form,
611
611
  onSubmit,
612
- onSuccess,
613
- onError,
614
612
  ignoreDefaultOnError,
615
613
  ignoreDefaultOnSuccess,
616
614
  closeModalWhenSubmit = true,
@@ -631,34 +629,38 @@ function MyButtonCreateUpdate({
631
629
  },
632
630
  mutationType: isUpdate ? "update" : "create"
633
631
  }, useMyReactMutationProps), {
634
- options: __spreadProps(__spreadValues({
635
- onError: (error) => {
636
- let parsed;
637
- try {
638
- parsed = JSON.parse(error.message);
639
- } catch (e4) {
640
- parsed = null;
641
- }
642
- if (parsed == null ? void 0 : parsed.data) {
643
- Object.entries(parsed.data).forEach(([field, message]) => {
644
- form.setFieldError(field.charAt(0).toLowerCase() + field.slice(1), message);
645
- });
646
- const errorMessages = Object.values(parsed.data).join(", ");
647
- notifications.show({
648
- title: "Kh\xF4ng th\u1EC3 l\u01B0u d\u1EEF li\u1EC7u",
649
- message: errorMessages,
650
- color: "red"
651
- });
652
- return;
632
+ options: __spreadProps(__spreadValues({}, useMyReactMutationProps == null ? void 0 : useMyReactMutationProps.options), {
633
+ onError: (error, variables, context) => {
634
+ var _a, _b;
635
+ if (!ignoreDefaultOnError) {
636
+ let parsed;
637
+ try {
638
+ parsed = JSON.parse(error.message);
639
+ } catch (e4) {
640
+ parsed = null;
641
+ }
642
+ if (parsed == null ? void 0 : parsed.data) {
643
+ Object.entries(parsed.data).forEach(([field, message]) => {
644
+ form.setFieldError(field.charAt(0).toLowerCase() + field.slice(1), message);
645
+ });
646
+ const errorMessages = Object.values(parsed.data).join(", ");
647
+ notifications.show({
648
+ title: "Kh\xF4ng th\u1EC3 l\u01B0u d\u1EEF li\u1EC7u",
649
+ message: errorMessages,
650
+ color: "red"
651
+ });
652
+ return;
653
+ }
653
654
  }
654
- }
655
- }, useMyReactMutationProps == null ? void 0 : useMyReactMutationProps.options), {
655
+ (_b = (_a = useMyReactMutationProps == null ? void 0 : useMyReactMutationProps.options) == null ? void 0 : _a.onError) == null ? void 0 : _b.call(_a, error, variables, context);
656
+ },
656
657
  onSuccess: (...args) => {
658
+ var _a, _b;
657
659
  if (!ignoreDefaultOnSuccess) {
658
660
  if (closeModalWhenSubmit) disclosure[1].close();
659
661
  if (resetFormWhenSubmit) form.reset();
660
662
  }
661
- onSuccess == null ? void 0 : onSuccess(...args);
663
+ (_b = (_a = useMyReactMutationProps == null ? void 0 : useMyReactMutationProps.options) == null ? void 0 : _a.onSuccess) == null ? void 0 : _b.call(_a, ...args);
662
664
  }
663
665
  })
664
666
  }));
@@ -1883,7 +1885,7 @@ import { IconArrowBackUp, IconArrowBigLeft, IconArrowBigRight, IconSquareRounded
1883
1885
  // src/components/Button/ButtonImport/useS_ButtonImport.ts
1884
1886
  import { useEffect as useEffect5, useMemo as useMemo2 } from "react";
1885
1887
  import * as XLSX2 from "xlsx";
1886
- var useStore = createGenericStore2({
1888
+ var useStore = createGenericStore({
1887
1889
  initialState: {
1888
1890
  data: [],
1889
1891
  title: [],
@@ -7898,7 +7900,7 @@ function AQStatCard2({
7898
7900
  import { useEffect as useEffect9 } from "react";
7899
7901
 
7900
7902
  // src/components/Layouts/BasicAppShell/useStore_BasicAppShell.ts
7901
- var useStore2 = createGenericStore2({
7903
+ var useStore2 = createGenericStore({
7902
7904
  initialState: {
7903
7905
  menuCode: "",
7904
7906
  moduleCode: "Module code",
@@ -10351,7 +10353,7 @@ import { IconSearch as IconSearch4 } from "@tabler/icons-react";
10351
10353
  import { useEffect as useEffect20, useMemo as useMemo9, useState as useState18 } from "react";
10352
10354
 
10353
10355
  // src/modules-features/admin/core/accountManagement/useStore_AccountManagement.ts
10354
- var useStore3 = createGenericStore({
10356
+ var useStore3 = createGenericStore2({
10355
10357
  initialState: {}
10356
10358
  });
10357
10359
  function useStore_AccountManagement() {
@@ -14101,6 +14103,10 @@ import { Group as Group26 } from "@mantine/core";
14101
14103
  import { useMemo as useMemo23 } from "react";
14102
14104
  import { jsx as jsx154, jsxs as jsxs90 } from "react/jsx-runtime";
14103
14105
  function LecturerListTable() {
14106
+ const query = useMyReactQuery({
14107
+ queryKey: ["lecturers"],
14108
+ axiosFn: service_account.getEdusoftNetAccount
14109
+ });
14104
14110
  const columns = useMemo23(() => [
14105
14111
  {
14106
14112
  header: "M\xE3 vi\xEAn ch\u1EE9c",
@@ -14155,10 +14161,7 @@ function LecturerListTable() {
14155
14161
  return /* @__PURE__ */ jsx154(
14156
14162
  CustomDataTableAPI,
14157
14163
  {
14158
- reactQueryProps: {
14159
- queryKey: ["lecturers"],
14160
- axiosFn: service_account.getEdusoftNetAccount
14161
- },
14164
+ query,
14162
14165
  enableRowSelection: true,
14163
14166
  renderTopToolbarCustomActions: ({ table }) => /* @__PURE__ */ jsxs90(Group26, { children: [
14164
14167
  /* @__PURE__ */ jsx154(LecturerListSyncFromEdusoft, {}),
@@ -14411,7 +14414,7 @@ import { useEffect as useEffect28 } from "react";
14411
14414
  import { useMutation as useMutation3 } from "@tanstack/react-query";
14412
14415
 
14413
14416
  // src/modules-features/admin/core/moduleConfig/useS_moduleConfig.ts
14414
- var useStore4 = createGenericStore2({
14417
+ var useStore4 = createGenericStore({
14415
14418
  initialState: {}
14416
14419
  });
14417
14420
  function useS_moduleConfig() {
@@ -16577,7 +16580,7 @@ import { useRouter as useRouter4 } from "next/navigation.js";
16577
16580
  import { useEffect as useEffect36 } from "react";
16578
16581
 
16579
16582
  // src/modules-features/authenticate/useStore_Authenticate.ts
16580
- var useStore5 = createGenericStore2({
16583
+ var useStore5 = createGenericStore({
16581
16584
  initialState: { token: "", saveLogin: false, username: "", password: "", workingUnitId: 0, roleIds: [] },
16582
16585
  storageKey: "useStore_Authenticate"
16583
16586
  });
@@ -17402,7 +17405,7 @@ import Link4 from "next/link.js";
17402
17405
  import classes from "./css.module-4ICLUKPO.module.css";
17403
17406
 
17404
17407
  // src/components/Layouts/HeaderMegaMenu/HeaderMegaMenuStore.ts
17405
- var useStore6 = createGenericStore2({
17408
+ var useStore6 = createGenericStore({
17406
17409
  initialState: { name: "\u0110\u0103ng k\xFD kh\xF3a h\u1ECDc" },
17407
17410
  storageKey: "HeaderMegaMenuStore"
17408
17411
  });
@@ -18675,7 +18678,7 @@ function CustomDataTableAPI(_a) {
18675
18678
  deleteFn,
18676
18679
  deleteListFn,
18677
18680
  buttonCreateUpdateProps,
18678
- reactQueryProps,
18681
+ query: query,
18679
18682
  renderCreateUpdateContent,
18680
18683
  getInitValues,
18681
18684
  enableCreate,
@@ -18684,13 +18687,13 @@ function CustomDataTableAPI(_a) {
18684
18687
  "deleteFn",
18685
18688
  "deleteListFn",
18686
18689
  "buttonCreateUpdateProps",
18687
- "reactQueryProps",
18690
+ // reactQueryProps,
18691
+ "query",
18688
18692
  "renderCreateUpdateContent",
18689
18693
  "getInitValues",
18690
18694
  "enableCreate",
18691
18695
  "enableUpdate"
18692
18696
  ]);
18693
- const query = useMyReactQuery(reactQueryProps);
18694
18697
  return /* @__PURE__ */ jsx245(
18695
18698
  MyDataTable,
18696
18699
  __spreadProps(__spreadValues({
@@ -69,7 +69,7 @@ import {
69
69
  useHeaderMegaMenuStore,
70
70
  useS_ButtonImport,
71
71
  useStore_BasicAppShell
72
- } from "../chunk-YIXR7XL3.mjs";
72
+ } from "../chunk-WNS27PWD.mjs";
73
73
  import "../chunk-WW55EZ4B.mjs";
74
74
  import "../chunk-KGBXMHKR.mjs";
75
75
  import "../chunk-7ZI7IOEP.mjs";
@@ -18,7 +18,7 @@ import { UseEditorOptions } from '@tiptap/react';
18
18
  import { M as MySelectProps } from '../MySelect-CEgpggSF.mjs';
19
19
  export { a as MySelect } from '../MySelect-CEgpggSF.mjs';
20
20
  import { I as IBaseEntity } from '../IBaseEntity-BVJRftBU.mjs';
21
- import { M as MyReactQueryProps } from '../useMyReactQuery-CqXIs4-6.mjs';
21
+ import { u as useMyReactQuery } from '../useMyReactQuery-CqXIs4-6.mjs';
22
22
  import '../type_action-hMF6_2Mr.mjs';
23
23
  import '../type_mutation-CCtnyeP3.mjs';
24
24
  import '@tanstack/react-table';
@@ -70,8 +70,6 @@ interface MyButtonCreateUpdateProps<IReq, IRes> {
70
70
  scrollAreaAutosizeProps?: ScrollAreaAutosizeProps;
71
71
  isUpdate?: boolean;
72
72
  onSubmit: (values: IReq, isUpdate?: boolean) => Promise<AxiosResponse<MyApiResponse<IRes>>> | false | void;
73
- onSuccess?: (...args: any[]) => void;
74
- onError?: (...args: any[]) => void;
75
73
  ignoreDefaultOnSuccess?: boolean;
76
74
  ignoreDefaultOnError?: boolean;
77
75
  form: UseFormReturnType<IReq>;
@@ -83,7 +81,7 @@ interface MyButtonCreateUpdateProps<IReq, IRes> {
83
81
  useMyReactMutationProps?: Omit<MyReactMutationProps<Promise<AxiosResponse<MyApiResponse<IRes>, any>>, IRes>, "axiosFn">;
84
82
  initValues?: IReq;
85
83
  }
86
- declare function MyButtonCreateUpdate<IReq, IRes>({ modalProps, actionIconProps, toolTipProps, buttonProps, submitButtonProps, form, onSubmit, onSuccess, onError, ignoreDefaultOnError, ignoreDefaultOnSuccess, closeModalWhenSubmit, resetFormWhenSubmit, children, disclosure: externalDisclosure, isUpdate, scrollAreaAutosizeProps, useMyReactMutationProps, initValues }: MyButtonCreateUpdateProps<IReq, IRes>): react_jsx_runtime.JSX.Element;
84
+ declare function MyButtonCreateUpdate<IReq, IRes>({ modalProps, actionIconProps, toolTipProps, buttonProps, submitButtonProps, form, onSubmit, ignoreDefaultOnError, ignoreDefaultOnSuccess, closeModalWhenSubmit, resetFormWhenSubmit, children, disclosure: externalDisclosure, isUpdate, scrollAreaAutosizeProps, useMyReactMutationProps, initValues }: MyButtonCreateUpdateProps<IReq, IRes>): react_jsx_runtime.JSX.Element;
87
85
 
88
86
  interface CustomThemeIconSquareCheckProps {
89
87
  checked?: boolean;
@@ -306,7 +304,7 @@ interface ValidationResult {
306
304
  }
307
305
 
308
306
  interface CustomDataTableAPIProps<TData extends MRT_RowData, IReq, IResQuery, IResMutation> extends Omit<MyDataTableProps<TData>, "data"> {
309
- reactQueryProps: MyReactQueryProps<IResQuery, IReq, TData[]>;
307
+ query: ReturnType<typeof useMyReactQuery<IResQuery, IReq, TData[]>>;
310
308
  deleteFn?: (id: number) => Promise<any> | void;
311
309
  deleteListFn?: (ids: number[]) => Promise<any> | void;
312
310
  buttonCreateUpdateProps?: MyButtonCreateUpdateProps<IReq, IResMutation>;
@@ -315,7 +313,7 @@ interface CustomDataTableAPIProps<TData extends MRT_RowData, IReq, IResQuery, IR
315
313
  enableCreate?: boolean;
316
314
  enableUpdate?: boolean;
317
315
  }
318
- declare function CustomDataTableAPI<TData extends MRT_RowData, IReq = any, IResQuery = TData[], IResMutation = TData>({ deleteFn, deleteListFn, buttonCreateUpdateProps, reactQueryProps, renderCreateUpdateContent, getInitValues, enableCreate, enableUpdate, ...rest }: CustomDataTableAPIProps<TData, IReq, IResQuery, IResMutation>): react_jsx_runtime.JSX.Element;
316
+ declare function CustomDataTableAPI<TData extends MRT_RowData, IReq = any, IResQuery = TData[], IResMutation = TData>({ deleteFn, deleteListFn, buttonCreateUpdateProps, query, renderCreateUpdateContent, getInitValues, enableCreate, enableUpdate, ...rest }: CustomDataTableAPIProps<TData, IReq, IResQuery, IResMutation>): react_jsx_runtime.JSX.Element;
319
317
 
320
318
  interface CustomDeleteListAPIProps<TData extends MRT_RowData> extends Omit<MyButtonDeleteListProps, "onSubmit"> {
321
319
  table: MRT_TableInstance<TData>;
@@ -34,7 +34,7 @@ import {
34
34
  MyStatsCard,
35
35
  MyTextInput2 as MyTextInput,
36
36
  MyWeeklySessionSchedulerPicker
37
- } from "../chunk-YIXR7XL3.mjs";
37
+ } from "../chunk-WNS27PWD.mjs";
38
38
  import "../chunk-WW55EZ4B.mjs";
39
39
  import "../chunk-KGBXMHKR.mjs";
40
40
  import "../chunk-7ZI7IOEP.mjs";
@@ -1,6 +1,6 @@
1
1
  export { A as AcademicYearUpdateDto, I as IAcademicYear, a as IEmailConfig, b as IEmailTemplate } from '../IEmailTemplate-D2se2igm.mjs';
2
- import { I as IBaseEntity } from '../IBaseEntity-BVJRftBU.mjs';
3
2
  import { I as IAQFileDetail } from '../utils_file-JlhzjLGS.mjs';
3
+ import { I as IBaseEntity } from '../IBaseEntity-BVJRftBU.mjs';
4
4
  export { I as IAQModule } from '../IAQModule-DbiJ8E6q.mjs';
5
5
  export { I as IBaseDomain } from '../IBaseDomain-BG4Sm7_Z.mjs';
6
6
  export { I as IPagePermission } from '../IPagePermission-992CbJhp.mjs';
@@ -13,7 +13,7 @@ interface IUserSkillCenters extends IBaseEntity {
13
13
  interface IWorkingUnit extends IBaseEntity {
14
14
  }
15
15
 
16
- interface IAccount extends IBaseEntity {
16
+ interface IUser extends IBaseEntity {
17
17
  password?: string;
18
18
  passwordHash?: string;
19
19
  userName?: string;
@@ -34,6 +34,9 @@ interface IAccount extends IBaseEntity {
34
34
  isExternal?: boolean;
35
35
  }
36
36
 
37
+ interface IAccount extends IUser {
38
+ }
39
+
37
40
  interface ICodeFormula extends IBaseEntity {
38
41
  operationType?: number;
39
42
  frequency?: number;
@@ -143,14 +146,6 @@ interface IRole extends IBaseEntity {
143
146
  note?: string;
144
147
  }
145
148
 
146
- interface IUser extends IBaseEntity {
147
- userName?: string;
148
- fullName?: string;
149
- email?: string;
150
- workingUnitId?: number;
151
- workingUnitName?: string;
152
- }
153
-
154
149
  interface IPageContent extends IBaseEntity {
155
150
  description?: string;
156
151
  }
@@ -97,7 +97,7 @@ import {
97
97
  MailTemplateDeleteButton,
98
98
  useS_moduleConfig,
99
99
  useStore_Authenticate
100
- } from "../chunk-YIXR7XL3.mjs";
100
+ } from "../chunk-WNS27PWD.mjs";
101
101
  import "../chunk-WW55EZ4B.mjs";
102
102
  import "../chunk-KGBXMHKR.mjs";
103
103
  import "../chunk-7ZI7IOEP.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MySelect
3
- } from "../chunk-YIXR7XL3.mjs";
3
+ } from "../chunk-WNS27PWD.mjs";
4
4
  import "../chunk-WW55EZ4B.mjs";
5
5
  import "../chunk-KGBXMHKR.mjs";
6
6
  import {
@@ -1,5 +1,5 @@
1
- import { I as IBaseDomain } from '../IBaseDomain-BG4Sm7_Z.mjs';
2
1
  import { I as IBaseEntity } from '../IBaseEntity-BVJRftBU.mjs';
2
+ import { I as IBaseDomain } from '../IBaseDomain-BG4Sm7_Z.mjs';
3
3
  import ExcelJS from 'exceljs';
4
4
  export { I as IAQFileDetail, a as utils_file_AQDocumentTypeToFile, c as utils_file_base64ToFile, b as utils_file_docxtemplaterDownload, u as utils_file_fileToAQDocumentType } from '../utils_file-JlhzjLGS.mjs';
5
5
  import { DefaultMantineColor } from '@mantine/core';
package/package.json CHANGED
@@ -58,7 +58,7 @@
58
58
  "types": "./dist/zod-schemas/index.d.mts"
59
59
  }
60
60
  },
61
- "version": "0.1.1087",
61
+ "version": "0.1.1089",
62
62
  "private": false,
63
63
  "files": [
64
64
  "dist"