aq-fe-framework 0.1.501 → 0.1.503
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-K2DC3T55.mjs → chunk-LB6M373A.mjs} +57 -45
- package/dist/{chunk-YAMXCOJ5.mjs → chunk-LJRJYSNW.mjs} +3 -3
- package/dist/components/index.mjs +1 -1
- package/dist/core/index.d.mts +3 -1
- package/dist/core/index.mjs +2 -2
- package/dist/modules-features/index.mjs +2 -2
- package/package.json +1 -1
@@ -2,7 +2,7 @@ import {
|
|
2
2
|
MyDataTable,
|
3
3
|
MyFlexColumn,
|
4
4
|
MyFlexRow
|
5
|
-
} from "./chunk-
|
5
|
+
} from "./chunk-LJRJYSNW.mjs";
|
6
6
|
import {
|
7
7
|
const_object_colors
|
8
8
|
} from "./chunk-OMJJAHOC.mjs";
|
@@ -101,73 +101,75 @@ function MyActionIcon(_a) {
|
|
101
101
|
import { Button } from "@mantine/core";
|
102
102
|
import {
|
103
103
|
IconDeviceFloppy as IconDeviceFloppy2,
|
104
|
+
IconDownload,
|
104
105
|
IconEdit as IconEdit2,
|
105
|
-
IconFileExport as IconFileExport2,
|
106
|
-
IconFileImport as IconFileImport2,
|
107
106
|
IconPlus as IconPlus2,
|
108
107
|
IconPrinter as IconPrinter2,
|
109
108
|
IconTrash as IconTrash2,
|
109
|
+
IconUpload,
|
110
110
|
IconX as IconX2
|
111
111
|
} from "@tabler/icons-react";
|
112
112
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
113
113
|
var actionConfig2 = {
|
114
114
|
default: {
|
115
|
-
|
115
|
+
children: ""
|
116
116
|
},
|
117
117
|
create: {
|
118
118
|
color: "blue",
|
119
119
|
type: "submit",
|
120
|
-
|
121
|
-
|
120
|
+
leftSection: /* @__PURE__ */ jsx2(IconPlus2, {}),
|
121
|
+
children: "Th\xEAm"
|
122
122
|
},
|
123
123
|
createMultiple: {
|
124
124
|
color: "green",
|
125
125
|
type: "submit",
|
126
|
-
|
127
|
-
|
126
|
+
leftSection: /* @__PURE__ */ jsx2(IconPlus2, {}),
|
127
|
+
children: "Th\xEAm danh s\xE1ch"
|
128
128
|
},
|
129
129
|
delete: {
|
130
130
|
color: "red",
|
131
|
-
|
132
|
-
|
131
|
+
leftSection: /* @__PURE__ */ jsx2(IconTrash2, {}),
|
132
|
+
children: "X\xF3a"
|
133
133
|
},
|
134
134
|
update: {
|
135
135
|
color: "yellow",
|
136
136
|
type: "submit",
|
137
|
-
|
138
|
-
|
137
|
+
leftSection: /* @__PURE__ */ jsx2(IconEdit2, {}),
|
138
|
+
children: "Ch\u1EC9nh s\u1EEDa"
|
139
139
|
},
|
140
140
|
save: {
|
141
141
|
color: "blue",
|
142
142
|
type: "submit",
|
143
|
-
|
144
|
-
|
143
|
+
leftSection: /* @__PURE__ */ jsx2(IconDeviceFloppy2, {}),
|
144
|
+
children: "L\u01B0u"
|
145
145
|
},
|
146
146
|
import: {
|
147
|
-
color: "green
|
148
|
-
|
149
|
-
|
147
|
+
color: "green",
|
148
|
+
leftSection: /* @__PURE__ */ jsx2(IconUpload, {}),
|
149
|
+
children: "Import",
|
150
|
+
variant: "light"
|
151
|
+
},
|
152
|
+
export: {
|
153
|
+
color: "violet",
|
154
|
+
leftSection: /* @__PURE__ */ jsx2(IconDownload, {}),
|
155
|
+
children: "Export",
|
156
|
+
variant: "light"
|
150
157
|
},
|
151
158
|
print: {
|
152
159
|
color: "orange.7",
|
153
|
-
|
154
|
-
|
155
|
-
},
|
156
|
-
export: {
|
157
|
-
color: "green.8",
|
158
|
-
icon: /* @__PURE__ */ jsx2(IconFileExport2, {}),
|
159
|
-
defaultText: "Export"
|
160
|
+
leftSection: /* @__PURE__ */ jsx2(IconPrinter2, {}),
|
161
|
+
children: "In"
|
160
162
|
},
|
161
163
|
cancel: {
|
162
164
|
color: "gray",
|
163
|
-
|
164
|
-
|
165
|
+
leftSection: /* @__PURE__ */ jsx2(IconX2, {}),
|
166
|
+
children: "H\u1EE7y thao t\xE1c"
|
165
167
|
},
|
166
168
|
select: {
|
167
|
-
|
169
|
+
children: "Ch\u1ECDn"
|
168
170
|
},
|
169
171
|
check: {
|
170
|
-
|
172
|
+
children: "Ch\u1ECDn"
|
171
173
|
}
|
172
174
|
};
|
173
175
|
function MyButton(_a) {
|
@@ -176,16 +178,7 @@ function MyButton(_a) {
|
|
176
178
|
return /* @__PURE__ */ jsx2(Button, __spreadProps(__spreadValues({}, rest), { children }));
|
177
179
|
}
|
178
180
|
const config = actionConfig2[actionType];
|
179
|
-
return /* @__PURE__ */ jsx2(
|
180
|
-
Button,
|
181
|
-
__spreadProps(__spreadValues({
|
182
|
-
color: config.color,
|
183
|
-
type: config.type,
|
184
|
-
leftSection: config.icon
|
185
|
-
}, rest), {
|
186
|
-
children: children != null ? children : config.defaultText
|
187
|
-
})
|
188
|
-
);
|
181
|
+
return /* @__PURE__ */ jsx2(Button, __spreadValues(__spreadValues({}, config), rest));
|
189
182
|
}
|
190
183
|
|
191
184
|
// src/core/button/MyButtonCreateUpdate.tsx
|
@@ -328,7 +321,7 @@ import { jsx as jsx5 } from "react/jsx-runtime";
|
|
328
321
|
// src/core/button/MyButtonImport.tsx
|
329
322
|
import { Button as Button4, FileInput } from "@mantine/core";
|
330
323
|
import { useDisclosure as useDisclosure2 } from "@mantine/hooks";
|
331
|
-
import { IconFileImport as
|
324
|
+
import { IconFileImport as IconFileImport2 } from "@tabler/icons-react";
|
332
325
|
import { useMemo } from "react";
|
333
326
|
|
334
327
|
// src/core/button/MyButtonModal.tsx
|
@@ -377,18 +370,28 @@ function MyButtonPrintPDF({
|
|
377
370
|
children,
|
378
371
|
autoPadding = true,
|
379
372
|
buttonProps,
|
380
|
-
useReactToPrintProps
|
373
|
+
useReactToPrintProps,
|
374
|
+
pageSize = "portrait"
|
375
|
+
// ✅ mặc định
|
381
376
|
}) {
|
382
377
|
const printRef = useRef(null);
|
383
378
|
const handlePrint = useReactToPrint(__spreadValues({
|
384
379
|
documentTitle: "In n\u1ED9i dung",
|
385
380
|
contentRef: printRef
|
386
381
|
}, useReactToPrintProps));
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
382
|
+
const getPageSizeCSS = () => {
|
383
|
+
switch (pageSize) {
|
384
|
+
case "landscape":
|
385
|
+
return `@media print {@page { size: landscape; }}`;
|
386
|
+
case "A4-landscape":
|
387
|
+
return `@media print {@page { size: 29.7cm 21cm; }}`;
|
388
|
+
case "portrait":
|
389
|
+
default:
|
390
|
+
return ``;
|
391
|
+
}
|
392
|
+
};
|
391
393
|
return /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
394
|
+
/* @__PURE__ */ jsx9("style", { children: getPageSizeCSS() }),
|
392
395
|
/* @__PURE__ */ jsx9("div", { style: { display: "none" }, children: /* @__PURE__ */ jsx9(
|
393
396
|
"div",
|
394
397
|
{
|
@@ -400,7 +403,16 @@ function MyButtonPrintPDF({
|
|
400
403
|
children
|
401
404
|
}
|
402
405
|
) }),
|
403
|
-
/* @__PURE__ */ jsx9(
|
406
|
+
/* @__PURE__ */ jsx9(
|
407
|
+
Button5,
|
408
|
+
__spreadProps(__spreadValues({
|
409
|
+
color: "orange",
|
410
|
+
onClick: handlePrint,
|
411
|
+
leftSection: /* @__PURE__ */ jsx9(IconPrinter3, {})
|
412
|
+
}, buttonProps), {
|
413
|
+
children: (buttonProps == null ? void 0 : buttonProps.children) || "In"
|
414
|
+
})
|
415
|
+
)
|
404
416
|
] });
|
405
417
|
}
|
406
418
|
|
@@ -2122,19 +2122,19 @@ function MyButtonViewPDF({
|
|
2122
2122
|
/* @__PURE__ */ jsx34(
|
2123
2123
|
LoadingOverlay,
|
2124
2124
|
{
|
2125
|
-
visible: query.isLoading,
|
2126
2125
|
zIndex: 1e3,
|
2127
2126
|
overlayProps: { radius: "sm", blur: 2 }
|
2128
2127
|
}
|
2129
2128
|
),
|
2130
|
-
query.data
|
2129
|
+
query.data && /* @__PURE__ */ jsx34(
|
2131
2130
|
"iframe",
|
2132
2131
|
{
|
2133
2132
|
src: `data:application/pdf;base64, ${filePath ? (_a = query.data) == null ? void 0 : _a.fileBase64String : (_c = (_b = query.data) == null ? void 0 : _b.fileDetail) == null ? void 0 : _c.fileBase64String}`,
|
2134
2133
|
width: "100%",
|
2135
2134
|
height: "100%"
|
2136
2135
|
}
|
2137
|
-
)
|
2136
|
+
),
|
2137
|
+
src && /* @__PURE__ */ jsx34("iframe", { src, width: "100%", height: "100%" })
|
2138
2138
|
] })
|
2139
2139
|
}
|
2140
2140
|
)
|
@@ -66,7 +66,7 @@ import {
|
|
66
66
|
useS_BasicAppShell,
|
67
67
|
useS_ButtonImport,
|
68
68
|
utils_layout_getItemsWithoutLinks
|
69
|
-
} from "../chunk-
|
69
|
+
} from "../chunk-LJRJYSNW.mjs";
|
70
70
|
import "../chunk-U62R2QKJ.mjs";
|
71
71
|
import "../chunk-5U2JSHSJ.mjs";
|
72
72
|
import "../chunk-OMJJAHOC.mjs";
|
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
@@ -18,8 +18,8 @@ import {
|
|
18
18
|
MyStatsCard,
|
19
19
|
MyTextInput,
|
20
20
|
MyWeeklySessionSchedulerPicker
|
21
|
-
} from "../chunk-
|
22
|
-
import "../chunk-
|
21
|
+
} from "../chunk-LB6M373A.mjs";
|
22
|
+
import "../chunk-LJRJYSNW.mjs";
|
23
23
|
import "../chunk-U62R2QKJ.mjs";
|
24
24
|
import "../chunk-5U2JSHSJ.mjs";
|
25
25
|
import "../chunk-GFEMKKFH.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-LB6M373A.mjs";
|
19
19
|
import {
|
20
20
|
F_authenticate_Logout,
|
21
21
|
MyActionIconDelete,
|
@@ -41,7 +41,7 @@ import {
|
|
41
41
|
groupToTwoLevels,
|
42
42
|
useS_authenticate,
|
43
43
|
utils_layout_getItemsWithoutLinks
|
44
|
-
} from "../chunk-
|
44
|
+
} from "../chunk-LJRJYSNW.mjs";
|
45
45
|
import {
|
46
46
|
createGenericStore
|
47
47
|
} from "../chunk-U62R2QKJ.mjs";
|