aq-fe-framework 0.1.562 → 0.1.564

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.
@@ -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";
@@ -419,20 +419,14 @@ import { IconPrinter as IconPrinter3 } from "@tabler/icons-react";
419
419
  import { useRef } from "react";
420
420
  import { useReactToPrint } from "react-to-print";
421
421
  import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
422
- function MyButtonPrintPDF(_a) {
423
- var _b = _a, {
424
- children,
425
- autoPadding = true,
426
- buttonProps,
427
- useReactToPrintProps,
428
- pageSize = "portrait"
429
- } = _b, rest = __objRest(_b, [
430
- "children",
431
- "autoPadding",
432
- "buttonProps",
433
- "useReactToPrintProps",
434
- "pageSize"
435
- ]);
422
+ function MyButtonPrintPDF({
423
+ children,
424
+ autoPadding = true,
425
+ buttonProps,
426
+ useReactToPrintProps,
427
+ pageSize = "portrait"
428
+ // mặc định
429
+ }) {
436
430
  const printRef = useRef(null);
437
431
  const handlePrint = useReactToPrint(__spreadValues({
438
432
  documentTitle: "In n\u1ED9i dung",
@@ -466,11 +460,7 @@ function MyButtonPrintPDF(_a) {
466
460
  Button5,
467
461
  __spreadProps(__spreadValues({
468
462
  color: "orange",
469
- onClick: (e) => {
470
- var _a2;
471
- (_a2 = buttonProps == null ? void 0 : buttonProps.onClick) == null ? void 0 : _a2.call(buttonProps, e);
472
- handlePrint();
473
- },
463
+ onClick: handlePrint,
474
464
  leftSection: /* @__PURE__ */ jsx9(IconPrinter3, {})
475
465
  }, buttonProps), {
476
466
  children: (buttonProps == null ? void 0 : buttonProps.children) || "In"
@@ -1073,6 +1063,9 @@ function MyFlexEnd2(_a) {
1073
1063
  return /* @__PURE__ */ jsx21(Group5, __spreadProps(__spreadValues({ justify: "end", mt: "md" }, rest), { children }));
1074
1064
  }
1075
1065
 
1066
+ // src/core/overlays/MyPrintContent.tsx
1067
+ import { jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
1068
+
1076
1069
  export {
1077
1070
  MyActionIcon,
1078
1071
  MyButton,
@@ -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({
@@ -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";
@@ -74,16 +74,15 @@ interface MyButtonModalFormProps<IEntity> extends MyButtonModalProps {
74
74
  }
75
75
  declare function MyButtonModalForm<IEntity>({ isUpdate, children, form, disclosure, onSubmit, isLoading, ...rest }: MyButtonModalFormProps<IEntity>): react_jsx_runtime.JSX.Element;
76
76
 
77
- type PageSizeOption = "portrait" | "landscape" | "A4-landscape";
77
+ type PageSizeOption$1 = "portrait" | "landscape" | "A4-landscape";
78
78
  interface MyButtonPrintPDFProps {
79
- buttonProps?: Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "style"> & ButtonProps;
79
+ buttonProps?: ButtonProps;
80
80
  children?: ReactNode;
81
81
  autoPadding?: boolean;
82
82
  useReactToPrintProps?: UseReactToPrintOptions;
83
- pageSize?: PageSizeOption;
83
+ pageSize?: PageSizeOption$1;
84
84
  }
85
- declare function MyButtonPrintPDF({ children, autoPadding, buttonProps, useReactToPrintProps, pageSize, // mặc định
86
- ...rest }: MyButtonPrintPDFProps): react_jsx_runtime.JSX.Element;
85
+ declare function MyButtonPrintPDF({ children, autoPadding, buttonProps, useReactToPrintProps, pageSize, }: MyButtonPrintPDFProps): react_jsx_runtime.JSX.Element;
87
86
 
88
87
  declare function MyDataTableSelectOne<TData extends MRT_RowData>({ columns, queryResult, idSelection, setIdSelection }: {
89
88
  columns: MRT_ColumnDef<TData>[];
@@ -199,4 +198,12 @@ interface MyFlexEndProps extends GroupProps {
199
198
  }
200
199
  declare function MyFlexEnd({ children, ...rest }: MyFlexEndProps): react_jsx_runtime.JSX.Element;
201
200
 
202
- export { type IWeeklySession, MyActionIcon, type MyActionIconProps, MyButton, MyButtonCreateUpdate, type MyButtonExportStructureProps, MyButtonModal, MyButtonModalForm, type MyButtonModalFormProps, type MyButtonModalProps, MyButtonPrintPDF, type MyButtonPrintPDFProps, type MyButtonProps$1 as MyButtonProps, MyDataTableSelectOne, MyDayOfWeekPicker, MyFlexColumn, MyFlexEnd, MyFlexIconTitle, MyInfoBox, type MyInfoBoxItem, type MyInfoBoxProps, MyLabelValueRow, MyRichTextEditor, MySelect, MySelectFromAPI, type MySelectFromAPIProps, type MySelectProps, MyStatsCard, MyTextInput, MyWeeklySessionSchedulerPicker, type WeeklySessionSchedulerProps };
201
+ type PageSizeOption = "portrait" | "landscape" | "A4-landscape";
202
+ interface MyPrintContentProps {
203
+ children?: ReactNode;
204
+ autoPadding?: boolean;
205
+ pageSize?: PageSizeOption;
206
+ printRef: React.RefObject<HTMLDivElement>;
207
+ }
208
+
209
+ export { type IWeeklySession, MyActionIcon, type MyActionIconProps, MyButton, MyButtonCreateUpdate, type MyButtonExportStructureProps, MyButtonModal, MyButtonModalForm, type MyButtonModalFormProps, type MyButtonModalProps, MyButtonPrintPDF, type MyButtonPrintPDFProps, type MyButtonProps$1 as MyButtonProps, MyDataTableSelectOne, MyDayOfWeekPicker, MyFlexColumn, MyFlexEnd, MyFlexIconTitle, MyInfoBox, type MyInfoBoxItem, type MyInfoBoxProps, MyLabelValueRow, type MyPrintContentProps, MyRichTextEditor, MySelect, MySelectFromAPI, type MySelectFromAPIProps, type MySelectProps, MyStatsCard, MyTextInput, MyWeeklySessionSchedulerPicker, type WeeklySessionSchedulerProps };
@@ -18,12 +18,12 @@ import {
18
18
  MyStatsCard,
19
19
  MyTextInput,
20
20
  MyWeeklySessionSchedulerPicker
21
- } from "../chunk-7RR5RJTA.mjs";
21
+ } from "../chunk-74LBTATC.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";
@@ -15,11 +15,11 @@ import {
15
15
  MyButton as MyButton2,
16
16
  MyDataTableSelectOne,
17
17
  MyTextInput as MyTextInput2
18
- } from "../chunk-7RR5RJTA.mjs";
18
+ } from "../chunk-74LBTATC.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,
@@ -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";
package/package.json CHANGED
@@ -46,7 +46,7 @@
46
46
  "types": "./dist/coreService/index.d.mts"
47
47
  }
48
48
  },
49
- "version": "0.1.562",
49
+ "version": "0.1.564",
50
50
  "private": false,
51
51
  "files": [
52
52
  "dist"