aq-fe-framework 0.1.501 → 0.1.502

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.
@@ -377,18 +377,28 @@ function MyButtonPrintPDF({
377
377
  children,
378
378
  autoPadding = true,
379
379
  buttonProps,
380
- useReactToPrintProps
380
+ useReactToPrintProps,
381
+ pageSize = "portrait"
382
+ // ✅ mặc định
381
383
  }) {
382
384
  const printRef = useRef(null);
383
385
  const handlePrint = useReactToPrint(__spreadValues({
384
386
  documentTitle: "In n\u1ED9i dung",
385
387
  contentRef: printRef
386
388
  }, useReactToPrintProps));
387
- function handleClick() {
388
- if (!children) return;
389
- handlePrint();
390
- }
389
+ const getPageSizeCSS = () => {
390
+ switch (pageSize) {
391
+ case "landscape":
392
+ return `@media print {@page { size: landscape; }}`;
393
+ case "A4-landscape":
394
+ return `@media print {@page { size: 29.7cm 21cm; }}`;
395
+ case "portrait":
396
+ default:
397
+ return ``;
398
+ }
399
+ };
391
400
  return /* @__PURE__ */ jsxs4(Fragment3, { children: [
401
+ /* @__PURE__ */ jsx9("style", { children: getPageSizeCSS() }),
392
402
  /* @__PURE__ */ jsx9("div", { style: { display: "none" }, children: /* @__PURE__ */ jsx9(
393
403
  "div",
394
404
  {
@@ -400,7 +410,16 @@ function MyButtonPrintPDF({
400
410
  children
401
411
  }
402
412
  ) }),
403
- /* @__PURE__ */ jsx9(Button5, __spreadProps(__spreadValues({ color: "orange", onClick: handleClick, leftSection: /* @__PURE__ */ jsx9(IconPrinter3, {}) }, buttonProps), { children: (buttonProps == null ? void 0 : buttonProps.children) || "In" }))
413
+ /* @__PURE__ */ jsx9(
414
+ Button5,
415
+ __spreadProps(__spreadValues({
416
+ color: "orange",
417
+ onClick: handlePrint,
418
+ leftSection: /* @__PURE__ */ jsx9(IconPrinter3, {})
419
+ }, buttonProps), {
420
+ children: (buttonProps == null ? void 0 : buttonProps.children) || "In"
421
+ })
422
+ )
404
423
  ] });
405
424
  }
406
425
 
@@ -67,13 +67,15 @@ interface MyButtonModalCreateUpdateProps extends Omit<MyButtonModalProps, "discl
67
67
  }
68
68
  declare function MyButtonModalCreateUpdate(props?: MyButtonModalCreateUpdateProps): react_jsx_runtime.JSX.Element;
69
69
 
70
+ type PageSizeOption = "portrait" | "landscape" | "A4-landscape";
70
71
  interface MyButtonPrintPDFProps {
71
72
  buttonProps?: ButtonProps;
72
73
  children?: ReactNode;
73
74
  autoPadding?: boolean;
74
75
  useReactToPrintProps?: UseReactToPrintOptions;
76
+ pageSize?: PageSizeOption;
75
77
  }
76
- declare function MyButtonPrintPDF({ children, autoPadding, buttonProps, useReactToPrintProps, }: MyButtonPrintPDFProps): react_jsx_runtime.JSX.Element;
78
+ declare function MyButtonPrintPDF({ children, autoPadding, buttonProps, useReactToPrintProps, pageSize, }: MyButtonPrintPDFProps): react_jsx_runtime.JSX.Element;
77
79
 
78
80
  declare function MyDataTableSelectOne<TData extends MRT_RowData>({ columns, queryResult, idSelection, setIdSelection }: {
79
81
  columns: MRT_ColumnDef<TData>[];
@@ -18,7 +18,7 @@ import {
18
18
  MyStatsCard,
19
19
  MyTextInput,
20
20
  MyWeeklySessionSchedulerPicker
21
- } from "../chunk-K2DC3T55.mjs";
21
+ } from "../chunk-SH7FDAU2.mjs";
22
22
  import "../chunk-YAMXCOJ5.mjs";
23
23
  import "../chunk-U62R2QKJ.mjs";
24
24
  import "../chunk-5U2JSHSJ.mjs";
@@ -15,7 +15,7 @@ import {
15
15
  MyButton as MyButton2,
16
16
  MyDataTableSelectOne,
17
17
  MyTextInput as MyTextInput2
18
- } from "../chunk-K2DC3T55.mjs";
18
+ } from "../chunk-SH7FDAU2.mjs";
19
19
  import {
20
20
  F_authenticate_Logout,
21
21
  MyActionIconDelete,
package/package.json CHANGED
@@ -42,7 +42,7 @@
42
42
  "types": "./dist/columns/index.d.mts"
43
43
  }
44
44
  },
45
- "version": "0.1.501",
45
+ "version": "0.1.502",
46
46
  "private": false,
47
47
  "files": [
48
48
  "dist"