aq-fe-framework 0.1.500 → 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.
- package/dist/{chunk-CMWDA4NM.mjs → chunk-RBWFK2GG.mjs} +1 -1
- package/dist/{chunk-K2DC3T55.mjs → chunk-SH7FDAU2.mjs} +25 -6
- package/dist/core/index.d.mts +3 -1
- package/dist/core/index.mjs +1 -1
- package/dist/modules-features/index.mjs +2 -2
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.mjs +1 -1
- package/package.json +1 -1
@@ -213,7 +213,7 @@ async function utils_file_docxtemplaterDownload({
|
|
213
213
|
|
214
214
|
// src/utils/utils_format.ts
|
215
215
|
function utils_format_fixDecimal(number, digits = 2) {
|
216
|
-
if (typeof number !== "number" || isNaN(number)) return 0;
|
216
|
+
if (typeof number !== "number" || isNaN(number)) return void 0;
|
217
217
|
return parseFloat(number.toFixed(digits));
|
218
218
|
}
|
219
219
|
|
@@ -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
|
-
|
388
|
-
|
389
|
-
|
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(
|
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
|
|
package/dist/core/index.d.mts
CHANGED
@@ -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>[];
|
package/dist/core/index.mjs
CHANGED
@@ -4,7 +4,7 @@ import {
|
|
4
4
|
utils_config_getBaseUrl,
|
5
5
|
utils_converter_enumToSelectOptions,
|
6
6
|
utils_file_fileToAQDocumentType
|
7
|
-
} from "../chunk-
|
7
|
+
} from "../chunk-RBWFK2GG.mjs";
|
8
8
|
import {
|
9
9
|
baseColumns
|
10
10
|
} from "../chunk-BEFEWY44.mjs";
|
@@ -15,7 +15,7 @@ import {
|
|
15
15
|
MyButton as MyButton2,
|
16
16
|
MyDataTableSelectOne,
|
17
17
|
MyTextInput as MyTextInput2
|
18
|
-
} from "../chunk-
|
18
|
+
} from "../chunk-SH7FDAU2.mjs";
|
19
19
|
import {
|
20
20
|
F_authenticate_Logout,
|
21
21
|
MyActionIconDelete,
|
package/dist/utils/index.d.mts
CHANGED
@@ -26,7 +26,7 @@ declare function utils_date_dateToDDMMYYYString(date?: Date | string): string;
|
|
26
26
|
declare function utils_date_formatToDateTimeStartEnd(startDate: Date, endDate: Date): string;
|
27
27
|
declare function utils_date_getHHmm(date: Date): string;
|
28
28
|
|
29
|
-
declare function utils_format_fixDecimal(number: number, digits?: number): number;
|
29
|
+
declare function utils_format_fixDecimal(number: number, digits?: number): number | undefined;
|
30
30
|
|
31
31
|
/**
|
32
32
|
* Cập nhật danh sách dạng many-to-many có cờ enable.
|
package/dist/utils/index.mjs
CHANGED