aq-fe-framework 0.1.26 → 0.1.27
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/components/index.d.mts +318 -7
- package/dist/components/index.mjs +1314 -1
- package/dist/excel---d-HDs7.d.mts +19 -0
- package/dist/utils/index.d.mts +3 -18
- package/package.json +1 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__objRest,
|
|
3
3
|
__spreadProps,
|
|
4
|
-
__spreadValues
|
|
4
|
+
__spreadValues,
|
|
5
|
+
utils_notification_show,
|
|
6
|
+
utils_pdf_download
|
|
5
7
|
} from "../chunk-ZEQATKHS.mjs";
|
|
6
8
|
|
|
7
9
|
// src/lib/utils.ts
|
|
@@ -75,9 +77,22 @@ var Boxes = React2.memo(MyBoxesCore);
|
|
|
75
77
|
|
|
76
78
|
// src/components/Loaders/MyCardioLoader.tsx
|
|
77
79
|
import { useEffect } from "react";
|
|
80
|
+
function MyCardioLoader() {
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
async function getLoader() {
|
|
83
|
+
const { cardio } = await import("ldrs");
|
|
84
|
+
cardio.register();
|
|
85
|
+
}
|
|
86
|
+
getLoader();
|
|
87
|
+
}, []);
|
|
88
|
+
return /* @__PURE__ */ React.createElement("l-cardio", { color: "var(--cyan-400)" });
|
|
89
|
+
}
|
|
78
90
|
|
|
79
91
|
// src/components/Aceternity/BoxesBackground/MyBoxesBackground.tsx
|
|
80
92
|
import { Center, Space, Text } from "@mantine/core";
|
|
93
|
+
function MyBoxesBackground({ title, desc = "\u0110\u01B0\u1EE3c ph\xE1t tri\u1EC3n b\u1EDFi c\xF4ng ty c\xF4ng ngh\u1EC7 Anh Qu\xE2n." }) {
|
|
94
|
+
return /* @__PURE__ */ React.createElement("div", { className: "h-[100vh] relative w-full overflow-hidden bg-slate-900 flex flex-col items-center justify-center rounded-lg" }, /* @__PURE__ */ React.createElement("div", { className: "absolute inset-0 w-full h-full bg-slate-900 z-20 [mask-image:radial-gradient(transparent,white)] pointer-events-none" }), /* @__PURE__ */ React.createElement(MyBoxesCore, null), /* @__PURE__ */ React.createElement(Center, { className: "z-20" }, /* @__PURE__ */ React.createElement(MyCardioLoader, null)), /* @__PURE__ */ React.createElement(Space, { my: 7 }), /* @__PURE__ */ React.createElement(Center, null, /* @__PURE__ */ React.createElement(Text, { className: "z-20", fs: "italic", fw: "bold", c: "white" }, "\u0110ang t\u1EA3i...")), /* @__PURE__ */ React.createElement(Space, { my: 7 }), /* @__PURE__ */ React.createElement("h1", { className: cn("md:text-4xl text-xl text-white relative z-20") }, title), /* @__PURE__ */ React.createElement("p", { className: "text-center mt-2 text-neutral-300 relative z-20" }, desc));
|
|
95
|
+
}
|
|
81
96
|
|
|
82
97
|
// src/components/ActionIcons/ActionIcon/MyActionIcon.tsx
|
|
83
98
|
import { ActionIcon } from "@mantine/core";
|
|
@@ -103,6 +118,10 @@ function MyActionIcon(_a) {
|
|
|
103
118
|
|
|
104
119
|
// src/components/Inputs/TextInput/MyTextInput.tsx
|
|
105
120
|
import { TextInput } from "@mantine/core";
|
|
121
|
+
function MyTextInput(_a) {
|
|
122
|
+
var _b = _a, { label, defaultValue } = _b, rest = __objRest(_b, ["label", "defaultValue"]);
|
|
123
|
+
return /* @__PURE__ */ React.createElement(TextInput, __spreadValues({ label, defaultValue, placeholder: label ? `Nh\u1EADp ${label == null ? void 0 : label.toLowerCase()}` : "" }, rest));
|
|
124
|
+
}
|
|
106
125
|
|
|
107
126
|
// src/components/Layouts/FlexColumn/MyFlexColumn.tsx
|
|
108
127
|
import { Flex } from "@mantine/core";
|
|
@@ -116,6 +135,30 @@ import { ActionIcon as ActionIcon2, Button, Checkbox, Modal, Switch, Text as Tex
|
|
|
116
135
|
import { useDisclosure } from "@mantine/hooks";
|
|
117
136
|
import { IconChecklist } from "@tabler/icons-react";
|
|
118
137
|
import { useState } from "react";
|
|
138
|
+
function MyActionIconCheck(_a) {
|
|
139
|
+
var _b = _a, { modalSize = "50%", comment = "" } = _b, rest = __objRest(_b, ["modalSize", "comment"]);
|
|
140
|
+
const disc = useDisclosure(false);
|
|
141
|
+
const fullScreen = useState(false);
|
|
142
|
+
const hSize = useState("50vh");
|
|
143
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Tooltip, { label: "Xem t\xE0i li\u1EC7u tr\u1EF1c ti\u1EBFp" }, /* @__PURE__ */ React.createElement(ActionIcon2, __spreadValues({ color: "cyan", onClick: disc[1].open }, rest), /* @__PURE__ */ React.createElement(IconChecklist, { size: 24, color: "blue" }))), /* @__PURE__ */ React.createElement(
|
|
144
|
+
Modal,
|
|
145
|
+
{
|
|
146
|
+
fullScreen: fullScreen[0],
|
|
147
|
+
opened: disc[0],
|
|
148
|
+
onClose: disc[1].close,
|
|
149
|
+
size: modalSize,
|
|
150
|
+
title: /* @__PURE__ */ React.createElement(Text2, null, "Ki\u1EC3m tra h\u1ED3 s\u01A1 \u0111\xE3 \u0111\u0103ng k\xFD")
|
|
151
|
+
},
|
|
152
|
+
/* @__PURE__ */ React.createElement(
|
|
153
|
+
Switch,
|
|
154
|
+
{
|
|
155
|
+
defaultChecked: true,
|
|
156
|
+
label: "\u0110\u1EA1t y\xEAu c\u1EA7u"
|
|
157
|
+
}
|
|
158
|
+
),
|
|
159
|
+
/* @__PURE__ */ React.createElement(MyFlexColumn, null, /* @__PURE__ */ React.createElement(MyTextInput, { label: "Nh\u1EADn x\xE9t" }), /* @__PURE__ */ React.createElement(Checkbox, { label: "G\u1EEDi mail th\xF4ng b\xE1o" }), /* @__PURE__ */ React.createElement(Button, null, "C\u1EADp nh\u1EADp"))
|
|
160
|
+
));
|
|
161
|
+
}
|
|
119
162
|
|
|
120
163
|
// src/components/Buttons/Button/MyButton.tsx
|
|
121
164
|
import { Button as Button2 } from "@mantine/core";
|
|
@@ -251,25 +294,187 @@ function MyActionIconModal(_a) {
|
|
|
251
294
|
}
|
|
252
295
|
}
|
|
253
296
|
|
|
297
|
+
// src/components/ActionIcons/ActionIconCRUD/MyActionIconDelete.tsx
|
|
298
|
+
function MyActionIconDelete(_a) {
|
|
299
|
+
var _b = _a, {
|
|
300
|
+
onSubmit,
|
|
301
|
+
onSuccess,
|
|
302
|
+
onError,
|
|
303
|
+
contextData
|
|
304
|
+
} = _b, rest = __objRest(_b, [
|
|
305
|
+
"onSubmit",
|
|
306
|
+
"onSuccess",
|
|
307
|
+
"onError",
|
|
308
|
+
"contextData"
|
|
309
|
+
]);
|
|
310
|
+
const queryClient = useQueryClient();
|
|
311
|
+
const disc = useDisclosure2();
|
|
312
|
+
const loadingState = useState2();
|
|
313
|
+
const mutation = useMutation({
|
|
314
|
+
mutationFn: async () => await onSubmit(),
|
|
315
|
+
onSuccess: () => {
|
|
316
|
+
if (onSuccess) {
|
|
317
|
+
onSuccess();
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
queryClient.invalidateQueries();
|
|
321
|
+
utils_notification_show({ crudType: "delete" });
|
|
322
|
+
disc[1].close();
|
|
323
|
+
},
|
|
324
|
+
onError: () => {
|
|
325
|
+
if (onError) {
|
|
326
|
+
onError();
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
function handleCLick() {
|
|
332
|
+
loadingState[1](true);
|
|
333
|
+
mutation.mutate();
|
|
334
|
+
}
|
|
335
|
+
return /* @__PURE__ */ React.createElement(
|
|
336
|
+
MyActionIconModal,
|
|
337
|
+
__spreadValues({
|
|
338
|
+
disclosure: disc,
|
|
339
|
+
crudType: "delete"
|
|
340
|
+
}, rest),
|
|
341
|
+
/* @__PURE__ */ React.createElement(
|
|
342
|
+
Highlight,
|
|
343
|
+
{
|
|
344
|
+
highlight: contextData || [],
|
|
345
|
+
color: "red.6",
|
|
346
|
+
highlightStyles: {
|
|
347
|
+
fontWeight: 700,
|
|
348
|
+
WebkitBackgroundClip: "text",
|
|
349
|
+
WebkitTextFillColor: "transparent"
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
`B\u1EA1n s\u1EAFp x\xF3a d\u1EEF li\u1EC7u ${contextData || ""}. H\xE0nh \u0111\u1ED9ng n\xE0y kh\xF4ng th\u1EC3 ho\xE0n t\xE1c. B\u1EA1n c\xF3 ch\u1EAFc ch\u1EAFn mu\u1ED1n ti\u1EBFp t\u1EE5c?`
|
|
353
|
+
),
|
|
354
|
+
/* @__PURE__ */ React.createElement(Group, { grow: true }, /* @__PURE__ */ React.createElement(
|
|
355
|
+
MyButton,
|
|
356
|
+
{
|
|
357
|
+
crudType: "delete",
|
|
358
|
+
onClick: handleCLick,
|
|
359
|
+
loading: loadingState[0]
|
|
360
|
+
}
|
|
361
|
+
), /* @__PURE__ */ React.createElement(
|
|
362
|
+
MyButton,
|
|
363
|
+
{
|
|
364
|
+
crudType: "cancel",
|
|
365
|
+
onClick: disc[1].close
|
|
366
|
+
}
|
|
367
|
+
))
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
|
|
254
371
|
// src/components/ActionIcons/ActionIconCRUD/MyActionIconUpdate.tsx
|
|
255
372
|
import { useDisclosure as useDisclosure3 } from "@mantine/hooks";
|
|
256
373
|
import { useMutation as useMutation2, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
374
|
+
function MyActionIconUpdate(_a) {
|
|
375
|
+
var _b = _a, {
|
|
376
|
+
form,
|
|
377
|
+
onSubmit,
|
|
378
|
+
onSuccess,
|
|
379
|
+
onError,
|
|
380
|
+
children
|
|
381
|
+
} = _b, rest = __objRest(_b, [
|
|
382
|
+
"form",
|
|
383
|
+
"onSubmit",
|
|
384
|
+
"onSuccess",
|
|
385
|
+
"onError",
|
|
386
|
+
"children"
|
|
387
|
+
]);
|
|
388
|
+
const disc = useDisclosure3();
|
|
389
|
+
const queryClient = useQueryClient2();
|
|
390
|
+
const mutation = useMutation2({
|
|
391
|
+
mutationFn: async (values) => {
|
|
392
|
+
await onSubmit(values);
|
|
393
|
+
},
|
|
394
|
+
onSuccess: () => {
|
|
395
|
+
if (onSuccess) {
|
|
396
|
+
onSuccess();
|
|
397
|
+
}
|
|
398
|
+
queryClient.invalidateQueries();
|
|
399
|
+
utils_notification_show({ crudType: "update" });
|
|
400
|
+
disc[1].close();
|
|
401
|
+
},
|
|
402
|
+
onError: () => {
|
|
403
|
+
if (onError) onError();
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
return /* @__PURE__ */ React.createElement(MyActionIconModal, __spreadValues({ disclosure: disc, crudType: "update" }, rest), /* @__PURE__ */ React.createElement("form", { onSubmit: form.onSubmit((values) => {
|
|
407
|
+
mutation.mutate(values);
|
|
408
|
+
}) }, /* @__PURE__ */ React.createElement(MyFlexColumn, null, children, /* @__PURE__ */ React.createElement(MyButton, { type: "submit", crudType: "save" }))));
|
|
409
|
+
}
|
|
257
410
|
|
|
258
411
|
// src/components/ActionIcons/ActionIconDownloadPDF/MyActionIconDownloadPDF.tsx
|
|
259
412
|
import { ActionIcon as ActionIcon4, Tooltip as Tooltip2 } from "@mantine/core";
|
|
260
413
|
import { IconDownload } from "@tabler/icons-react";
|
|
414
|
+
function MyActionIconDownloadPDF({ pdfLink = "https://datafiles.chinhphu.vn/cpp/files/vbpq/2021/07/17-bgd.signed.pdf" }) {
|
|
415
|
+
return /* @__PURE__ */ React.createElement(Tooltip2, { label: "Nh\u1EA5p \u0111\u1EC3 t\u1EA3i xu\u1ED1ng" }, /* @__PURE__ */ React.createElement(ActionIcon4, { onClick: async () => await utils_pdf_download(pdfLink), color: "red" }, /* @__PURE__ */ React.createElement(IconDownload, null)));
|
|
416
|
+
}
|
|
261
417
|
|
|
262
418
|
// src/components/ActionIcons/ActionIconUpload/MyActionIconUpload.tsx
|
|
263
419
|
import { ActionIcon as ActionIcon5 } from "@mantine/core";
|
|
264
420
|
import { Dropzone, MIME_TYPES } from "@mantine/dropzone";
|
|
265
421
|
import { IconCloudUpload } from "@tabler/icons-react";
|
|
266
422
|
import { useRef } from "react";
|
|
423
|
+
function MyActionIconUpload() {
|
|
424
|
+
const openRef = useRef(null);
|
|
425
|
+
return /* @__PURE__ */ React.createElement(
|
|
426
|
+
Dropzone,
|
|
427
|
+
{
|
|
428
|
+
openRef,
|
|
429
|
+
onDrop: () => {
|
|
430
|
+
},
|
|
431
|
+
radius: "md",
|
|
432
|
+
accept: [MIME_TYPES.pdf]
|
|
433
|
+
},
|
|
434
|
+
/* @__PURE__ */ React.createElement(ActionIcon5, null, /* @__PURE__ */ React.createElement(IconCloudUpload, null))
|
|
435
|
+
);
|
|
436
|
+
}
|
|
267
437
|
|
|
268
438
|
// src/components/ActionIcons/ActionIconViewPdf/MyActionIconViewPDF.tsx
|
|
269
439
|
import { ActionIcon as ActionIcon6, Group as Group2, Modal as Modal3, Paper, Text as Text3, Tooltip as Tooltip3 } from "@mantine/core";
|
|
270
440
|
import { useDisclosure as useDisclosure4 } from "@mantine/hooks";
|
|
271
441
|
import { IconLivePhoto, IconMaximize, IconMinimize } from "@tabler/icons-react";
|
|
272
442
|
import { useState as useState3 } from "react";
|
|
443
|
+
function MyActionIconViewPDF(_a) {
|
|
444
|
+
var _b = _a, { modalSize = "80%", pdfLink = "https://datafiles.chinhphu.vn/cpp/files/vbpq/2021/07/17-bgd.signed.pdf" } = _b, rest = __objRest(_b, ["modalSize", "pdfLink"]);
|
|
445
|
+
const disc = useDisclosure4(false);
|
|
446
|
+
const fullScreen = useState3(false);
|
|
447
|
+
const hSize = useState3("80vh");
|
|
448
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Tooltip3, { label: "Xem t\xE0i li\u1EC7u tr\u1EF1c ti\u1EBFp" }, /* @__PURE__ */ React.createElement(ActionIcon6, __spreadValues({ color: "cyan", onClick: disc[1].open }, rest), /* @__PURE__ */ React.createElement(IconLivePhoto, null))), /* @__PURE__ */ React.createElement(
|
|
449
|
+
Modal3,
|
|
450
|
+
{
|
|
451
|
+
fullScreen: fullScreen[0],
|
|
452
|
+
opened: disc[0],
|
|
453
|
+
onClose: disc[1].close,
|
|
454
|
+
size: modalSize,
|
|
455
|
+
title: /* @__PURE__ */ React.createElement(Group2, null, /* @__PURE__ */ React.createElement(Text3, null, "Xem t\xE0i li\u1EC7u tr\u1EF1c ti\u1EBFp"), fullScreen[0] ? /* @__PURE__ */ React.createElement(
|
|
456
|
+
ActionIcon6,
|
|
457
|
+
{
|
|
458
|
+
onClick: () => {
|
|
459
|
+
fullScreen[1](false);
|
|
460
|
+
hSize[1]("80vh");
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
/* @__PURE__ */ React.createElement(IconMinimize, null)
|
|
464
|
+
) : /* @__PURE__ */ React.createElement(
|
|
465
|
+
ActionIcon6,
|
|
466
|
+
{
|
|
467
|
+
onClick: () => {
|
|
468
|
+
fullScreen[1](true);
|
|
469
|
+
hSize[1]("90vh");
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
/* @__PURE__ */ React.createElement(IconMaximize, null)
|
|
473
|
+
))
|
|
474
|
+
},
|
|
475
|
+
/* @__PURE__ */ React.createElement(Paper, { h: hSize[0], p: "lg" }, /* @__PURE__ */ React.createElement("iframe", { src: pdfLink, width: "100%", height: "100%" }))
|
|
476
|
+
));
|
|
477
|
+
}
|
|
273
478
|
|
|
274
479
|
// src/components/ActionIcons/SwitchTheme/MySwitchTheme.tsx
|
|
275
480
|
import { ActionIcon as ActionIcon7, useComputedColorScheme, useMantineColorScheme } from "@mantine/core";
|
|
@@ -416,6 +621,40 @@ import { ActionIcon as ActionIcon8, Anchor, Group as Group3, Modal as Modal4, Pa
|
|
|
416
621
|
import { useDisclosure as useDisclosure5 } from "@mantine/hooks";
|
|
417
622
|
import { IconMaximize as IconMaximize2, IconMinimize as IconMinimize2 } from "@tabler/icons-react";
|
|
418
623
|
import { useState as useState5 } from "react";
|
|
624
|
+
function MyAnchorViewPDF({ label, pdfLink }) {
|
|
625
|
+
const disc = useDisclosure5(false);
|
|
626
|
+
const fullScreen = useState5(false);
|
|
627
|
+
const hSize = useState5("80vh");
|
|
628
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Anchor, { onClick: disc[1].open }, label), /* @__PURE__ */ React.createElement(
|
|
629
|
+
Modal4,
|
|
630
|
+
{
|
|
631
|
+
fullScreen: fullScreen[0],
|
|
632
|
+
opened: disc[0],
|
|
633
|
+
onClose: disc[1].close,
|
|
634
|
+
size: "80%",
|
|
635
|
+
title: /* @__PURE__ */ React.createElement(Group3, null, /* @__PURE__ */ React.createElement(Text4, null, "Xem t\xE0i li\u1EC7u tr\u1EF1c ti\u1EBFp"), fullScreen[0] ? /* @__PURE__ */ React.createElement(
|
|
636
|
+
ActionIcon8,
|
|
637
|
+
{
|
|
638
|
+
onClick: () => {
|
|
639
|
+
fullScreen[1](false);
|
|
640
|
+
hSize[1]("80vh");
|
|
641
|
+
}
|
|
642
|
+
},
|
|
643
|
+
/* @__PURE__ */ React.createElement(IconMinimize2, null)
|
|
644
|
+
) : /* @__PURE__ */ React.createElement(
|
|
645
|
+
ActionIcon8,
|
|
646
|
+
{
|
|
647
|
+
onClick: () => {
|
|
648
|
+
fullScreen[1](true);
|
|
649
|
+
hSize[1]("90vh");
|
|
650
|
+
}
|
|
651
|
+
},
|
|
652
|
+
/* @__PURE__ */ React.createElement(IconMaximize2, null)
|
|
653
|
+
))
|
|
654
|
+
},
|
|
655
|
+
/* @__PURE__ */ React.createElement(Paper2, { h: hSize[0] }, /* @__PURE__ */ React.createElement("iframe", { src: pdfLink, width: "100%", height: "100%" }))
|
|
656
|
+
));
|
|
657
|
+
}
|
|
419
658
|
|
|
420
659
|
// src/components/Buttons/ButtonCRUD/AQButtonCreateByImportFile.tsx
|
|
421
660
|
import { FileInput } from "@mantine/core";
|
|
@@ -515,14 +754,164 @@ function MyButtonModal(_a) {
|
|
|
515
754
|
}
|
|
516
755
|
}
|
|
517
756
|
|
|
757
|
+
// src/components/Buttons/ButtonCRUD/AQButtonCreateByImportFile.tsx
|
|
758
|
+
function AQButtonCreateByImportFile(_a) {
|
|
759
|
+
var _b = _a, {
|
|
760
|
+
form,
|
|
761
|
+
onSubmit,
|
|
762
|
+
onSuccess,
|
|
763
|
+
onError,
|
|
764
|
+
setImportedData: setImportedData
|
|
765
|
+
} = _b, rest = __objRest(_b, [
|
|
766
|
+
"form",
|
|
767
|
+
"onSubmit",
|
|
768
|
+
"onSuccess",
|
|
769
|
+
"onError",
|
|
770
|
+
// children,
|
|
771
|
+
"setImportedData"
|
|
772
|
+
]);
|
|
773
|
+
const disc = useDisclosure6();
|
|
774
|
+
const queryClient = useQueryClient3();
|
|
775
|
+
const mutation = useMutation3({
|
|
776
|
+
mutationFn: async () => {
|
|
777
|
+
return await onSubmit();
|
|
778
|
+
},
|
|
779
|
+
onSuccess: () => {
|
|
780
|
+
queryClient.invalidateQueries();
|
|
781
|
+
utils_notification_show({ crudType: "create" });
|
|
782
|
+
disc[1].close();
|
|
783
|
+
form.reset();
|
|
784
|
+
if (onSuccess) onSuccess();
|
|
785
|
+
},
|
|
786
|
+
onError: () => {
|
|
787
|
+
if (onError) onError();
|
|
788
|
+
}
|
|
789
|
+
});
|
|
790
|
+
const handleFileChange = (file) => {
|
|
791
|
+
if (!file) return;
|
|
792
|
+
const reader = new FileReader();
|
|
793
|
+
reader.onload = (event) => {
|
|
794
|
+
var _a2;
|
|
795
|
+
const binaryStr = (_a2 = event.target) == null ? void 0 : _a2.result;
|
|
796
|
+
if (binaryStr) {
|
|
797
|
+
const workbook = XLSX.read(binaryStr, { type: "binary" });
|
|
798
|
+
const sheetName = workbook.SheetNames[0];
|
|
799
|
+
const sheet = workbook.Sheets[sheetName];
|
|
800
|
+
const data = XLSX.utils.sheet_to_json(sheet);
|
|
801
|
+
setImportedData && setImportedData(data);
|
|
802
|
+
}
|
|
803
|
+
};
|
|
804
|
+
reader.readAsArrayBuffer(file);
|
|
805
|
+
};
|
|
806
|
+
return /* @__PURE__ */ React.createElement(MyButtonModal, __spreadValues({ disclosure: disc, crudType: "createMultiple" }, rest), /* @__PURE__ */ React.createElement("form", { onSubmit: form.onSubmit((values) => {
|
|
807
|
+
}) }, /* @__PURE__ */ React.createElement(MyFlexColumn, null, /* @__PURE__ */ React.createElement(
|
|
808
|
+
FileInput,
|
|
809
|
+
{
|
|
810
|
+
leftSection: /* @__PURE__ */ React.createElement(IconFileTypeXls, null),
|
|
811
|
+
accept: ".xlsx",
|
|
812
|
+
description: "\u0110\u1ECBnh d\u1EA1ng h\u1EE3p l\u1EC7: .xlsx",
|
|
813
|
+
label: "Ch\u1ECDn file",
|
|
814
|
+
onChange: handleFileChange,
|
|
815
|
+
clearable: true,
|
|
816
|
+
placeholder: "Ch\u1ECDn file"
|
|
817
|
+
}
|
|
818
|
+
), /* @__PURE__ */ React.createElement(MyButton, { type: "submit", crudType: "createMultiple" }))));
|
|
819
|
+
}
|
|
820
|
+
|
|
518
821
|
// src/components/Buttons/ButtonCRUD/AQButtonExportData.tsx
|
|
519
822
|
import { Button as Button4 } from "@mantine/core";
|
|
520
823
|
import { IconDownload as IconDownload2 } from "@tabler/icons-react";
|
|
521
824
|
import * as XLSX2 from "xlsx";
|
|
825
|
+
function AQButtonExportData({
|
|
826
|
+
isAllData,
|
|
827
|
+
objectName,
|
|
828
|
+
data,
|
|
829
|
+
exportConfig
|
|
830
|
+
}) {
|
|
831
|
+
const handleExport = () => {
|
|
832
|
+
const processedData = data.map((row) => {
|
|
833
|
+
const newRow = {};
|
|
834
|
+
exportConfig.fields.forEach(({ fieldName, formatFunction }) => {
|
|
835
|
+
newRow[fieldName] = formatFunction ? formatFunction(row[fieldName], row) : row[fieldName];
|
|
836
|
+
});
|
|
837
|
+
return newRow;
|
|
838
|
+
});
|
|
839
|
+
const headers = {};
|
|
840
|
+
exportConfig.fields.forEach(({ fieldName, header }) => {
|
|
841
|
+
headers[fieldName] = header;
|
|
842
|
+
});
|
|
843
|
+
const worksheet = XLSX2.utils.json_to_sheet(processedData);
|
|
844
|
+
const headerRow = exportConfig.fields.map(({ fieldName }) => headers[fieldName]);
|
|
845
|
+
XLSX2.utils.sheet_add_aoa(worksheet, [headerRow], { origin: "A1" });
|
|
846
|
+
const workbook = XLSX2.utils.book_new();
|
|
847
|
+
XLSX2.utils.book_append_sheet(workbook, worksheet, "Exported Data");
|
|
848
|
+
XLSX2.writeFile(workbook, `${objectName}.xlsx`);
|
|
849
|
+
};
|
|
850
|
+
return /* @__PURE__ */ React.createElement(
|
|
851
|
+
Button4,
|
|
852
|
+
{
|
|
853
|
+
disabled: data.length === 0,
|
|
854
|
+
variant: "filled",
|
|
855
|
+
color: "teal",
|
|
856
|
+
onClick: (event) => {
|
|
857
|
+
event.preventDefault();
|
|
858
|
+
handleExport();
|
|
859
|
+
},
|
|
860
|
+
leftSection: /* @__PURE__ */ React.createElement(IconDownload2, null)
|
|
861
|
+
},
|
|
862
|
+
"Export"
|
|
863
|
+
);
|
|
864
|
+
}
|
|
522
865
|
|
|
523
866
|
// src/components/Buttons/ButtonCRUD/MyButtonCreate.tsx
|
|
524
867
|
import { useDisclosure as useDisclosure7 } from "@mantine/hooks";
|
|
525
868
|
import { useMutation as useMutation4, useQueryClient as useQueryClient4 } from "@tanstack/react-query";
|
|
869
|
+
function MyButtonCreate(_a) {
|
|
870
|
+
var _b = _a, {
|
|
871
|
+
form,
|
|
872
|
+
onSubmit,
|
|
873
|
+
onSuccess,
|
|
874
|
+
onError,
|
|
875
|
+
notCloseModalWhenSubmit = false,
|
|
876
|
+
notResetFormWhenSubmit = false,
|
|
877
|
+
children,
|
|
878
|
+
disclosure: externalDisclosure
|
|
879
|
+
} = _b, rest = __objRest(_b, [
|
|
880
|
+
"form",
|
|
881
|
+
"onSubmit",
|
|
882
|
+
"onSuccess",
|
|
883
|
+
"onError",
|
|
884
|
+
"notCloseModalWhenSubmit",
|
|
885
|
+
"notResetFormWhenSubmit",
|
|
886
|
+
"children",
|
|
887
|
+
"disclosure"
|
|
888
|
+
]);
|
|
889
|
+
const defaultDisclosure = useDisclosure7();
|
|
890
|
+
const disclosure = externalDisclosure != null ? externalDisclosure : defaultDisclosure;
|
|
891
|
+
const queryClient = useQueryClient4();
|
|
892
|
+
const mutation = useMutation4({
|
|
893
|
+
mutationFn: async (values) => await onSubmit(values),
|
|
894
|
+
onSuccess: () => {
|
|
895
|
+
if (onSuccess) {
|
|
896
|
+
onSuccess();
|
|
897
|
+
}
|
|
898
|
+
queryClient.invalidateQueries();
|
|
899
|
+
utils_notification_show({ crudType: "create" });
|
|
900
|
+
if (notCloseModalWhenSubmit == false) {
|
|
901
|
+
disclosure[1].close();
|
|
902
|
+
}
|
|
903
|
+
if (notResetFormWhenSubmit == false) {
|
|
904
|
+
form.reset();
|
|
905
|
+
}
|
|
906
|
+
},
|
|
907
|
+
onError: () => {
|
|
908
|
+
if (onError) onError();
|
|
909
|
+
}
|
|
910
|
+
});
|
|
911
|
+
return /* @__PURE__ */ React.createElement(MyButtonModal, __spreadValues({ disclosure, crudType: "create" }, rest), /* @__PURE__ */ React.createElement("form", { onSubmit: form.onSubmit((values) => {
|
|
912
|
+
mutation.mutate(values);
|
|
913
|
+
}) }, /* @__PURE__ */ React.createElement(MyFlexColumn, null, children, /* @__PURE__ */ React.createElement(MyButton, { type: "submit", crudType: "save" }))));
|
|
914
|
+
}
|
|
526
915
|
|
|
527
916
|
// src/components/Buttons/ButtonImport/MyButtonImport.tsx
|
|
528
917
|
import { Button as Button8, Modal as Modal8, useModalsStack as useModalsStack3 } from "@mantine/core";
|
|
@@ -530,9 +919,17 @@ import { IconFileImport as IconFileImport2 } from "@tabler/icons-react";
|
|
|
530
919
|
|
|
531
920
|
// src/components/Combobox/Select/MySelect.tsx
|
|
532
921
|
import { Select } from "@mantine/core";
|
|
922
|
+
function MySelect(_a) {
|
|
923
|
+
var _b = _a, { label } = _b, rest = __objRest(_b, ["label"]);
|
|
924
|
+
return /* @__PURE__ */ React.createElement(Select, __spreadValues({ label, placeholder: label ? `Ch\u1ECDn ${label == null ? void 0 : label.toLowerCase()}` : "" }, rest));
|
|
925
|
+
}
|
|
533
926
|
|
|
534
927
|
// src/components/Layouts/FlexEnd/MyFlexEnd.tsx
|
|
535
928
|
import { Group as Group4 } from "@mantine/core";
|
|
929
|
+
function MyFlexEnd(_a) {
|
|
930
|
+
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
931
|
+
return /* @__PURE__ */ React.createElement(Group4, __spreadValues({ justify: "end", mt: "md" }, rest), children);
|
|
932
|
+
}
|
|
536
933
|
|
|
537
934
|
// src/components/Buttons/ButtonImport/SelectFieldModal.tsx
|
|
538
935
|
import { Button as Button5, Divider, Fieldset, Group as Group5, Modal as Modal6, SimpleGrid, Space as Space2, Table } from "@mantine/core";
|
|
@@ -562,6 +959,210 @@ var useStore = createGenericStore({
|
|
|
562
959
|
startDataIndex: 3
|
|
563
960
|
}
|
|
564
961
|
});
|
|
962
|
+
function useS_ButtonImport() {
|
|
963
|
+
const store = useStore();
|
|
964
|
+
function autoMap() {
|
|
965
|
+
if (!store.state.data || !store.state.data.length || !store.state.fieldConfig) return;
|
|
966
|
+
const sampleRow = store.state.data[0];
|
|
967
|
+
const updatedFieldConfig = store.state.fieldConfig.map((config2) => {
|
|
968
|
+
const matchingKey = Object.keys(sampleRow).find(
|
|
969
|
+
(key) => key.toLowerCase().trim() === config2.fieldKey.toString().toLowerCase().trim()
|
|
970
|
+
);
|
|
971
|
+
if (matchingKey) {
|
|
972
|
+
return __spreadProps(__spreadValues({}, config2), {
|
|
973
|
+
fieldToMap: matchingKey,
|
|
974
|
+
isSelected: true
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
return config2;
|
|
978
|
+
});
|
|
979
|
+
store.setProperty("fieldConfig", updatedFieldConfig);
|
|
980
|
+
}
|
|
981
|
+
function getDataFinal() {
|
|
982
|
+
const finalData = [];
|
|
983
|
+
store.state.data.forEach((row) => {
|
|
984
|
+
const rowData = {};
|
|
985
|
+
store.state.fieldConfig.forEach((colConfig) => {
|
|
986
|
+
if (colConfig.isSelected) {
|
|
987
|
+
const key = colConfig.fieldKey;
|
|
988
|
+
const sourceKey = colConfig.fieldToMap || key;
|
|
989
|
+
rowData[key] = row[sourceKey];
|
|
990
|
+
}
|
|
991
|
+
});
|
|
992
|
+
finalData.push(rowData);
|
|
993
|
+
});
|
|
994
|
+
return finalData;
|
|
995
|
+
}
|
|
996
|
+
function changeAllSelected(isSelected) {
|
|
997
|
+
var _a;
|
|
998
|
+
store.setProperty("fieldConfig", (_a = store.state.fieldConfig) == null ? void 0 : _a.map((item) => __spreadProps(__spreadValues({}, item), {
|
|
999
|
+
isSelected
|
|
1000
|
+
})));
|
|
1001
|
+
}
|
|
1002
|
+
function changeSelected(fieldKey, isSelected) {
|
|
1003
|
+
var _a;
|
|
1004
|
+
if (!store.state.fieldConfig) {
|
|
1005
|
+
store.setProperty("fieldConfig", []);
|
|
1006
|
+
}
|
|
1007
|
+
const existingFieldConfigIndex = store.state.fieldConfig.findIndex(
|
|
1008
|
+
(config2) => config2.fieldKey === fieldKey
|
|
1009
|
+
);
|
|
1010
|
+
if (existingFieldConfigIndex !== -1) {
|
|
1011
|
+
const updatedFieldConfig = [...store.state.fieldConfig];
|
|
1012
|
+
updatedFieldConfig[existingFieldConfigIndex] = __spreadProps(__spreadValues({}, updatedFieldConfig[existingFieldConfigIndex]), {
|
|
1013
|
+
isSelected
|
|
1014
|
+
});
|
|
1015
|
+
store.setProperty("fieldConfig", updatedFieldConfig);
|
|
1016
|
+
} else {
|
|
1017
|
+
const fieldName = ((_a = store.state.title) == null ? void 0 : _a.find((title) => title === fieldKey)) || fieldKey;
|
|
1018
|
+
const updatedFieldConfig = [
|
|
1019
|
+
...store.state.fieldConfig,
|
|
1020
|
+
{
|
|
1021
|
+
fieldKey,
|
|
1022
|
+
fieldName,
|
|
1023
|
+
isSelected
|
|
1024
|
+
}
|
|
1025
|
+
];
|
|
1026
|
+
store.setProperty("fieldConfig", updatedFieldConfig);
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
function setFieldToMap(fieldKey, fieldToMap) {
|
|
1030
|
+
var _a;
|
|
1031
|
+
if (!store.state.fieldConfig) {
|
|
1032
|
+
store.setProperty("fieldConfig", []);
|
|
1033
|
+
}
|
|
1034
|
+
const existingFieldConfigIndex = store.state.fieldConfig.findIndex(
|
|
1035
|
+
(config2) => config2.fieldKey === fieldKey
|
|
1036
|
+
);
|
|
1037
|
+
if (existingFieldConfigIndex !== -1) {
|
|
1038
|
+
const updatedFieldConfig = [...store.state.fieldConfig];
|
|
1039
|
+
updatedFieldConfig[existingFieldConfigIndex] = __spreadProps(__spreadValues({}, updatedFieldConfig[existingFieldConfigIndex]), {
|
|
1040
|
+
fieldToMap
|
|
1041
|
+
});
|
|
1042
|
+
store.setProperty("fieldConfig", updatedFieldConfig);
|
|
1043
|
+
} else {
|
|
1044
|
+
const fieldName = ((_a = store.state.title) == null ? void 0 : _a.find((title) => title === fieldKey)) || fieldKey;
|
|
1045
|
+
const updatedFieldConfig = [
|
|
1046
|
+
...store.state.fieldConfig,
|
|
1047
|
+
{
|
|
1048
|
+
fieldKey,
|
|
1049
|
+
fieldName,
|
|
1050
|
+
fieldToMap
|
|
1051
|
+
}
|
|
1052
|
+
];
|
|
1053
|
+
store.setProperty("fieldConfig", updatedFieldConfig);
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
const columns = useMemo2(() => {
|
|
1057
|
+
var _a;
|
|
1058
|
+
return [
|
|
1059
|
+
...((_a = store.state.title) == null ? void 0 : _a.map((item) => ({
|
|
1060
|
+
header: item,
|
|
1061
|
+
accessorKey: item
|
|
1062
|
+
}))) || []
|
|
1063
|
+
];
|
|
1064
|
+
}, [store.state.title]);
|
|
1065
|
+
useEffect2(() => {
|
|
1066
|
+
if (store.state.file == null) {
|
|
1067
|
+
store.resetState();
|
|
1068
|
+
}
|
|
1069
|
+
if (!store.state.file) return;
|
|
1070
|
+
const reader = new FileReader();
|
|
1071
|
+
reader.onload = (event) => {
|
|
1072
|
+
var _a;
|
|
1073
|
+
const binaryStr = (_a = event.target) == null ? void 0 : _a.result;
|
|
1074
|
+
if (!binaryStr) return;
|
|
1075
|
+
const workbook = XLSX3.read(binaryStr, { type: "binary" });
|
|
1076
|
+
const sheetName = workbook.SheetNames[0];
|
|
1077
|
+
const sheet = workbook.Sheets[sheetName];
|
|
1078
|
+
const dataBook = XLSX3.utils.sheet_to_json(sheet, { header: 1 });
|
|
1079
|
+
const data = XLSX3.utils.sheet_to_json(sheet, { range: 1 });
|
|
1080
|
+
if (data.lenght == 0) return;
|
|
1081
|
+
store.setProperty("title", dataBook[1]);
|
|
1082
|
+
store.setProperty("data", data);
|
|
1083
|
+
};
|
|
1084
|
+
reader.readAsArrayBuffer(store.state.file);
|
|
1085
|
+
}, [store.state.file]);
|
|
1086
|
+
useEffect2(() => {
|
|
1087
|
+
var _a;
|
|
1088
|
+
if (((_a = store.state.data) == null ? void 0 : _a.length) == 0) return;
|
|
1089
|
+
autoMap();
|
|
1090
|
+
}, [store.state.data]);
|
|
1091
|
+
return __spreadProps(__spreadValues({}, store), {
|
|
1092
|
+
columns,
|
|
1093
|
+
changeSelected,
|
|
1094
|
+
setFieldToMap,
|
|
1095
|
+
getDataFinal,
|
|
1096
|
+
changeAllSelected,
|
|
1097
|
+
autoMap
|
|
1098
|
+
});
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
// src/components/Buttons/ButtonImport/SelectFieldModal.tsx
|
|
1102
|
+
function SelectFieldModal({ stack, onImport }) {
|
|
1103
|
+
var _a, _b;
|
|
1104
|
+
const store = useS_ButtonImport();
|
|
1105
|
+
return /* @__PURE__ */ React.createElement(Modal6, __spreadProps(__spreadValues({ fullScreen: true }, stack.register("select-field-page")), { title: "Import" }), /* @__PURE__ */ React.createElement(SimpleGrid, { cols: { base: 1, lg: 2 } }, /* @__PURE__ */ React.createElement(Fieldset, { legend: "Danh s\xE1ch tr\u01B0\u1EDDng th\xF4ng tin" }, /* @__PURE__ */ React.createElement(Table, { stickyHeader: true, stickyHeaderOffset: 60 }, /* @__PURE__ */ React.createElement(Table.Thead, { bg: "cyan" }, /* @__PURE__ */ React.createElement(Table.Tr, null, /* @__PURE__ */ React.createElement(Table.Th, null, "M\xE3 field"), /* @__PURE__ */ React.createElement(Table.Th, null, "T\xEAn field"))), /* @__PURE__ */ React.createElement(Table.Tbody, null, (_a = store.state.fieldConfig) == null ? void 0 : _a.filter((item) => item.isSelected == false || item.isSelected == void 0).map((item, idx) => /* @__PURE__ */ React.createElement(
|
|
1106
|
+
Table.Tr,
|
|
1107
|
+
{
|
|
1108
|
+
key: idx,
|
|
1109
|
+
style: { cursor: "pointer" }
|
|
1110
|
+
},
|
|
1111
|
+
/* @__PURE__ */ React.createElement(Table.Td, { onClick: () => store.changeSelected(item.fieldKey.toString(), true) }, item.fieldKey.toString()),
|
|
1112
|
+
/* @__PURE__ */ React.createElement(Table.Td, { onClick: () => store.changeSelected(item.fieldKey.toString(), true) }, item.fieldName)
|
|
1113
|
+
)))), /* @__PURE__ */ React.createElement(Space2, null), /* @__PURE__ */ React.createElement(Group5, null, /* @__PURE__ */ React.createElement(
|
|
1114
|
+
Button5,
|
|
1115
|
+
{
|
|
1116
|
+
onClick: () => {
|
|
1117
|
+
store.changeAllSelected(true);
|
|
1118
|
+
},
|
|
1119
|
+
leftSection: /* @__PURE__ */ React.createElement(IconArrowBigRight, null)
|
|
1120
|
+
},
|
|
1121
|
+
"Chuy\u1EC3n t\u1EA5t c\u1EA3"
|
|
1122
|
+
))), /* @__PURE__ */ React.createElement(Fieldset, { legend: "Danh s\xE1ch tr\u01B0\u1EDDng th\xF4ng tin \u0111\u01B0\u1EE3c ch\u1ECDn" }, /* @__PURE__ */ React.createElement(Table, { stickyHeader: true, stickyHeaderOffset: 60 }, /* @__PURE__ */ React.createElement(Table.Thead, null, /* @__PURE__ */ React.createElement(Table.Tr, null, /* @__PURE__ */ React.createElement(Table.Th, null, "M\xE3 field"), /* @__PURE__ */ React.createElement(Table.Th, null, "T\xEAn field"), /* @__PURE__ */ React.createElement(Table.Th, null, "C\u1ED9t map"))), /* @__PURE__ */ React.createElement(Table.Tbody, null, (_b = store.state.fieldConfig) == null ? void 0 : _b.filter((item) => item.isSelected == true).map((item, idx) => /* @__PURE__ */ React.createElement(
|
|
1123
|
+
Table.Tr,
|
|
1124
|
+
{
|
|
1125
|
+
key: idx,
|
|
1126
|
+
style: { cursor: "pointer" }
|
|
1127
|
+
},
|
|
1128
|
+
/* @__PURE__ */ React.createElement(Table.Td, { onClick: () => store.changeSelected(item.fieldKey.toString(), false) }, item.fieldKey.toString()),
|
|
1129
|
+
/* @__PURE__ */ React.createElement(Table.Td, { onClick: () => store.changeSelected(item.fieldKey.toString(), false) }, item.fieldName),
|
|
1130
|
+
/* @__PURE__ */ React.createElement(Table.Td, null, /* @__PURE__ */ React.createElement(MySelect, { data: store.state.title, value: item.fieldToMap, onChange: (e4) => store.setFieldToMap(item.fieldKey.toString(), e4) }))
|
|
1131
|
+
)))), /* @__PURE__ */ React.createElement(Space2, null), /* @__PURE__ */ React.createElement(
|
|
1132
|
+
Button5,
|
|
1133
|
+
{
|
|
1134
|
+
onClick: () => {
|
|
1135
|
+
store.changeAllSelected(false);
|
|
1136
|
+
},
|
|
1137
|
+
leftSection: /* @__PURE__ */ React.createElement(IconArrowBigLeft, null)
|
|
1138
|
+
},
|
|
1139
|
+
"Chuy\u1EC3n t\u1EA5t c\u1EA3 v\u1EC1"
|
|
1140
|
+
))), /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement(MyFlexEnd, null, /* @__PURE__ */ React.createElement(
|
|
1141
|
+
Button5,
|
|
1142
|
+
{
|
|
1143
|
+
leftSection: /* @__PURE__ */ React.createElement(IconArrowBackUp, null),
|
|
1144
|
+
onClick: () => stack.close("select-field-page"),
|
|
1145
|
+
color: "gray.7"
|
|
1146
|
+
},
|
|
1147
|
+
"Quay l\u1EA1i"
|
|
1148
|
+
), /* @__PURE__ */ React.createElement(
|
|
1149
|
+
Button5,
|
|
1150
|
+
{
|
|
1151
|
+
color: "blue.8",
|
|
1152
|
+
leftSection: /* @__PURE__ */ React.createElement(IconArrowBigRight, null),
|
|
1153
|
+
onClick: onImport
|
|
1154
|
+
},
|
|
1155
|
+
"Ti\u1EBFp t\u1EE5c / Import"
|
|
1156
|
+
), /* @__PURE__ */ React.createElement(
|
|
1157
|
+
Button5,
|
|
1158
|
+
{
|
|
1159
|
+
leftSection: /* @__PURE__ */ React.createElement(IconSquareRoundedX, null),
|
|
1160
|
+
onClick: () => stack.closeAll(),
|
|
1161
|
+
color: "red.6"
|
|
1162
|
+
},
|
|
1163
|
+
"\u0110\xF3ng"
|
|
1164
|
+
)));
|
|
1165
|
+
}
|
|
565
1166
|
|
|
566
1167
|
// src/components/DataDisplay/DataTable/MyDataTable.tsx
|
|
567
1168
|
import { Button as Button6, Group as Group6 } from "@mantine/core";
|
|
@@ -675,15 +1276,186 @@ function MyDataTable(_a) {
|
|
|
675
1276
|
// src/components/Buttons/ButtonImport/SelectFileModal.tsx
|
|
676
1277
|
import { Button as Button7, Fieldset as Fieldset2, FileInput as FileInput2, Modal as Modal7, NumberInput, Select as Select2, SimpleGrid as SimpleGrid2 } from "@mantine/core";
|
|
677
1278
|
import { IconArrowBigRight as IconArrowBigRight2, IconSquareRoundedX as IconSquareRoundedX2 } from "@tabler/icons-react";
|
|
1279
|
+
function SelectFileModal({ onExportStructure, stack }) {
|
|
1280
|
+
var _a;
|
|
1281
|
+
const store = useS_ButtonImport();
|
|
1282
|
+
return /* @__PURE__ */ React.createElement(
|
|
1283
|
+
Modal7,
|
|
1284
|
+
__spreadValues({
|
|
1285
|
+
title: "Import",
|
|
1286
|
+
fullScreen: true
|
|
1287
|
+
}, stack.register("select-file-page")),
|
|
1288
|
+
/* @__PURE__ */ React.createElement(
|
|
1289
|
+
FileInput2,
|
|
1290
|
+
{
|
|
1291
|
+
value: store.state.file,
|
|
1292
|
+
onChange: (e4) => store.setProperty("file", e4),
|
|
1293
|
+
label: "File d\u1EEF li\u1EC7u",
|
|
1294
|
+
placeholder: "Ch\u1ECDn file d\u1EEF li\u1EC7u",
|
|
1295
|
+
clearable: true
|
|
1296
|
+
}
|
|
1297
|
+
),
|
|
1298
|
+
/* @__PURE__ */ React.createElement(SimpleGrid2, { cols: { base: 1, md: 2, lg: 2, xl: 4 } }, /* @__PURE__ */ React.createElement(
|
|
1299
|
+
NumberInput,
|
|
1300
|
+
{
|
|
1301
|
+
label: "D\xF2ng ti\xEAu \u0111\u1EC1 b\u1EAFt \u0111\u1EA7u t\u1EEB",
|
|
1302
|
+
value: store.state.startTitleIndex,
|
|
1303
|
+
onChange: (e4) => store.setProperty("startTitleIndex", e4)
|
|
1304
|
+
}
|
|
1305
|
+
), /* @__PURE__ */ React.createElement(
|
|
1306
|
+
NumberInput,
|
|
1307
|
+
{
|
|
1308
|
+
label: "D\xF2ng d\u1EEF li\u1EC7u b\u1EAFt \u0111\u1EA7u t\u1EEB",
|
|
1309
|
+
value: store.state.startDataIndex,
|
|
1310
|
+
onChange: (e4) => store.setProperty("startDataIndex", e4)
|
|
1311
|
+
}
|
|
1312
|
+
), /* @__PURE__ */ React.createElement(
|
|
1313
|
+
Select2,
|
|
1314
|
+
{
|
|
1315
|
+
readOnly: true,
|
|
1316
|
+
label: "\u0110\u1ECBnh d\u1EA1ng s\u1ED1",
|
|
1317
|
+
data: ["100.000"],
|
|
1318
|
+
defaultValue: "100.000"
|
|
1319
|
+
}
|
|
1320
|
+
), /* @__PURE__ */ React.createElement(
|
|
1321
|
+
Select2,
|
|
1322
|
+
{
|
|
1323
|
+
readOnly: true,
|
|
1324
|
+
label: "\u0110\u1ECBnh d\u1EA1ng ng\xE0y",
|
|
1325
|
+
data: ["dd/MM/yyyy"],
|
|
1326
|
+
defaultValue: "dd/MM/yyyy"
|
|
1327
|
+
}
|
|
1328
|
+
)),
|
|
1329
|
+
/* @__PURE__ */ React.createElement(Fieldset2, { legend: "Danh s\xE1ch tr\u01B0\u1EDDng th\xF4ng tin trong file d\u1EEF li\u1EC7u" }, store.state.data && /* @__PURE__ */ React.createElement(
|
|
1330
|
+
MyDataTable,
|
|
1331
|
+
{
|
|
1332
|
+
columns: store.columns,
|
|
1333
|
+
data: store.state.data
|
|
1334
|
+
}
|
|
1335
|
+
)),
|
|
1336
|
+
/* @__PURE__ */ React.createElement(MyFlexEnd, null, /* @__PURE__ */ React.createElement(
|
|
1337
|
+
Button7,
|
|
1338
|
+
{
|
|
1339
|
+
color: "teal.8",
|
|
1340
|
+
onClick: onExportStructure
|
|
1341
|
+
},
|
|
1342
|
+
"Xu\u1EA5t file c\u1EA5u tr\xFAc"
|
|
1343
|
+
), /* @__PURE__ */ React.createElement(
|
|
1344
|
+
Button7,
|
|
1345
|
+
{
|
|
1346
|
+
disabled: ((_a = store.state.data) == null ? void 0 : _a.length) == 0,
|
|
1347
|
+
color: "blue.8",
|
|
1348
|
+
leftSection: /* @__PURE__ */ React.createElement(IconArrowBigRight2, null),
|
|
1349
|
+
onClick: () => stack.open("select-field-page")
|
|
1350
|
+
},
|
|
1351
|
+
"Ti\u1EBFp t\u1EE5c"
|
|
1352
|
+
), /* @__PURE__ */ React.createElement(
|
|
1353
|
+
Button7,
|
|
1354
|
+
{
|
|
1355
|
+
color: "red.6",
|
|
1356
|
+
leftSection: /* @__PURE__ */ React.createElement(IconSquareRoundedX2, null),
|
|
1357
|
+
onClick: stack.closeAll
|
|
1358
|
+
},
|
|
1359
|
+
"\u0110\xF3ng"
|
|
1360
|
+
))
|
|
1361
|
+
);
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
// src/components/Buttons/ButtonImport/MyButtonImport.tsx
|
|
1365
|
+
function MyButtonImport({
|
|
1366
|
+
onExportStructure,
|
|
1367
|
+
onImport
|
|
1368
|
+
}) {
|
|
1369
|
+
const stack = useModalsStack3(["select-file-page", "select-field-page", "implement-page"]);
|
|
1370
|
+
const store = useS_ButtonImport();
|
|
1371
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Button8, { color: "teal.8", onClick: () => stack.open("select-file-page"), leftSection: /* @__PURE__ */ React.createElement(IconFileImport2, null), title: "Import" }, "Import"), /* @__PURE__ */ React.createElement(Modal8.Stack, null, /* @__PURE__ */ React.createElement(SelectFileModal, { stack, onExportStructure }), /* @__PURE__ */ React.createElement(SelectFieldModal, { stack, onImport: () => onImport(store.getDataFinal()) })));
|
|
1372
|
+
}
|
|
678
1373
|
|
|
679
1374
|
// src/components/Buttons/ButtonModal/AQSelectTableByOpenModal.tsx
|
|
680
1375
|
import { Button as Button9, Fieldset as Fieldset3, Modal as Modal9 } from "@mantine/core";
|
|
681
1376
|
import { useDisclosure as useDisclosure8 } from "@mantine/hooks";
|
|
1377
|
+
function AQSelectTableByOpenModal(_a) {
|
|
1378
|
+
var _b = _a, {
|
|
1379
|
+
setSelectedData,
|
|
1380
|
+
data,
|
|
1381
|
+
columns,
|
|
1382
|
+
API,
|
|
1383
|
+
modalSize,
|
|
1384
|
+
title,
|
|
1385
|
+
label,
|
|
1386
|
+
listLabel,
|
|
1387
|
+
objectName,
|
|
1388
|
+
fullScreen = false,
|
|
1389
|
+
closeAfterSelect = true
|
|
1390
|
+
} = _b, rest = __objRest(_b, [
|
|
1391
|
+
"setSelectedData",
|
|
1392
|
+
"data",
|
|
1393
|
+
"columns",
|
|
1394
|
+
"API",
|
|
1395
|
+
"modalSize",
|
|
1396
|
+
"title",
|
|
1397
|
+
"label",
|
|
1398
|
+
"listLabel",
|
|
1399
|
+
"objectName",
|
|
1400
|
+
"fullScreen",
|
|
1401
|
+
"closeAfterSelect"
|
|
1402
|
+
]);
|
|
1403
|
+
const disclosure = useDisclosure8(false);
|
|
1404
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
1405
|
+
Button9,
|
|
1406
|
+
__spreadValues({
|
|
1407
|
+
onClick: disclosure[1].open
|
|
1408
|
+
}, rest),
|
|
1409
|
+
label ? label : `Ch\u1ECDn t\u1EEB danh s\xE1ch`
|
|
1410
|
+
), /* @__PURE__ */ React.createElement(
|
|
1411
|
+
Modal9,
|
|
1412
|
+
{
|
|
1413
|
+
fullScreen,
|
|
1414
|
+
size: modalSize,
|
|
1415
|
+
title,
|
|
1416
|
+
opened: disclosure == null ? void 0 : disclosure[0],
|
|
1417
|
+
onClose: disclosure[1].close
|
|
1418
|
+
},
|
|
1419
|
+
/* @__PURE__ */ React.createElement(MyFlexColumn, null, /* @__PURE__ */ React.createElement(Fieldset3, { legend: listLabel ? listLabel : "Danh s\xE1ch" }, /* @__PURE__ */ React.createElement(
|
|
1420
|
+
MyDataTable,
|
|
1421
|
+
__spreadValues({
|
|
1422
|
+
renderTopToolbarCustomActions: ({ table }) => {
|
|
1423
|
+
return /* @__PURE__ */ React.createElement(Button9, { onClick: () => {
|
|
1424
|
+
setSelectedData(table.getSelectedRowModel().rows.map((row) => row.original));
|
|
1425
|
+
closeAfterSelect && disclosure[1].close();
|
|
1426
|
+
} }, "Ch\u1ECDn");
|
|
1427
|
+
},
|
|
1428
|
+
enableRowSelection: true,
|
|
1429
|
+
data,
|
|
1430
|
+
columns
|
|
1431
|
+
}, rest)
|
|
1432
|
+
)))
|
|
1433
|
+
));
|
|
1434
|
+
}
|
|
682
1435
|
|
|
683
1436
|
// src/components/Buttons/ButtonRouterBack/MyButtonRouterBack.tsx
|
|
684
1437
|
import { Button as Button10 } from "@mantine/core";
|
|
685
1438
|
import { IconArrowBack } from "@tabler/icons-react";
|
|
686
1439
|
import { useRouter as useRouter2 } from "next/navigation";
|
|
1440
|
+
function MyButtonRouterBack(_a) {
|
|
1441
|
+
var _b = _a, { url, label } = _b, rest = __objRest(_b, ["url", "label"]);
|
|
1442
|
+
const router = useRouter2();
|
|
1443
|
+
return /* @__PURE__ */ React.createElement(
|
|
1444
|
+
Button10,
|
|
1445
|
+
__spreadValues({
|
|
1446
|
+
variant: "light",
|
|
1447
|
+
leftSection: /* @__PURE__ */ React.createElement(IconArrowBack, { stroke: 2 }),
|
|
1448
|
+
onClick: () => {
|
|
1449
|
+
if (url) {
|
|
1450
|
+
router.replace(url);
|
|
1451
|
+
return;
|
|
1452
|
+
}
|
|
1453
|
+
router.back();
|
|
1454
|
+
}
|
|
1455
|
+
}, rest),
|
|
1456
|
+
label ? label : "Tr\u1EDF v\u1EC1"
|
|
1457
|
+
);
|
|
1458
|
+
}
|
|
687
1459
|
|
|
688
1460
|
// src/api/baseAxios.ts
|
|
689
1461
|
import axios from "axios";
|
|
@@ -707,6 +1479,7 @@ baseAxios.interceptors.request.use(
|
|
|
707
1479
|
return Promise.reject(error);
|
|
708
1480
|
}
|
|
709
1481
|
);
|
|
1482
|
+
var baseAxios_default = baseAxios;
|
|
710
1483
|
|
|
711
1484
|
// src/components/Buttons/ButtonViewPDF/MyButtonViewPDF.tsx
|
|
712
1485
|
import { ActionIcon as ActionIcon9, Button as Button11, Group as Group7, LoadingOverlay, Modal as Modal10, Paper as Paper3, Text as Text5, Tooltip as Tooltip4 } from "@mantine/core";
|
|
@@ -714,6 +1487,64 @@ import { useDisclosure as useDisclosure9 } from "@mantine/hooks";
|
|
|
714
1487
|
import { IconLivePhoto as IconLivePhoto2, IconMaximize as IconMaximize3, IconMinimize as IconMinimize3 } from "@tabler/icons-react";
|
|
715
1488
|
import { useQuery } from "@tanstack/react-query";
|
|
716
1489
|
import { useState as useState6 } from "react";
|
|
1490
|
+
function MyButtonViewPDF({ id, modalSize = "80%", label = "Xem file", src = "https://datafiles.chinhphu.vn/cpp/files/vbpq/2016/07/85.signed.pdf" }) {
|
|
1491
|
+
var _a, _b;
|
|
1492
|
+
const disc = useDisclosure9(false);
|
|
1493
|
+
const fullScreen = useState6(false);
|
|
1494
|
+
const hSize = useState6("80vh");
|
|
1495
|
+
const query = useQuery({
|
|
1496
|
+
queryKey: ["MyButtonViewPDF", id],
|
|
1497
|
+
queryFn: async () => {
|
|
1498
|
+
return (await baseAxios_default.get("/Document/Get?id=" + id)).data.data;
|
|
1499
|
+
},
|
|
1500
|
+
enabled: id != void 0 && disc[0] == true
|
|
1501
|
+
});
|
|
1502
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Tooltip4, { label: "Xem t\xE0i li\u1EC7u tr\u1EF1c ti\u1EBFp" }, /* @__PURE__ */ React.createElement(Button11, { color: "cyan", onClick: () => {
|
|
1503
|
+
disc[1].open();
|
|
1504
|
+
}, leftSection: /* @__PURE__ */ React.createElement(IconLivePhoto2, null) }, label)), /* @__PURE__ */ React.createElement(
|
|
1505
|
+
Modal10,
|
|
1506
|
+
{
|
|
1507
|
+
fullScreen: fullScreen[0],
|
|
1508
|
+
opened: disc[0],
|
|
1509
|
+
onClose: disc[1].close,
|
|
1510
|
+
size: modalSize,
|
|
1511
|
+
title: /* @__PURE__ */ React.createElement(Group7, null, /* @__PURE__ */ React.createElement(Text5, null, "Xem t\xE0i li\u1EC7u tr\u1EF1c ti\u1EBFp"), fullScreen[0] ? /* @__PURE__ */ React.createElement(
|
|
1512
|
+
ActionIcon9,
|
|
1513
|
+
{
|
|
1514
|
+
onClick: () => {
|
|
1515
|
+
fullScreen[1](false);
|
|
1516
|
+
hSize[1]("80vh");
|
|
1517
|
+
}
|
|
1518
|
+
},
|
|
1519
|
+
/* @__PURE__ */ React.createElement(IconMinimize3, null)
|
|
1520
|
+
) : /* @__PURE__ */ React.createElement(
|
|
1521
|
+
ActionIcon9,
|
|
1522
|
+
{
|
|
1523
|
+
onClick: () => {
|
|
1524
|
+
fullScreen[1](true);
|
|
1525
|
+
hSize[1]("90vh");
|
|
1526
|
+
}
|
|
1527
|
+
},
|
|
1528
|
+
/* @__PURE__ */ React.createElement(IconMaximize3, null)
|
|
1529
|
+
))
|
|
1530
|
+
},
|
|
1531
|
+
/* @__PURE__ */ React.createElement(Paper3, { h: hSize[0], p: "lg", pos: "relative" }, /* @__PURE__ */ React.createElement(LoadingOverlay, { visible: query.isLoading, zIndex: 1e3, overlayProps: { radius: "sm", blur: 2 } }), query.data ? /* @__PURE__ */ React.createElement(
|
|
1532
|
+
"iframe",
|
|
1533
|
+
{
|
|
1534
|
+
src: `data:application/pdf;base64, ${(_b = (_a = query.data) == null ? void 0 : _a.fileDetail) == null ? void 0 : _b.fileBase64String}`,
|
|
1535
|
+
width: "100%",
|
|
1536
|
+
height: "100%"
|
|
1537
|
+
}
|
|
1538
|
+
) : /* @__PURE__ */ React.createElement(
|
|
1539
|
+
"iframe",
|
|
1540
|
+
{
|
|
1541
|
+
src,
|
|
1542
|
+
width: "100%",
|
|
1543
|
+
height: "100%"
|
|
1544
|
+
}
|
|
1545
|
+
))
|
|
1546
|
+
));
|
|
1547
|
+
}
|
|
717
1548
|
|
|
718
1549
|
// node_modules/preact/dist/preact.mjs
|
|
719
1550
|
var n;
|
|
@@ -3235,6 +4066,7 @@ var config$3 = {
|
|
|
3235
4066
|
backwardForwardUnits: 7
|
|
3236
4067
|
};
|
|
3237
4068
|
var viewWeek = createPreactView(config$3);
|
|
4069
|
+
var createViewWeek = () => createPreactView(config$3);
|
|
3238
4070
|
var DayWrapper = ({ $app, id }) => {
|
|
3239
4071
|
return u2(WeekWrapper, { "$app": $app, id });
|
|
3240
4072
|
};
|
|
@@ -3249,6 +4081,7 @@ var config$2 = {
|
|
|
3249
4081
|
backwardForwardUnits: 1
|
|
3250
4082
|
};
|
|
3251
4083
|
var viewDay = createPreactView(config$2);
|
|
4084
|
+
var createViewDay = () => createPreactView(config$2);
|
|
3252
4085
|
var getWeekNumber = (d5, firstDayOfWeek) => {
|
|
3253
4086
|
d5 = new Date(Date.UTC(d5.getFullYear(), d5.getMonth(), d5.getDate()));
|
|
3254
4087
|
const dayOffset = (d5.getUTCDay() - firstDayOfWeek + 7) % 7;
|
|
@@ -4455,6 +5288,7 @@ var config$1 = {
|
|
|
4455
5288
|
backwardForwardUnits: 1
|
|
4456
5289
|
};
|
|
4457
5290
|
var viewMonthGrid = createPreactView(config$1);
|
|
5291
|
+
var createViewMonthGrid = () => createPreactView(config$1);
|
|
4458
5292
|
var createAgendaMonth = (date, timeUnitsImpl) => {
|
|
4459
5293
|
const { year, month } = toIntegers(date);
|
|
4460
5294
|
const monthWithDates = timeUnitsImpl.getMonthWithTrailingAndLeadingDays(year, month);
|
|
@@ -4642,6 +5476,7 @@ var config = {
|
|
|
4642
5476
|
backwardForwardUnits: 1
|
|
4643
5477
|
};
|
|
4644
5478
|
var viewMonthAgenda = createPreactView(config);
|
|
5479
|
+
var createViewMonthAgenda = () => createPreactView(config);
|
|
4645
5480
|
|
|
4646
5481
|
// src/components/Calendar/MyCalendar.tsx
|
|
4647
5482
|
import { createEventModalPlugin } from "@schedule-x/event-modal";
|
|
@@ -4650,44 +5485,265 @@ import { ScheduleXCalendar, useNextCalendarApp } from "@schedule-x/react";
|
|
|
4650
5485
|
import { Paper as Paper4, Text as Text6 } from "@mantine/core";
|
|
4651
5486
|
import "@schedule-x/theme-default/dist/index.css";
|
|
4652
5487
|
import { useEffect as useEffect4 } from "react";
|
|
5488
|
+
function MyCalendar() {
|
|
5489
|
+
const plugins = [createEventsServicePlugin(), createEventModalPlugin()];
|
|
5490
|
+
const calendar = useNextCalendarApp({
|
|
5491
|
+
locale: "vi-VN",
|
|
5492
|
+
dayBoundaries: {
|
|
5493
|
+
start: "05:00",
|
|
5494
|
+
end: "21:00"
|
|
5495
|
+
},
|
|
5496
|
+
weekOptions: {
|
|
5497
|
+
gridHeight: 700
|
|
5498
|
+
},
|
|
5499
|
+
views: [createViewDay(), createViewWeek(), createViewMonthGrid(), createViewMonthAgenda()],
|
|
5500
|
+
events: [
|
|
5501
|
+
{
|
|
5502
|
+
id: "1",
|
|
5503
|
+
giangvien: "TDMU048- B\xF9i \u0110\u1EE9c Anh",
|
|
5504
|
+
title: "Tin h\u1ECDc c\u0103n b\u1EA3n",
|
|
5505
|
+
people: ["S\u1EE9c ch\u1EE9a: 30"],
|
|
5506
|
+
location: "Ph\xF2ng: B103",
|
|
5507
|
+
start: "2024-12-17 06:00",
|
|
5508
|
+
end: "2024-12-17 08:00",
|
|
5509
|
+
laLichThi: false,
|
|
5510
|
+
description: "Gi\u1EA3ng vi\xEAn: TDMU048- B\xF9i \u0110\u1EE9c Anh"
|
|
5511
|
+
},
|
|
5512
|
+
{
|
|
5513
|
+
id: "2",
|
|
5514
|
+
giangvien: "CNTT030- Nguy\u1EC5n Th\u1EBF B\u1EA3o",
|
|
5515
|
+
title: "Tin h\u1ECDc c\u0103n b\u1EA3n",
|
|
5516
|
+
people: ["S\u1EE9c ch\u1EE9a: 30"],
|
|
5517
|
+
location: "Ph\xF2ng: B103",
|
|
5518
|
+
start: "2024-12-18 06:00",
|
|
5519
|
+
end: "2024-12-18 08:00",
|
|
5520
|
+
laLichThi: false,
|
|
5521
|
+
description: "Gi\u1EA3ng vi\xEAn: CNTT030- Nguy\u1EC5n Th\u1EBF B\u1EA3o"
|
|
5522
|
+
},
|
|
5523
|
+
{
|
|
5524
|
+
id: 3,
|
|
5525
|
+
giangvien: "CNTT026- V\xF5 Th\u1ECB Di\u1EC5m H\u01B0\u01A1ng",
|
|
5526
|
+
title: "Tin h\u1ECDc c\u0103n b\u1EA3n",
|
|
5527
|
+
people: ["S\u1EE9c ch\u1EE9a: 30"],
|
|
5528
|
+
location: "Ph\xF2ng: B103",
|
|
5529
|
+
start: "2024-12-19 06:00",
|
|
5530
|
+
end: "2024-12-19 08:00",
|
|
5531
|
+
laLichThi: false,
|
|
5532
|
+
description: "Gi\u1EA3ng vi\xEAn: CNTT026- V\xF5 Th\u1ECB Di\u1EC5m H\u01B0\u01A1ng"
|
|
5533
|
+
},
|
|
5534
|
+
{
|
|
5535
|
+
id: 4,
|
|
5536
|
+
giangvien: "KHNN065- Nguy\u1EC5n Xu\xE2n Ti\u1EBFn",
|
|
5537
|
+
title: "Tin h\u1ECDc c\u0103n b\u1EA3n",
|
|
5538
|
+
people: ["S\u1EE9c ch\u1EE9a: 30"],
|
|
5539
|
+
location: "Ph\xF2ng: B102",
|
|
5540
|
+
start: "2024-12-20 06:00",
|
|
5541
|
+
end: "2024-12-20 08:00",
|
|
5542
|
+
laLichThi: false,
|
|
5543
|
+
description: "Gi\u1EA3ng vi\xEAn: KHNN065- Nguy\u1EC5n Xu\xE2n Ti\u1EBFn"
|
|
5544
|
+
},
|
|
5545
|
+
{
|
|
5546
|
+
id: 5,
|
|
5547
|
+
// giangvien: 'KHNN065- Nguyễn Xuân Tiến',
|
|
5548
|
+
title: "Ti\u1EBFng anh th\u01B0\u01A1ng m\u1EA1i",
|
|
5549
|
+
people: ["S\u1EE9c ch\u1EE9a: 30"],
|
|
5550
|
+
location: "Ph\xF2ng: B102",
|
|
5551
|
+
start: "2024-12-16 14:00",
|
|
5552
|
+
end: "2024-12-16 16:00",
|
|
5553
|
+
laLichThi: true
|
|
5554
|
+
// description: "Giảng viên: KHNN065- Nguyễn Xuân Tiến"
|
|
5555
|
+
}
|
|
5556
|
+
]
|
|
5557
|
+
}, plugins);
|
|
5558
|
+
useEffect4(() => {
|
|
5559
|
+
calendar == null ? void 0 : calendar.events.getAll();
|
|
5560
|
+
}, []);
|
|
5561
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(ScheduleXCalendar, { calendarApp: calendar, customComponents: {
|
|
5562
|
+
timeGridEvent: ({ calendarEvent }) => {
|
|
5563
|
+
console.log(calendarEvent);
|
|
5564
|
+
return /* @__PURE__ */ React.createElement(Paper4, { h: "100%", bg: calendarEvent.laLichThi ? "violet.2" : "blue.2", p: 4 }, /* @__PURE__ */ React.createElement(MyFlexColumn, { gap: 1 }, /* @__PURE__ */ React.createElement(Text6, { size: "sm", fw: "bold" }, calendarEvent.laLichThi ? "(Thi) " : "(H\u1ECDc) ", calendarEvent.title), calendarEvent.laLichThi == false && /* @__PURE__ */ React.createElement(Text6, { size: "sm" }, calendarEvent.giangvien), /* @__PURE__ */ React.createElement(Text6, { size: "sm" }, calendarEvent.location)));
|
|
5565
|
+
}
|
|
5566
|
+
// eventModal: ({ calendarEvent }) => {
|
|
5567
|
+
// return (
|
|
5568
|
+
// <Paper bg={'red'} style={{ position: 'relative', overflow: "hidden" }}>
|
|
5569
|
+
// âs
|
|
5570
|
+
// </Paper>
|
|
5571
|
+
// )
|
|
5572
|
+
// }
|
|
5573
|
+
} }));
|
|
5574
|
+
}
|
|
4653
5575
|
|
|
4654
5576
|
// src/components/CenterFull/MyCenterFull.tsx
|
|
4655
5577
|
import { Center as Center2, Group as Group8 } from "@mantine/core";
|
|
5578
|
+
function MyCenterFull({ children }) {
|
|
5579
|
+
return /* @__PURE__ */ React.createElement(Center2, { w: "100%" }, /* @__PURE__ */ React.createElement(Group8, null, children));
|
|
5580
|
+
}
|
|
4656
5581
|
|
|
4657
5582
|
// src/components/Checkbox/MyCheckbox.tsx
|
|
4658
5583
|
import { Checkbox as Checkbox2 } from "@mantine/core";
|
|
5584
|
+
function MyCheckbox(_a) {
|
|
5585
|
+
var rest = __objRest(_a, []);
|
|
5586
|
+
return /* @__PURE__ */ React.createElement(Checkbox2, __spreadValues({}, rest));
|
|
5587
|
+
}
|
|
4659
5588
|
|
|
4660
5589
|
// src/components/Layouts/FlexRow/MyFlexRow.tsx
|
|
4661
5590
|
import { Flex as Flex2 } from "@mantine/core";
|
|
5591
|
+
function MyFlexRow(_a) {
|
|
5592
|
+
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
5593
|
+
return /* @__PURE__ */ React.createElement(Flex2, __spreadValues({ gap: "md", align: "center" }, rest), children);
|
|
5594
|
+
}
|
|
4662
5595
|
|
|
4663
5596
|
// src/components/DataDisplay/Card/AQCard.tsx
|
|
4664
5597
|
import { Badge, Card, Center as Center3, Image, Text as Text7 } from "@mantine/core";
|
|
4665
5598
|
import Link from "next/link";
|
|
5599
|
+
function AQCard({
|
|
5600
|
+
imgSrc = "https://raw.githubusercontent.com/mantinedev/mantine/master/.demo/images/bg-8.png",
|
|
5601
|
+
title,
|
|
5602
|
+
description,
|
|
5603
|
+
date,
|
|
5604
|
+
children,
|
|
5605
|
+
status,
|
|
5606
|
+
href = ""
|
|
5607
|
+
}) {
|
|
5608
|
+
return /* @__PURE__ */ React.createElement(Card, { shadow: "sm", padding: "lg", radius: "md", withBorder: true, component: Link, href }, /* @__PURE__ */ React.createElement(Card.Section, null, /* @__PURE__ */ React.createElement(Center3, null, /* @__PURE__ */ React.createElement(
|
|
5609
|
+
Image,
|
|
5610
|
+
{
|
|
5611
|
+
src: imgSrc,
|
|
5612
|
+
h: 200,
|
|
5613
|
+
w: "auto",
|
|
5614
|
+
fallbackSrc: "https://placehold.co/600x400?text=Placeholder",
|
|
5615
|
+
alt: "Norway"
|
|
5616
|
+
}
|
|
5617
|
+
))), /* @__PURE__ */ React.createElement(MyFlexRow, { justify: "space-between", mt: "md", mb: "xs" }, /* @__PURE__ */ React.createElement(Text7, { fw: 500 }, title), status && /* @__PURE__ */ React.createElement(Badge, { color: "violet.5", w: "150px" }, status)), /* @__PURE__ */ React.createElement(Text7, { size: "sm", c: "dimmed", lineClamp: 2 }, description), children);
|
|
5618
|
+
}
|
|
4666
5619
|
|
|
4667
5620
|
// src/components/DataDisplay/KeyLabel/MyKeyLabel.tsx
|
|
4668
5621
|
import { Group as Group9, Text as Text8 } from "@mantine/core";
|
|
5622
|
+
function MyKeyLabel({ keyLabel, label }) {
|
|
5623
|
+
return /* @__PURE__ */ React.createElement(Group9, { gap: 5 }, /* @__PURE__ */ React.createElement(Text8, { fw: "bold" }, keyLabel, ":"), /* @__PURE__ */ React.createElement(Text8, null, label));
|
|
5624
|
+
}
|
|
4669
5625
|
|
|
4670
5626
|
// src/components/DataDisplay/NumberFormatter/MyNumberFormatter.tsx
|
|
4671
5627
|
import { NumberFormatter } from "@mantine/core";
|
|
5628
|
+
function MyNumberFormatter(_a) {
|
|
5629
|
+
var rest = __objRest(_a, []);
|
|
5630
|
+
return /* @__PURE__ */ React.createElement(NumberFormatter, __spreadValues({ thousandSeparator: true, suffix: " VN\u0110" }, rest));
|
|
5631
|
+
}
|
|
4672
5632
|
|
|
4673
5633
|
// src/components/DataDisplay/StatCard/AQStatCard1.tsx
|
|
4674
5634
|
import { Box, Button as Button12, Flex as Flex3, Group as Group10, Paper as Paper5, Text as Text9 } from "@mantine/core";
|
|
4675
5635
|
import { IconArrowDownRight, IconArrowUpRight } from "@tabler/icons-react";
|
|
5636
|
+
function AQStatCard1({ title, value, unit = "", description, icons, diff }) {
|
|
5637
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
5638
|
+
Paper5,
|
|
5639
|
+
{
|
|
5640
|
+
withBorder: true,
|
|
5641
|
+
p: "md",
|
|
5642
|
+
radius: "md",
|
|
5643
|
+
key: title
|
|
5644
|
+
},
|
|
5645
|
+
/* @__PURE__ */ React.createElement(Group10, { justify: "space-between" }, /* @__PURE__ */ React.createElement(Flex3, { direction: "column" }, /* @__PURE__ */ React.createElement(
|
|
5646
|
+
Text9,
|
|
5647
|
+
{
|
|
5648
|
+
tt: "uppercase",
|
|
5649
|
+
size: "lg",
|
|
5650
|
+
c: "dimmed"
|
|
5651
|
+
},
|
|
5652
|
+
title
|
|
5653
|
+
), unit == "" ? /* @__PURE__ */ React.createElement(Text9, { size: "xs", style: { visibility: "hidden" } }, "\u0110\u01A1n v\u1ECB: ", /* @__PURE__ */ React.createElement("strong", null, unit)) : /* @__PURE__ */ React.createElement(Text9, { size: "xs" }, "\u0110\u01A1n v\u1ECB: ", /* @__PURE__ */ React.createElement("strong", null, unit))), /* @__PURE__ */ React.createElement(Box, null, icons)),
|
|
5654
|
+
/* @__PURE__ */ React.createElement(
|
|
5655
|
+
Group10,
|
|
5656
|
+
{
|
|
5657
|
+
mt: "5",
|
|
5658
|
+
align: "flex-end",
|
|
5659
|
+
gap: "xs"
|
|
5660
|
+
},
|
|
5661
|
+
/* @__PURE__ */ React.createElement(
|
|
5662
|
+
Text9,
|
|
5663
|
+
{
|
|
5664
|
+
fw: 700,
|
|
5665
|
+
fz: "h1"
|
|
5666
|
+
},
|
|
5667
|
+
value
|
|
5668
|
+
),
|
|
5669
|
+
/* @__PURE__ */ React.createElement(
|
|
5670
|
+
Text9,
|
|
5671
|
+
{
|
|
5672
|
+
mb: "2",
|
|
5673
|
+
c: diff > 0 ? "teal" : "red",
|
|
5674
|
+
fz: "h2",
|
|
5675
|
+
fw: 500
|
|
5676
|
+
},
|
|
5677
|
+
/* @__PURE__ */ React.createElement("span", null, diff, "%"),
|
|
5678
|
+
diff > 0 ? /* @__PURE__ */ React.createElement(IconArrowUpRight, null) : /* @__PURE__ */ React.createElement(IconArrowDownRight, null)
|
|
5679
|
+
)
|
|
5680
|
+
),
|
|
5681
|
+
/* @__PURE__ */ React.createElement(Group10, { justify: "space-between" }, /* @__PURE__ */ React.createElement(Text9, { tt: "uppercase", fz: "xs", c: "dimmed" }, description), /* @__PURE__ */ React.createElement(
|
|
5682
|
+
Button12,
|
|
5683
|
+
{
|
|
5684
|
+
variant: "light",
|
|
5685
|
+
size: "xs"
|
|
5686
|
+
},
|
|
5687
|
+
"Xem chi ti\u1EBFt"
|
|
5688
|
+
))
|
|
5689
|
+
));
|
|
5690
|
+
}
|
|
4676
5691
|
|
|
4677
5692
|
// src/components/Inputs/DateInput/MyDateInput.tsx
|
|
4678
5693
|
import { DateInput } from "@mantine/dates";
|
|
5694
|
+
function MyDateInput(_a) {
|
|
5695
|
+
var _b = _a, { label } = _b, rest = __objRest(_b, ["label"]);
|
|
5696
|
+
return /* @__PURE__ */ React.createElement(DateInput, __spreadValues({ label, placeholder: label ? `Ch\u1ECDn ${label == null ? void 0 : label.toLowerCase()}` : "" }, rest));
|
|
5697
|
+
}
|
|
4679
5698
|
|
|
4680
5699
|
// src/components/Inputs/Fieldset/MyFieldset.tsx
|
|
4681
5700
|
import { Box as Box2, Fieldset as Fieldset4, Text as Text10 } from "@mantine/core";
|
|
5701
|
+
function MyFieldset(_a) {
|
|
5702
|
+
var _b = _a, {
|
|
5703
|
+
children,
|
|
5704
|
+
title
|
|
5705
|
+
} = _b, rest = __objRest(_b, [
|
|
5706
|
+
"children",
|
|
5707
|
+
"title"
|
|
5708
|
+
]);
|
|
5709
|
+
return /* @__PURE__ */ React.createElement(
|
|
5710
|
+
Fieldset4,
|
|
5711
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
5712
|
+
legend: /* @__PURE__ */ React.createElement(
|
|
5713
|
+
Box2,
|
|
5714
|
+
{
|
|
5715
|
+
bg: "blue.4",
|
|
5716
|
+
px: "xs",
|
|
5717
|
+
py: 2,
|
|
5718
|
+
style: { borderRadius: 4 }
|
|
5719
|
+
},
|
|
5720
|
+
/* @__PURE__ */ React.createElement(Text10, { c: "white", fw: 500 }, title)
|
|
5721
|
+
)
|
|
5722
|
+
}),
|
|
5723
|
+
children
|
|
5724
|
+
);
|
|
5725
|
+
}
|
|
4682
5726
|
|
|
4683
5727
|
// src/components/Inputs/FileInput/MyFileInput.tsx
|
|
4684
5728
|
import { FileInput as FileInput3 } from "@mantine/core";
|
|
5729
|
+
function MyFileInput(_a) {
|
|
5730
|
+
var _b = _a, { label } = _b, rest = __objRest(_b, ["label"]);
|
|
5731
|
+
return /* @__PURE__ */ React.createElement(FileInput3, __spreadValues({ label, placeholder: label ? `Ch\u1ECDn ${label == null ? void 0 : label.toLowerCase()}` : "" }, rest));
|
|
5732
|
+
}
|
|
4685
5733
|
|
|
4686
5734
|
// src/components/Inputs/NumberInput/MyNumberInput.tsx
|
|
4687
5735
|
import { NumberInput as NumberInput2 } from "@mantine/core";
|
|
5736
|
+
function MyNumberInput(_a) {
|
|
5737
|
+
var _b = _a, { label } = _b, rest = __objRest(_b, ["label"]);
|
|
5738
|
+
return /* @__PURE__ */ React.createElement(NumberInput2, __spreadValues({ label, placeholder: label ? `Nh\u1EADp ${label == null ? void 0 : label.toLowerCase()}` : "" }, rest));
|
|
5739
|
+
}
|
|
4688
5740
|
|
|
4689
5741
|
// src/components/Inputs/TextArea/MyTextArea.tsx
|
|
4690
5742
|
import { Textarea } from "@mantine/core";
|
|
5743
|
+
function MyTextArea(_a) {
|
|
5744
|
+
var _b = _a, { label } = _b, rest = __objRest(_b, ["label"]);
|
|
5745
|
+
return /* @__PURE__ */ React.createElement(Textarea, __spreadValues({ label, placeholder: label ? `Nh\u1EADp ${label == null ? void 0 : label.toLowerCase()}` : "" }, rest));
|
|
5746
|
+
}
|
|
4691
5747
|
|
|
4692
5748
|
// src/components/Inputs/TextEditor/MyTextEditor.tsx
|
|
4693
5749
|
import { Input, ScrollArea } from "@mantine/core";
|
|
@@ -4702,6 +5758,110 @@ import Underline from "@tiptap/extension-underline";
|
|
|
4702
5758
|
import { useEditor } from "@tiptap/react";
|
|
4703
5759
|
import StarterKit from "@tiptap/starter-kit";
|
|
4704
5760
|
import { useEffect as useEffect5, useState as useState7 } from "react";
|
|
5761
|
+
function MyTextEditor(_a) {
|
|
5762
|
+
var _b = _a, { autoHiddenToolBar = false, contentHeight = "400px", onChange, value, error, label } = _b, rest = __objRest(_b, ["autoHiddenToolBar", "contentHeight", "onChange", "value", "error", "label"]);
|
|
5763
|
+
const [hiddenToolBar, setHiddenToolBar] = useState7(autoHiddenToolBar);
|
|
5764
|
+
const editor = useEditor(__spreadValues({
|
|
5765
|
+
extensions: [
|
|
5766
|
+
StarterKit,
|
|
5767
|
+
Underline,
|
|
5768
|
+
Link2,
|
|
5769
|
+
Superscript,
|
|
5770
|
+
SubScript,
|
|
5771
|
+
Highlight2,
|
|
5772
|
+
Image2.extend({
|
|
5773
|
+
addAttributes() {
|
|
5774
|
+
return {
|
|
5775
|
+
src: {
|
|
5776
|
+
default: null
|
|
5777
|
+
},
|
|
5778
|
+
alt: {
|
|
5779
|
+
default: null
|
|
5780
|
+
}
|
|
5781
|
+
};
|
|
5782
|
+
},
|
|
5783
|
+
parseHTML() {
|
|
5784
|
+
return [
|
|
5785
|
+
{
|
|
5786
|
+
tag: "img[src]"
|
|
5787
|
+
}
|
|
5788
|
+
];
|
|
5789
|
+
},
|
|
5790
|
+
renderHTML({ HTMLAttributes }) {
|
|
5791
|
+
return ["img", HTMLAttributes];
|
|
5792
|
+
}
|
|
5793
|
+
}),
|
|
5794
|
+
TextAlign.configure({ types: ["heading", "paragraph"] }),
|
|
5795
|
+
FileHandler.configure({
|
|
5796
|
+
allowedMimeTypes: ["image/png", "image/jpeg", "image/gif", "image/webp"],
|
|
5797
|
+
onDrop: (currentEditor, files, pos) => {
|
|
5798
|
+
files.forEach((file) => {
|
|
5799
|
+
const fileReader = new FileReader();
|
|
5800
|
+
fileReader.readAsDataURL(file);
|
|
5801
|
+
fileReader.onload = () => {
|
|
5802
|
+
currentEditor.chain().insertContentAt(pos, {
|
|
5803
|
+
type: "image",
|
|
5804
|
+
attrs: {
|
|
5805
|
+
src: fileReader.result
|
|
5806
|
+
}
|
|
5807
|
+
}).focus().run();
|
|
5808
|
+
};
|
|
5809
|
+
});
|
|
5810
|
+
},
|
|
5811
|
+
onPaste: (currentEditor, files, htmlContent) => {
|
|
5812
|
+
files.forEach((file) => {
|
|
5813
|
+
if (htmlContent) {
|
|
5814
|
+
console.log(htmlContent);
|
|
5815
|
+
return false;
|
|
5816
|
+
}
|
|
5817
|
+
const fileReader = new FileReader();
|
|
5818
|
+
fileReader.readAsDataURL(file);
|
|
5819
|
+
fileReader.onload = () => {
|
|
5820
|
+
currentEditor.chain().insertContentAt(currentEditor.state.selection.anchor, {
|
|
5821
|
+
type: "image",
|
|
5822
|
+
attrs: {
|
|
5823
|
+
src: fileReader.result
|
|
5824
|
+
}
|
|
5825
|
+
}).focus().run();
|
|
5826
|
+
};
|
|
5827
|
+
});
|
|
5828
|
+
}
|
|
5829
|
+
})
|
|
5830
|
+
],
|
|
5831
|
+
content: value,
|
|
5832
|
+
onUpdate: ({ editor: editor2 }) => {
|
|
5833
|
+
const content = editor2.getHTML();
|
|
5834
|
+
if (content === "<p></p>") {
|
|
5835
|
+
onChange("");
|
|
5836
|
+
} else {
|
|
5837
|
+
onChange(content);
|
|
5838
|
+
}
|
|
5839
|
+
}
|
|
5840
|
+
}, rest));
|
|
5841
|
+
useEffect5(() => {
|
|
5842
|
+
if (editor && value !== editor.getHTML()) {
|
|
5843
|
+
editor.commands.setContent(value);
|
|
5844
|
+
}
|
|
5845
|
+
}, [value, editor]);
|
|
5846
|
+
return /* @__PURE__ */ React.createElement(Input.Wrapper, { label, flex: 1, error }, /* @__PURE__ */ React.createElement(RichTextEditor, { editor, style: { border: error && "1px solid #e03131" } }, /* @__PURE__ */ React.createElement(RichTextEditor.Toolbar, { hidden: hiddenToolBar, sticky: true, stickyOffset: 60 }, /* @__PURE__ */ React.createElement(RichTextEditor.ControlsGroup, null, /* @__PURE__ */ React.createElement(RichTextEditor.Bold, null), /* @__PURE__ */ React.createElement(RichTextEditor.Italic, null), /* @__PURE__ */ React.createElement(RichTextEditor.Underline, null), /* @__PURE__ */ React.createElement(RichTextEditor.Strikethrough, null), /* @__PURE__ */ React.createElement(RichTextEditor.ClearFormatting, null), /* @__PURE__ */ React.createElement(RichTextEditor.Highlight, null), /* @__PURE__ */ React.createElement(RichTextEditor.Code, null)), /* @__PURE__ */ React.createElement(RichTextEditor.ControlsGroup, null, /* @__PURE__ */ React.createElement(RichTextEditor.H1, null), /* @__PURE__ */ React.createElement(RichTextEditor.H2, null), /* @__PURE__ */ React.createElement(RichTextEditor.H3, null), /* @__PURE__ */ React.createElement(RichTextEditor.H4, null)), /* @__PURE__ */ React.createElement(RichTextEditor.ControlsGroup, null, /* @__PURE__ */ React.createElement(RichTextEditor.Blockquote, null), /* @__PURE__ */ React.createElement(RichTextEditor.Hr, null), /* @__PURE__ */ React.createElement(RichTextEditor.BulletList, null), /* @__PURE__ */ React.createElement(RichTextEditor.OrderedList, null), /* @__PURE__ */ React.createElement(RichTextEditor.Subscript, null), /* @__PURE__ */ React.createElement(RichTextEditor.Superscript, null)), /* @__PURE__ */ React.createElement(RichTextEditor.ControlsGroup, null, /* @__PURE__ */ React.createElement(RichTextEditor.Link, null), /* @__PURE__ */ React.createElement(RichTextEditor.Unlink, null)), /* @__PURE__ */ React.createElement(RichTextEditor.ControlsGroup, null, /* @__PURE__ */ React.createElement(RichTextEditor.AlignLeft, null), /* @__PURE__ */ React.createElement(RichTextEditor.AlignCenter, null), /* @__PURE__ */ React.createElement(RichTextEditor.AlignJustify, null), /* @__PURE__ */ React.createElement(RichTextEditor.AlignRight, null))), /* @__PURE__ */ React.createElement(
|
|
5847
|
+
ScrollArea.Autosize,
|
|
5848
|
+
{
|
|
5849
|
+
onMouseDown: () => {
|
|
5850
|
+
editor == null ? void 0 : editor.commands.focus();
|
|
5851
|
+
},
|
|
5852
|
+
onBlur: () => {
|
|
5853
|
+
if (autoHiddenToolBar == false) return;
|
|
5854
|
+
setHiddenToolBar(true);
|
|
5855
|
+
},
|
|
5856
|
+
onFocus: () => {
|
|
5857
|
+
if (autoHiddenToolBar == false) return;
|
|
5858
|
+
setHiddenToolBar(false);
|
|
5859
|
+
},
|
|
5860
|
+
style: { cursor: "text", maxHeight: "400px" }
|
|
5861
|
+
},
|
|
5862
|
+
/* @__PURE__ */ React.createElement(RichTextEditor.Content, { mih: contentHeight })
|
|
5863
|
+
)));
|
|
5864
|
+
}
|
|
4705
5865
|
|
|
4706
5866
|
// src/stores/S0Auth.ts
|
|
4707
5867
|
var useStore2 = createGenericStore({
|
|
@@ -4916,6 +6076,10 @@ function utils_layout_getItemsWithoutLinks(menu) {
|
|
|
4916
6076
|
|
|
4917
6077
|
// src/components/Layouts/Container/MyContainer.tsx
|
|
4918
6078
|
import { Container, Flex as Flex4 } from "@mantine/core";
|
|
6079
|
+
function MyContainer(_a) {
|
|
6080
|
+
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
6081
|
+
return /* @__PURE__ */ React.createElement(Container, __spreadValues({ fluid: true }, rest), /* @__PURE__ */ React.createElement(Flex4, { direction: "column" }, children));
|
|
6082
|
+
}
|
|
4919
6083
|
|
|
4920
6084
|
// src/constants/object/color.ts
|
|
4921
6085
|
var OBJECT_COlORS = {
|
|
@@ -5023,39 +6187,188 @@ function HeaderMegaMenu({ children, menus }) {
|
|
|
5023
6187
|
// src/components/Layouts/HtmlWrapper/MyHtmlWrapper.tsx
|
|
5024
6188
|
import { ScrollArea as ScrollArea4, TypographyStylesProvider } from "@mantine/core";
|
|
5025
6189
|
import pako from "pako";
|
|
6190
|
+
function MyHtmlWrapper(_a) {
|
|
6191
|
+
var _b = _a, { html, mah, zip = false } = _b, rest = __objRest(_b, ["html", "mah", "zip"]);
|
|
6192
|
+
const extractHtmlFromZip = () => {
|
|
6193
|
+
const binaryString = Buffer.from(html, "base64");
|
|
6194
|
+
const decompressedData = pako.inflate(binaryString, { to: "string" });
|
|
6195
|
+
const cleanedHtml = decompressedData == null ? void 0 : decompressedData.replaceAll(" font-family:'Times New Roman'; font-size:1em;", "");
|
|
6196
|
+
return cleanedHtml.replaceAll(" font-family:'Times New Roman'; font-size:1em;", "");
|
|
6197
|
+
};
|
|
6198
|
+
return /* @__PURE__ */ React.createElement(ScrollArea4.Autosize, { mah }, /* @__PURE__ */ React.createElement(TypographyStylesProvider, __spreadValues({}, rest), /* @__PURE__ */ React.createElement(
|
|
6199
|
+
"div",
|
|
6200
|
+
{
|
|
6201
|
+
dangerouslySetInnerHTML: {
|
|
6202
|
+
__html: zip ? extractHtmlFromZip() : html
|
|
6203
|
+
}
|
|
6204
|
+
}
|
|
6205
|
+
)));
|
|
6206
|
+
}
|
|
5026
6207
|
|
|
5027
6208
|
// src/components/Layouts/PageContent/MyPageContent.tsx
|
|
5028
6209
|
import { Code, Container as Container3, Divider as Divider4, Group as Group13, Indicator, Title } from "@mantine/core";
|
|
6210
|
+
var getStatusColor = (status) => {
|
|
6211
|
+
switch (status) {
|
|
6212
|
+
case "Prototype":
|
|
6213
|
+
return "blue";
|
|
6214
|
+
case "Beta":
|
|
6215
|
+
return "orange";
|
|
6216
|
+
default:
|
|
6217
|
+
return "gray";
|
|
6218
|
+
}
|
|
6219
|
+
};
|
|
6220
|
+
var PageTitle = ({ title, status }) => {
|
|
6221
|
+
const color = getStatusColor(status);
|
|
6222
|
+
return /* @__PURE__ */ React.createElement(Indicator, { label: status, size: 16, inline: true, color, disabled: !status, pt: 6 }, /* @__PURE__ */ React.createElement(Title, null, title));
|
|
6223
|
+
};
|
|
6224
|
+
function MyPageContent({ leftTopBar, title, canBack = false, rightTopBar, status, children }) {
|
|
6225
|
+
const SidebarStore = useS0Sidebar();
|
|
6226
|
+
const finalTitle = title || SidebarStore.title;
|
|
6227
|
+
return /* @__PURE__ */ React.createElement(Container3, { p: 0, fluid: true }, /* @__PURE__ */ React.createElement(Group13, { justify: "space-between" }, /* @__PURE__ */ React.createElement(Group13, null, canBack && /* @__PURE__ */ React.createElement(MyButtonRouterBack, null), /* @__PURE__ */ React.createElement(PageTitle, { title: finalTitle, status }), leftTopBar), /* @__PURE__ */ React.createElement(Group13, null, rightTopBar, /* @__PURE__ */ React.createElement(Code, { color: "var(--mantine-color-blue-light)" }, SidebarStore.menuCode))), /* @__PURE__ */ React.createElement(Divider4, null), children);
|
|
6228
|
+
}
|
|
5029
6229
|
|
|
5030
6230
|
// src/components/Layouts/Tab/MyTab.tsx
|
|
5031
6231
|
import { rem, Space as Space3, Tabs } from "@mantine/core";
|
|
5032
6232
|
import React3 from "react";
|
|
6233
|
+
function MyTab(_a) {
|
|
6234
|
+
var _b = _a, { tabList, children } = _b, rest = __objRest(_b, ["tabList", "children"]);
|
|
6235
|
+
const iconStyle = { width: rem(20), height: rem(20) };
|
|
6236
|
+
return /* @__PURE__ */ React3.createElement(Tabs, __spreadValues({ defaultValue: tabList[0].label }, rest), /* @__PURE__ */ React3.createElement(Tabs.List, null, tabList.map((item, idx) => {
|
|
6237
|
+
return /* @__PURE__ */ React3.createElement(Tabs.Tab, { key: idx, value: item.label, leftSection: item.icon && /* @__PURE__ */ React3.createElement(item.icon, { style: iconStyle }) }, item.label);
|
|
6238
|
+
})), /* @__PURE__ */ React3.createElement(Space3, { my: "md" }), children);
|
|
6239
|
+
}
|
|
5033
6240
|
|
|
5034
6241
|
// src/components/RESTAPIComponents/DataTableSelect/MyDataTableSelect.tsx
|
|
5035
6242
|
import { ActionIcon as ActionIcon11, Button as Button15, Fieldset as Fieldset5, Group as Group14, Modal as Modal11 } from "@mantine/core";
|
|
5036
6243
|
import { useDisclosure as useDisclosure11 } from "@mantine/hooks";
|
|
5037
6244
|
import { IconX as IconX2 } from "@tabler/icons-react";
|
|
6245
|
+
function MyDataTableSelect(_a) {
|
|
6246
|
+
var _b = _a, { modalSize, renderTopToolbarCustomActions, data, selectButtonlabel, listState, columns, listLabel } = _b, rest = __objRest(_b, ["modalSize", "renderTopToolbarCustomActions", "data", "selectButtonlabel", "listState", "columns", "listLabel"]);
|
|
6247
|
+
const disc = useDisclosure11(false);
|
|
6248
|
+
if (data == void 0) return "\u0110ang t\u1EA3i...";
|
|
6249
|
+
return /* @__PURE__ */ React.createElement(Fieldset5, { legend: listLabel ? listLabel : "Danh s\xE1ch" }, /* @__PURE__ */ React.createElement(
|
|
6250
|
+
MyDataTable,
|
|
6251
|
+
__spreadValues({
|
|
6252
|
+
renderTopToolbarCustomActions: ({ table }) => {
|
|
6253
|
+
return /* @__PURE__ */ React.createElement(Group14, null, renderTopToolbarCustomActions && renderTopToolbarCustomActions({ table }), /* @__PURE__ */ React.createElement(Button15, { onClick: disc[1].open }, selectButtonlabel || "Ch\u1ECDn t\u1EEB danh s\xE1ch"));
|
|
6254
|
+
},
|
|
6255
|
+
columns,
|
|
6256
|
+
data: listState[0],
|
|
6257
|
+
renderRowActions: ({ row }) => {
|
|
6258
|
+
return /* @__PURE__ */ React.createElement(MyCenterFull, null, /* @__PURE__ */ React.createElement(ActionIcon11, { color: "red", onClick: () => listState[1].remove(row.index) }, /* @__PURE__ */ React.createElement(IconX2, null)));
|
|
6259
|
+
}
|
|
6260
|
+
}, rest)
|
|
6261
|
+
), /* @__PURE__ */ React.createElement(Modal11, { opened: disc[0], onClose: disc[1].close, size: modalSize || "80%" }, /* @__PURE__ */ React.createElement(
|
|
6262
|
+
MyDataTable,
|
|
6263
|
+
__spreadValues({
|
|
6264
|
+
renderTopToolbarCustomActions: ({ table }) => {
|
|
6265
|
+
return /* @__PURE__ */ React.createElement(Button15, { onClick: () => {
|
|
6266
|
+
table.getSelectedRowModel().rows.map((item) => listState[1].append(item.original));
|
|
6267
|
+
disc[1].close();
|
|
6268
|
+
} }, "Ch\u1ECDn");
|
|
6269
|
+
},
|
|
6270
|
+
enableRowSelection: true,
|
|
6271
|
+
data,
|
|
6272
|
+
columns
|
|
6273
|
+
}, rest)
|
|
6274
|
+
)));
|
|
6275
|
+
}
|
|
5038
6276
|
|
|
5039
6277
|
// src/components/RESTAPIComponents/SelectAPIGet/MySelectAPIGet.tsx
|
|
5040
6278
|
import { Select as Select4 } from "@mantine/core";
|
|
5041
6279
|
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
|
6280
|
+
function MySelectAPIGet(_a) {
|
|
6281
|
+
var _b = _a, { apiGet, label = "", dataMapper } = _b, rest = __objRest(_b, ["apiGet", "label", "dataMapper"]);
|
|
6282
|
+
var _a2;
|
|
6283
|
+
const query = useQuery2({
|
|
6284
|
+
queryKey: [apiGet],
|
|
6285
|
+
queryFn: async () => {
|
|
6286
|
+
return (await baseAxios_default.get(apiGet)).data;
|
|
6287
|
+
}
|
|
6288
|
+
});
|
|
6289
|
+
if (query.isLoading) return "Loading...";
|
|
6290
|
+
const data = (_a2 = query.data) == null ? void 0 : _a2.map((item) => {
|
|
6291
|
+
var _a3;
|
|
6292
|
+
if (dataMapper) return dataMapper(item);
|
|
6293
|
+
return {
|
|
6294
|
+
value: (_a3 = item.id) == null ? void 0 : _a3.toString(),
|
|
6295
|
+
label: `${item.code}-${item.name}`
|
|
6296
|
+
};
|
|
6297
|
+
});
|
|
6298
|
+
return /* @__PURE__ */ React.createElement(
|
|
6299
|
+
Select4,
|
|
6300
|
+
__spreadValues({
|
|
6301
|
+
label,
|
|
6302
|
+
placeholder: `Ch\u1ECDn ${label == null ? void 0 : label.toLowerCase()}`,
|
|
6303
|
+
data
|
|
6304
|
+
}, rest)
|
|
6305
|
+
);
|
|
6306
|
+
}
|
|
5042
6307
|
|
|
5043
6308
|
// src/components/Skeletons/SkeletonTable/MySkeletonTable.tsx
|
|
5044
6309
|
import { Skeleton } from "@mantine/core";
|
|
6310
|
+
function MySkeletonTable({ h: h4 = 500 }) {
|
|
6311
|
+
return /* @__PURE__ */ React.createElement(Skeleton, { h: h4 });
|
|
6312
|
+
}
|
|
5045
6313
|
export {
|
|
6314
|
+
AQButtonCreateByImportFile,
|
|
6315
|
+
AQButtonExportData,
|
|
6316
|
+
AQCard,
|
|
6317
|
+
AQSelectTableByOpenModal,
|
|
6318
|
+
AQStatCard1,
|
|
5046
6319
|
BasicAppShell,
|
|
5047
6320
|
BasicAppShell_transformMenuToEnum,
|
|
5048
6321
|
Boxes,
|
|
5049
6322
|
HeaderMegaMenu,
|
|
5050
6323
|
MyActionIcon,
|
|
6324
|
+
MyActionIconCheck,
|
|
6325
|
+
MyActionIconDelete,
|
|
6326
|
+
MyActionIconDownloadPDF,
|
|
5051
6327
|
MyActionIconModal,
|
|
6328
|
+
MyActionIconUpdate,
|
|
6329
|
+
MyActionIconUpload,
|
|
6330
|
+
MyActionIconViewPDF,
|
|
6331
|
+
MyAnchorViewPDF,
|
|
5052
6332
|
MyAppSpotlight,
|
|
6333
|
+
MyBoxesBackground,
|
|
5053
6334
|
MyBoxesCore,
|
|
5054
6335
|
MyButton,
|
|
6336
|
+
MyButtonCreate,
|
|
6337
|
+
MyButtonImport,
|
|
5055
6338
|
MyButtonModal,
|
|
6339
|
+
MyButtonRouterBack,
|
|
6340
|
+
MyButtonViewPDF,
|
|
6341
|
+
MyCalendar,
|
|
6342
|
+
MyCardioLoader,
|
|
6343
|
+
MyCenterFull,
|
|
6344
|
+
MyCheckbox,
|
|
6345
|
+
MyContainer,
|
|
5056
6346
|
MyDataTable,
|
|
6347
|
+
MyDataTableSelect,
|
|
6348
|
+
MyDateInput,
|
|
6349
|
+
MyFieldset,
|
|
6350
|
+
MyFileInput,
|
|
6351
|
+
MyFlexColumn,
|
|
6352
|
+
MyFlexEnd,
|
|
6353
|
+
MyFlexRow,
|
|
6354
|
+
MyHtmlWrapper,
|
|
6355
|
+
MyKeyLabel,
|
|
6356
|
+
MyNumberFormatter,
|
|
6357
|
+
MyNumberInput,
|
|
6358
|
+
MyPageContent,
|
|
6359
|
+
MySelect,
|
|
6360
|
+
MySelectAPIGet,
|
|
6361
|
+
MySkeletonTable,
|
|
5057
6362
|
MySwitchTheme,
|
|
6363
|
+
MyTab,
|
|
6364
|
+
MyTextArea,
|
|
6365
|
+
MyTextEditor,
|
|
6366
|
+
MyTextInput,
|
|
6367
|
+
SelectFieldModal,
|
|
6368
|
+
SelectFileModal,
|
|
5058
6369
|
SpotlightTrigger,
|
|
5059
6370
|
groupToTwoLevels,
|
|
6371
|
+
useHeaderMegaMenuStore,
|
|
6372
|
+
useS_ButtonImport,
|
|
5060
6373
|
utils_layout_getItemsWithoutLinks
|
|
5061
6374
|
};
|