aq-fe-framework 0.1.559 → 0.1.560

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,6 +1,6 @@
1
1
  import {
2
2
  MyButton
3
- } from "./chunk-VAT2XBDF.mjs";
3
+ } from "./chunk-QIMS22BF.mjs";
4
4
  import {
5
5
  __objRest,
6
6
  __spreadProps,
@@ -2,7 +2,7 @@ import {
2
2
  MyDataTable,
3
3
  MyFlexColumn,
4
4
  MyFlexRow
5
- } from "./chunk-VAT2XBDF.mjs";
5
+ } from "./chunk-QIMS22BF.mjs";
6
6
  import {
7
7
  const_object_colors
8
8
  } from "./chunk-OMJJAHOC.mjs";
@@ -416,7 +416,7 @@ function MyButtonModalForm(_a) {
416
416
  // src/core/button/MyButtonPrintPDF.tsx
417
417
  import { Button as Button5 } from "@mantine/core";
418
418
  import { IconPrinter as IconPrinter3 } from "@tabler/icons-react";
419
- import { useEffect, useRef, useState } from "react";
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
422
  function MyButtonPrintPDF(_a) {
@@ -425,18 +425,14 @@ function MyButtonPrintPDF(_a) {
425
425
  autoPadding = true,
426
426
  buttonProps,
427
427
  useReactToPrintProps,
428
- pageSize = "portrait",
429
- onBeforePrint: onBeforePrint
428
+ pageSize = "portrait"
430
429
  } = _b, rest = __objRest(_b, [
431
430
  "children",
432
431
  "autoPadding",
433
432
  "buttonProps",
434
433
  "useReactToPrintProps",
435
- "pageSize",
436
- // ✅ mặc định
437
- "onBeforePrint"
434
+ "pageSize"
438
435
  ]);
439
- const isPrintState = useState(false);
440
436
  const printRef = useRef(null);
441
437
  const handlePrint = useReactToPrint(__spreadValues({
442
438
  documentTitle: "In n\u1ED9i dung",
@@ -453,19 +449,6 @@ function MyButtonPrintPDF(_a) {
453
449
  return ``;
454
450
  }
455
451
  };
456
- useEffect(() => {
457
- if (isPrintState[0] == false) return;
458
- const doPrint = async () => {
459
- try {
460
- if (onBeforePrint) await onBeforePrint();
461
- await new Promise((resolve) => setTimeout(resolve, 100));
462
- handlePrint == null ? void 0 : handlePrint();
463
- } finally {
464
- isPrintState[1](false);
465
- }
466
- };
467
- doPrint();
468
- }, [isPrintState[0]]);
469
452
  return /* @__PURE__ */ jsxs5(Fragment3, { children: [
470
453
  /* @__PURE__ */ jsx9("style", { children: getPageSizeCSS() }),
471
454
  /* @__PURE__ */ jsx9("div", { style: { display: "none" }, children: /* @__PURE__ */ jsx9(
@@ -483,13 +466,13 @@ function MyButtonPrintPDF(_a) {
483
466
  Button5,
484
467
  __spreadProps(__spreadValues({
485
468
  color: "orange",
486
- leftSection: /* @__PURE__ */ jsx9(IconPrinter3, {})
487
- }, buttonProps), {
488
469
  onClick: (e) => {
489
470
  var _a2;
490
471
  (_a2 = buttonProps == null ? void 0 : buttonProps.onClick) == null ? void 0 : _a2.call(buttonProps, e);
491
- isPrintState[1](true);
472
+ handlePrint();
492
473
  },
474
+ leftSection: /* @__PURE__ */ jsx9(IconPrinter3, {})
475
+ }, buttonProps), {
493
476
  children: (buttonProps == null ? void 0 : buttonProps.children) || "In"
494
477
  })
495
478
  )
@@ -497,7 +480,7 @@ function MyButtonPrintPDF(_a) {
497
480
  }
498
481
 
499
482
  // src/core/dataDisplay/MyDataTableSelectOne.tsx
500
- import { useEffect as useEffect2, useMemo as useMemo2 } from "react";
483
+ import { useEffect, useMemo as useMemo2 } from "react";
501
484
  import { jsx as jsx10 } from "react/jsx-runtime";
502
485
  function MyDataTableSelectOne({
503
486
  columns,
@@ -506,7 +489,7 @@ function MyDataTableSelectOne({
506
489
  setIdSelection
507
490
  }) {
508
491
  const columnsState = useMemo2(() => columns, []);
509
- useEffect2(() => {
492
+ useEffect(() => {
510
493
  if (!queryResult.data) return;
511
494
  setIdSelection(queryResult.data[0].id);
512
495
  }, [queryResult.data]);
@@ -637,7 +620,7 @@ import TextAlign from "@tiptap/extension-text-align";
637
620
  import Underline from "@tiptap/extension-underline";
638
621
  import { useEditor } from "@tiptap/react";
639
622
  import StarterKit from "@tiptap/starter-kit";
640
- import { useEffect as useEffect3 } from "react";
623
+ import { useEffect as useEffect2 } from "react";
641
624
  import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
642
625
  function MyRichTextEditor(props) {
643
626
  const editor = useEditor({
@@ -717,7 +700,7 @@ function MyRichTextEditor(props) {
717
700
  (_a = props.onBlur) == null ? void 0 : _a.call(props, editor2.getHTML());
718
701
  }
719
702
  });
720
- useEffect3(() => {
703
+ useEffect2(() => {
721
704
  if (editor && props.value !== editor.getHTML()) {
722
705
  editor.commands.setContent(props.value || "", false);
723
706
  }
@@ -818,7 +801,7 @@ function MySelect(_a) {
818
801
  }
819
802
 
820
803
  // src/core/input/MySelectFromAPI.tsx
821
- import { useCallback, useEffect as useEffect4, useMemo as useMemo3, useRef as useRef2 } from "react";
804
+ import { useCallback, useEffect as useEffect3, useMemo as useMemo3, useRef as useRef2 } from "react";
822
805
  import { jsx as jsx18 } from "react/jsx-runtime";
823
806
  function MySelectFromAPI(_a) {
824
807
  var _b = _a, {
@@ -872,7 +855,7 @@ function MySelectFromAPI(_a) {
872
855
  setObjectData(selected);
873
856
  }
874
857
  };
875
- useEffect4(() => {
858
+ useEffect3(() => {
876
859
  var _a2, _b2, _c;
877
860
  if (autoSelectFirstItem && !hasAutoSelected.current && ((_a2 = query.data) == null ? void 0 : _a2.length) && (value === void 0 || value === null || value === "")) {
878
861
  const firstItem = query.data[0];
@@ -949,13 +932,13 @@ import {
949
932
  Text as Text5
950
933
  } from "@mantine/core";
951
934
  import { IconPlus as IconPlus4, IconTrash as IconTrash3 } from "@tabler/icons-react";
952
- import { useState as useState2 } from "react";
935
+ import { useState } from "react";
953
936
  import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
954
937
  function MyWeeklySessionSchedulerPicker({
955
938
  value = [],
956
939
  onChange
957
940
  }) {
958
- const [selectedDays, setSelectedDays] = useState2([]);
941
+ const [selectedDays, setSelectedDays] = useState([]);
959
942
  const handleAddSession = (dayOfWeek) => {
960
943
  const newSession = {
961
944
  dayOfWeek,
@@ -546,8 +546,6 @@ function MyActionIconUpdate(_a) {
546
546
  },
547
547
  options: __spreadValues(__spreadValues({
548
548
  onSuccess: () => {
549
- queryClient.invalidateQueries();
550
- utils_notification_show({ crudType: "update" });
551
549
  disc[1].close();
552
550
  }
553
551
  }, onSuccess && {
@@ -67,7 +67,7 @@ import {
67
67
  useS_BasicAppShell,
68
68
  useS_ButtonImport,
69
69
  utils_layout_getItemsWithoutLinks
70
- } from "../chunk-VAT2XBDF.mjs";
70
+ } from "../chunk-QIMS22BF.mjs";
71
71
  import "../chunk-U62R2QKJ.mjs";
72
72
  import "../chunk-5U2JSHSJ.mjs";
73
73
  import "../chunk-OMJJAHOC.mjs";
@@ -81,10 +81,9 @@ interface MyButtonPrintPDFProps {
81
81
  autoPadding?: boolean;
82
82
  useReactToPrintProps?: UseReactToPrintOptions;
83
83
  pageSize?: PageSizeOption;
84
- onBeforePrint?: () => Promise<void>;
85
84
  }
86
85
  declare function MyButtonPrintPDF({ children, autoPadding, buttonProps, useReactToPrintProps, pageSize, // ✅ mặc định
87
- onBeforePrint, ...rest }: MyButtonPrintPDFProps): react_jsx_runtime.JSX.Element;
86
+ ...rest }: MyButtonPrintPDFProps): react_jsx_runtime.JSX.Element;
88
87
 
89
88
  declare function MyDataTableSelectOne<TData extends MRT_RowData>({ columns, queryResult, idSelection, setIdSelection }: {
90
89
  columns: MRT_ColumnDef<TData>[];
@@ -18,12 +18,12 @@ import {
18
18
  MyStatsCard,
19
19
  MyTextInput,
20
20
  MyWeeklySessionSchedulerPicker
21
- } from "../chunk-YJQBV6MS.mjs";
21
+ } from "../chunk-OYDVMTRL.mjs";
22
22
  import "../chunk-GFEMKKFH.mjs";
23
23
  import {
24
24
  MyModalDelete
25
- } from "../chunk-RO44L2EA.mjs";
26
- import "../chunk-VAT2XBDF.mjs";
25
+ } from "../chunk-O3ZHCTDD.mjs";
26
+ import "../chunk-QIMS22BF.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-RO44L2EA.mjs";
4
- import "../chunk-VAT2XBDF.mjs";
3
+ } from "../chunk-O3ZHCTDD.mjs";
4
+ import "../chunk-QIMS22BF.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-YJQBV6MS.mjs";
18
+ } from "../chunk-OYDVMTRL.mjs";
19
19
  import {
20
20
  const_object_documentTypes
21
21
  } from "../chunk-GFEMKKFH.mjs";
22
- import "../chunk-RO44L2EA.mjs";
22
+ import "../chunk-O3ZHCTDD.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-VAT2XBDF.mjs";
48
+ } from "../chunk-QIMS22BF.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.559",
49
+ "version": "0.1.560",
50
50
  "private": false,
51
51
  "files": [
52
52
  "dist"
@@ -98,6 +98,7 @@
98
98
  "@tiptap/pm": "^2.9.1",
99
99
  "@tiptap/react": "^2.9.1",
100
100
  "@tiptap/starter-kit": "^2.9.1",
101
+ "aq-fe-framework": "^0.1.559",
101
102
  "autoprefixer": "^10.4.20",
102
103
  "axios": "^1.7.7",
103
104
  "caniuse-lite": "^1.0.30001718",