aq-fe-framework 0.1.156 → 0.1.157

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.
Files changed (242) hide show
  1. package/dist/{chunk-JLT4BL7I.mjs → chunk-ZO7PLULO.mjs} +4 -4
  2. package/dist/{css.module-4ICLUKPO.module.css → components/index.css} +16 -29
  3. package/dist/components/index.mjs +2 -2
  4. package/dist/modules-features/index.css +100 -0
  5. package/dist/modules-features/index.mjs +5 -5
  6. package/package.json +1 -1
  7. package/dist/api/apiFactory.ts +0 -46
  8. package/dist/api/baseAxios.ts +0 -22
  9. package/dist/app/admin/(core)/core12196/page.tsx +0 -13
  10. package/dist/app/admin/(core)/core16209/page.tsx +0 -13
  11. package/dist/app/admin/(core)/core18256/page.tsx +0 -12
  12. package/dist/app/admin/(core)/core26965/page.tsx +0 -13
  13. package/dist/app/admin/(core)/core27311/page.tsx +0 -13
  14. package/dist/app/admin/(core)/core38677/page.tsx +0 -13
  15. package/dist/app/admin/(core)/core40207/page.tsx +0 -13
  16. package/dist/app/admin/(core)/core60524/page.tsx +0 -11
  17. package/dist/app/admin/(core)/core64229/page.tsx +0 -12
  18. package/dist/app/admin/(core)/core71678/page.tsx +0 -11
  19. package/dist/app/admin/(core)/core76318/page.tsx +0 -13
  20. package/dist/app/admin/(core)/core83092/page.tsx +0 -13
  21. package/dist/app/admin/[...slug]/page.tsx +0 -7
  22. package/dist/app/admin/error.tsx +0 -42
  23. package/dist/app/admin/layout.tsx +0 -21
  24. package/dist/app/admin/test/page.tsx +0 -44
  25. package/dist/app/auth/login/page.tsx +0 -14
  26. package/dist/app/globals.css +0 -59
  27. package/dist/app/layout.tsx +0 -39
  28. package/dist/app/page.tsx +0 -18
  29. package/dist/components/Aceternity/BoxesBackground/MyBoxes.tsx +0 -66
  30. package/dist/components/Aceternity/BoxesBackground/MyBoxesBackground.tsx +0 -31
  31. package/dist/components/ActionIcons/ActionIcon/MyActionIcon.tsx +0 -47
  32. package/dist/components/ActionIcons/ActionIconCRUD/MyActionIconDelete.tsx +0 -81
  33. package/dist/components/ActionIcons/ActionIconCRUD/MyActionIconUpdate.tsx +0 -68
  34. package/dist/components/ActionIcons/ActionIconCheck/MyActionIconCheck.tsx +0 -50
  35. package/dist/components/ActionIcons/ActionIconDownloadPDF/MyActionIconDownloadPDF.tsx +0 -13
  36. package/dist/components/ActionIcons/ActionIconModal/MyActionIconModal.tsx +0 -113
  37. package/dist/components/ActionIcons/ActionIconUpload/MyActionIconUpload.tsx +0 -19
  38. package/dist/components/ActionIcons/ActionIconViewPdf/MyActionIconViewPDF.tsx +0 -63
  39. package/dist/components/ActionIcons/SwitchTheme/MySwitchTheme.tsx +0 -36
  40. package/dist/components/AppSpotlight/MyAppSpotlight.tsx +0 -112
  41. package/dist/components/Buttons/Anchor/MyAnchorViewPDF.tsx +0 -46
  42. package/dist/components/Buttons/Button/MyButton.tsx +0 -90
  43. package/dist/components/Buttons/ButtonCRUD/AQButtonCreateByImportFile.tsx +0 -81
  44. package/dist/components/Buttons/ButtonCRUD/AQButtonExportData.tsx +0 -75
  45. package/dist/components/Buttons/ButtonCRUD/MyButtonCreate.tsx +0 -68
  46. package/dist/components/Buttons/ButtonImport/MyButtonImport.tsx +0 -29
  47. package/dist/components/Buttons/ButtonImport/SelectFieldModal.tsx +0 -100
  48. package/dist/components/Buttons/ButtonImport/SelectFileModal.tsx +0 -81
  49. package/dist/components/Buttons/ButtonImport/useS_ButtonImport.ts +0 -196
  50. package/dist/components/Buttons/ButtonModal/AQSelectTableByOpenModal.tsx +0 -71
  51. package/dist/components/Buttons/ButtonModal/MyButtonModal.tsx +0 -117
  52. package/dist/components/Buttons/ButtonPrintPDF/MyButtonPrintPDF.tsx +0 -37
  53. package/dist/components/Buttons/ButtonPrintPDFTable/MyButtonPrintTablePDF.tsx +0 -174
  54. package/dist/components/Buttons/ButtonRouterBack/MyButtonRouterBack.tsx +0 -29
  55. package/dist/components/Buttons/ButtonViewPDF/MyButtonViewPDF.tsx +0 -121
  56. package/dist/components/Calendar/MyCalendar.tsx +0 -118
  57. package/dist/components/CenterFull/MyCenterFull.tsx +0 -10
  58. package/dist/components/Checkbox/MyCheckbox.tsx +0 -9
  59. package/dist/components/Combobox/Select/MySelect.tsx +0 -12
  60. package/dist/components/DataDisplay/Card/AQCard.tsx +0 -49
  61. package/dist/components/DataDisplay/CardInformation/MyCardInformation.tsx +0 -77
  62. package/dist/components/DataDisplay/DataTable/MyDataTable.tsx +0 -184
  63. package/dist/components/DataDisplay/IconText/MyIconText.tsx +0 -17
  64. package/dist/components/DataDisplay/KeyLabel/MyKeyLabel.tsx +0 -15
  65. package/dist/components/DataDisplay/NumberFormatter/MyNumberFormatter.tsx +0 -9
  66. package/dist/components/DataDisplay/StatCard/AQStatCard1.tsx +0 -68
  67. package/dist/components/FaviconSetter/FaviconSetter.tsx +0 -33
  68. package/dist/components/Inputs/DateInput/MyDateInput.tsx +0 -11
  69. package/dist/components/Inputs/Fieldset/MyFieldset.tsx +0 -32
  70. package/dist/components/Inputs/FileInput/MyFileInput.tsx +0 -12
  71. package/dist/components/Inputs/NumberInput/MyNumberInput.tsx +0 -12
  72. package/dist/components/Inputs/TextArea/MyTextArea.tsx +0 -11
  73. package/dist/components/Inputs/TextEditor/MyTextEditor.tsx +0 -191
  74. package/dist/components/Inputs/TextInput/MyTextInput.tsx +0 -30
  75. package/dist/components/Layouts/BasicAppShell/BasicAppShell.tsx +0 -357
  76. package/dist/components/Layouts/BasicAppShell/css.module.css +0 -62
  77. package/dist/components/Layouts/BasicAppShell/useS_BasicAppShell.ts +0 -64
  78. package/dist/components/Layouts/Container/MyContainer.tsx +0 -16
  79. package/dist/components/Layouts/FlexColumn/MyFlexColumn.tsx +0 -14
  80. package/dist/components/Layouts/FlexEnd/MyFlexEnd.tsx +0 -14
  81. package/dist/components/Layouts/FlexRow/MyFlexRow.tsx +0 -14
  82. package/dist/components/Layouts/HeaderMegaMenu/HeaderMegaMenu.tsx +0 -147
  83. package/dist/components/Layouts/HeaderMegaMenu/HeaderMegaMenuStore.ts +0 -19
  84. package/dist/components/Layouts/HeaderMegaMenu/css.module.css +0 -50
  85. package/dist/components/Layouts/HtmlWrapper/MyHtmlWrapper.tsx +0 -29
  86. package/dist/components/Layouts/PageContent/MyPageContent.tsx +0 -67
  87. package/dist/components/Layouts/Tab/MyTab.tsx +0 -33
  88. package/dist/components/Loaders/MyCardioLoader.tsx +0 -12
  89. package/dist/components/RESTAPIComponents/DataTableSelect/MyDataTableSelect.tsx +0 -61
  90. package/dist/components/RESTAPIComponents/SelectAPIGet/MySelectAPIGet.tsx +0 -37
  91. package/dist/components/ScheduleX/MyScheduleX.tsx +0 -58
  92. package/dist/components/Skeletons/SkeletonTable/MySkeletonTable.tsx +0 -9
  93. package/dist/components/index.ts +0 -62
  94. package/dist/constants/array/daysOfWeek.ts +0 -9
  95. package/dist/constants/enum/ENUM_EMAILCONFIG.ts +0 -6
  96. package/dist/constants/enum/global.ts +0 -26
  97. package/dist/constants/object/color.ts +0 -5
  98. package/dist/constants/object/documentTypes.ts +0 -8
  99. package/dist/css.module-P45UW6UZ.module.css +0 -4
  100. package/dist/data/menuData.ts +0 -31
  101. package/dist/hooks/custom-hooks/useC_MutationAction.tsx +0 -36
  102. package/dist/hooks/index.ts +0 -2
  103. package/dist/hooks/query/AQ/useQ_AQ_GetAQModule.ts +0 -14
  104. package/dist/interfaces/EmailConfig.ts +0 -10
  105. package/dist/interfaces/IAQModule.ts +0 -21
  106. package/dist/interfaces/base.ts +0 -9
  107. package/dist/interfaces/global-interface/IAQSSO.ts +0 -15
  108. package/dist/interfaces/global-interface/IAQSyncData.ts +0 -9
  109. package/dist/interfaces/global-interface/IAcademicYear.ts +0 -12
  110. package/dist/interfaces/global-interface/IChangePassWord.ts +0 -8
  111. package/dist/interfaces/global-interface/IComplaintProccess.ts +0 -9
  112. package/dist/interfaces/global-interface/ICreateAccount.ts +0 -24
  113. package/dist/interfaces/global-interface/IDocument.ts +0 -25
  114. package/dist/interfaces/global-interface/IDocumentAttribute.ts +0 -12
  115. package/dist/interfaces/global-interface/IEvent.ts +0 -30
  116. package/dist/interfaces/global-interface/IEventComplaint.ts +0 -20
  117. package/dist/interfaces/global-interface/IEventFillter.ts +0 -14
  118. package/dist/interfaces/global-interface/IFile.ts +0 -8
  119. package/dist/interfaces/global-interface/IImportStudentPaticipation.ts +0 -8
  120. package/dist/interfaces/global-interface/IPagePermission.ts +0 -12
  121. package/dist/interfaces/global-interface/IRolePermission.ts +0 -7
  122. package/dist/interfaces/global-interface/ISRMUserinfo.ts +0 -35
  123. package/dist/interfaces/global-interface/IScientificProfileProjectUser.ts +0 -15
  124. package/dist/interfaces/global-interface/IScientificProfileResearchGroup.ts +0 -15
  125. package/dist/interfaces/global-interface/IScientificProfileResearchGroupUser.ts +0 -14
  126. package/dist/interfaces/global-interface/IScientificProfileResearchProject.ts +0 -21
  127. package/dist/interfaces/global-interface/ISignIn.ts +0 -7
  128. package/dist/interfaces/global-interface/ISystemCatalogAcademicYear.ts +0 -15
  129. package/dist/interfaces/global-interface/ISystemCatalogDomainCategory.ts +0 -11
  130. package/dist/interfaces/global-interface/ISystemCatalogProjectLevelCategory.ts +0 -11
  131. package/dist/interfaces/global-interface/ISystemCatalogProjectTypeCategory.ts +0 -11
  132. package/dist/interfaces/global-interface/ISystemCatalogRoleActivity.ts +0 -11
  133. package/dist/interfaces/global-interface/ISystemCatalogTaskCategory.ts +0 -11
  134. package/dist/interfaces/global-interface/ISystemManagementAcademicHistory.ts +0 -31
  135. package/dist/interfaces/global-interface/ISystemManagementProfessionalWorkHistory.ts +0 -14
  136. package/dist/interfaces/global-interface/ISystemManagementPublishedScientificWork.ts +0 -14
  137. package/dist/interfaces/global-interface/ISystemManagementRoleGroup.ts +0 -12
  138. package/dist/interfaces/global-interface/ISystemManagementRoleGroupMenuPermission.ts +0 -18
  139. package/dist/interfaces/global-interface/ISystemManagementScientificResearchProject.ts +0 -16
  140. package/dist/interfaces/global-interface/ISystemManagementUserMenuPermission.ts +0 -18
  141. package/dist/interfaces/global-interface/IUpdateAccount.ts +0 -15
  142. package/dist/interfaces/global-interface/IUser.ts +0 -21
  143. package/dist/interfaces/global-interface/IUserPermission.ts +0 -7
  144. package/dist/lib/utils.ts +0 -6
  145. package/dist/modules-features/admin/core/MainDashboard/BarChart_CourseStatus.tsx +0 -87
  146. package/dist/modules-features/admin/core/MainDashboard/BarChart_ExamStatus.tsx +0 -65
  147. package/dist/modules-features/admin/core/MainDashboard/BarChart_RevenueByAcademicYear.tsx +0 -82
  148. package/dist/modules-features/admin/core/MainDashboard/BarChart_StudentStatusIn30Days.tsx +0 -67
  149. package/dist/modules-features/admin/core/MainDashboard/HBarChart_CourseDropOutPercentage.tsx +0 -77
  150. package/dist/modules-features/admin/core/MainDashboard/HBarChart_CourseProgressPercentage.tsx +0 -77
  151. package/dist/modules-features/admin/core/MainDashboard/LineChart_RevenueIn12Months.tsx +0 -78
  152. package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByDiscountIn3Months.tsx +0 -69
  153. package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByVoucherIn3Months.tsx +0 -69
  154. package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalStudentIn12Months.tsx +0 -64
  155. package/dist/modules-features/admin/core/MainDashboard/ViewDiscountStat.tsx +0 -311
  156. package/dist/modules-features/admin/core/MainDashboard/ViewVoucherStat.tsx +0 -311
  157. package/dist/modules-features/admin/core/core12196/F_core12196.tsx +0 -20
  158. package/dist/modules-features/admin/core/core12196/F_core12196_Create.tsx +0 -101
  159. package/dist/modules-features/admin/core/core12196/F_core12196_Delete.tsx +0 -19
  160. package/dist/modules-features/admin/core/core12196/F_core12196_Read.tsx +0 -165
  161. package/dist/modules-features/admin/core/core12196/F_core12196_Update.tsx +0 -112
  162. package/dist/modules-features/admin/core/core16209/F_core16209.tsx +0 -108
  163. package/dist/modules-features/admin/core/core16209/F_core16209_Create.tsx +0 -112
  164. package/dist/modules-features/admin/core/core16209/F_core16209_Delete.tsx +0 -17
  165. package/dist/modules-features/admin/core/core16209/F_core16209_Update.tsx +0 -114
  166. package/dist/modules-features/admin/core/core18256/F_core18256.tsx +0 -29
  167. package/dist/modules-features/admin/core/core18256/F_core18256_Create.tsx +0 -34
  168. package/dist/modules-features/admin/core/core18256/F_core18256_Delete.tsx +0 -14
  169. package/dist/modules-features/admin/core/core18256/F_core18256_Read.tsx +0 -59
  170. package/dist/modules-features/admin/core/core18256/F_core18256_Select.tsx +0 -40
  171. package/dist/modules-features/admin/core/core18256/F_core18256_Update.tsx +0 -22
  172. package/dist/modules-features/admin/core/core26965/F_core26965.tsx +0 -17
  173. package/dist/modules-features/admin/core/core26965/F_core26965_Create.tsx +0 -106
  174. package/dist/modules-features/admin/core/core26965/F_core26965_Delete.tsx +0 -19
  175. package/dist/modules-features/admin/core/core26965/F_core26965_Read.tsx +0 -165
  176. package/dist/modules-features/admin/core/core26965/F_core26965_Update.tsx +0 -112
  177. package/dist/modules-features/admin/core/core27311/F_core27311.tsx +0 -21
  178. package/dist/modules-features/admin/core/core27311/F_core27311_Create.tsx +0 -109
  179. package/dist/modules-features/admin/core/core27311/F_core27311_Delete.tsx +0 -19
  180. package/dist/modules-features/admin/core/core27311/F_core27311_Read.tsx +0 -165
  181. package/dist/modules-features/admin/core/core27311/F_core27311_Update.tsx +0 -113
  182. package/dist/modules-features/admin/core/core35923/F_core35923.tsx +0 -46
  183. package/dist/modules-features/admin/core/core38677/F_core38677.tsx +0 -28
  184. package/dist/modules-features/admin/core/core38677/F_core38677_ReadUser.tsx +0 -79
  185. package/dist/modules-features/admin/core/core38677/F_core38677_Save.tsx +0 -52
  186. package/dist/modules-features/admin/core/core38677/F_core38677_ViewMenuPermissions.tsx +0 -264
  187. package/dist/modules-features/admin/core/core40207/F_core40207.tsx +0 -9
  188. package/dist/modules-features/admin/core/core40207/F_core40207_Create.tsx +0 -81
  189. package/dist/modules-features/admin/core/core40207/F_core40207_Delete.tsx +0 -17
  190. package/dist/modules-features/admin/core/core40207/F_core40207_Read.tsx +0 -98
  191. package/dist/modules-features/admin/core/core40207/F_core40207_Update.tsx +0 -83
  192. package/dist/modules-features/admin/core/core47643/F_core47643.tsx +0 -10
  193. package/dist/modules-features/admin/core/core47643/F_core47643_Delete.tsx +0 -13
  194. package/dist/modules-features/admin/core/core47643/F_core47643_Form.tsx +0 -34
  195. package/dist/modules-features/admin/core/core47643/F_core47643_Read.tsx +0 -57
  196. package/dist/modules-features/admin/core/core60524/F_core60524.tsx +0 -13
  197. package/dist/modules-features/admin/core/core60524/F_core60524_Form.tsx +0 -111
  198. package/dist/modules-features/admin/core/core60524/F_core60524_Save.tsx +0 -56
  199. package/dist/modules-features/admin/core/core60524/useS_core60524.ts +0 -16
  200. package/dist/modules-features/admin/core/core64229/F_core64229.tsx +0 -7
  201. package/dist/modules-features/admin/core/core64229/F_core64229_Delete.tsx +0 -21
  202. package/dist/modules-features/admin/core/core64229/F_core64229_Form.tsx +0 -95
  203. package/dist/modules-features/admin/core/core64229/F_core64229_Read.tsx +0 -67
  204. package/dist/modules-features/admin/core/core71678/F_core71678.tsx +0 -8
  205. package/dist/modules-features/admin/core/core71678/F_core71678_ChangePermission.tsx +0 -117
  206. package/dist/modules-features/admin/core/core71678/F_core71678_Create.tsx +0 -61
  207. package/dist/modules-features/admin/core/core71678/F_core71678_Delete.tsx +0 -16
  208. package/dist/modules-features/admin/core/core71678/F_core71678_Read.tsx +0 -92
  209. package/dist/modules-features/admin/core/core71678/F_core71678_Update.tsx +0 -49
  210. package/dist/modules-features/admin/core/core76318/F_core76318.tsx +0 -9
  211. package/dist/modules-features/admin/core/core76318/F_core76318_Create.tsx +0 -89
  212. package/dist/modules-features/admin/core/core76318/F_core76318_Delete.tsx +0 -17
  213. package/dist/modules-features/admin/core/core76318/F_core76318_Read.tsx +0 -104
  214. package/dist/modules-features/admin/core/core76318/F_core76318_Update.tsx +0 -89
  215. package/dist/modules-features/admin/core/core83092/F_core83092.tsx +0 -27
  216. package/dist/modules-features/admin/core/core83092/F_core83092_ReadUser.tsx +0 -85
  217. package/dist/modules-features/admin/core/core83092/F_core83092_Save.tsx +0 -52
  218. package/dist/modules-features/admin/core/core83092/F_core83092_ViewMenuPermissions.tsx +0 -263
  219. package/dist/modules-features/admin/core/core83092/useS_core83092.tsx +0 -70
  220. package/dist/modules-features/authenticate/F_authenticate_Login/F_authenticate_Login.tsx +0 -154
  221. package/dist/modules-features/authenticate/F_authenticate_Login/css.module.css +0 -4
  222. package/dist/modules-features/authenticate/F_authenticate_Logout.tsx +0 -22
  223. package/dist/modules-features/authenticate/F_authenticate_SplashPage.tsx +0 -21
  224. package/dist/modules-features/authenticate/useS_authenticate.ts +0 -23
  225. package/dist/modules-features/index.ts +0 -79
  226. package/dist/providers/MyMantineProvider.tsx +0 -140
  227. package/dist/providers/MyReactQueryProvider.tsx +0 -24
  228. package/dist/providers/Provider.tsx +0 -13
  229. package/dist/providers/mantine.module.css +0 -21
  230. package/dist/stores/CreateGenericStore.ts +0 -23
  231. package/dist/stores/index.ts +0 -1
  232. package/dist/types/types.ts +0 -16
  233. package/dist/utils/index.ts +0 -9
  234. package/dist/utils/utils_converter.ts +0 -39
  235. package/dist/utils/utils_currency.ts +0 -5
  236. package/dist/utils/utils_date.ts +0 -34
  237. package/dist/utils/utils_excel.ts +0 -128
  238. package/dist/utils/utils_file.ts +0 -61
  239. package/dist/utils/utils_notification.ts +0 -46
  240. package/dist/utils/utils_pdf.ts +0 -21
  241. package/dist/utils/utils_time.ts +0 -15
  242. package/dist/utils/utils_validateForm.ts +0 -9
@@ -1,63 +0,0 @@
1
- "use client";
2
- import { ActionIcon, ActionIconProps, Group, Modal, Paper, Text, Tooltip } from "@mantine/core";
3
- import { useDisclosure } from "@mantine/hooks";
4
- import { IconLivePhoto, IconMaximize, IconMinimize } from "@tabler/icons-react";
5
- import { useState } from "react";
6
-
7
- interface IActionIconViewPDF extends ActionIconProps {
8
- modalSize?: string;
9
- pdfLink: string;
10
- }
11
-
12
- export function MyActionIconViewPDF({
13
- modalSize = "80%",
14
- pdfLink = "https://datafiles.chinhphu.vn/cpp/files/vbpq/2021/07/17-bgd.signed.pdf",
15
- ...rest
16
- }: IActionIconViewPDF) {
17
- const disc = useDisclosure(false);
18
- const fullScreen = useState(false);
19
- const hSize = useState("80vh");
20
- return (
21
- <>
22
- <Tooltip label="Xem tài liệu trực tiếp">
23
- <ActionIcon color="cyan" onClick={disc[1].open} {...rest}>
24
- <IconLivePhoto />
25
- </ActionIcon>
26
- </Tooltip>
27
- <Modal
28
- fullScreen={fullScreen[0]}
29
- opened={disc[0]}
30
- onClose={disc[1].close}
31
- size={modalSize}
32
- title={
33
- <Group>
34
- <Text>Xem tài liệu trực tiếp</Text>
35
- {fullScreen[0] ? (
36
- <ActionIcon
37
- onClick={() => {
38
- fullScreen[1](false);
39
- hSize[1]("80vh");
40
- }}
41
- >
42
- <IconMinimize />
43
- </ActionIcon>
44
- ) : (
45
- <ActionIcon
46
- onClick={() => {
47
- fullScreen[1](true);
48
- hSize[1]("90vh");
49
- }}
50
- >
51
- <IconMaximize />
52
- </ActionIcon>
53
- )}
54
- </Group>
55
- }
56
- >
57
- <Paper h={hSize[0]} p={"lg"}>
58
- <iframe src={pdfLink} width={"100%"} height={"100%"} />
59
- </Paper>
60
- </Modal>
61
- </>
62
- );
63
- }
@@ -1,36 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- import { ActionIcon, useComputedColorScheme, useMantineColorScheme } from '@mantine/core';
3
- import { IconMoon, IconSun } from '@tabler/icons-react';
4
-
5
- export function MySwitchTheme() {
6
- const { setColorScheme } = useMantineColorScheme();
7
- const computedColorScheme = useComputedColorScheme('light', {
8
- getInitialValueInEffect: true,
9
- });
10
-
11
- const [mounted, setMounted] = useState(false);
12
-
13
- useEffect(() => {
14
- setMounted(true);
15
- }, []);
16
-
17
- if (!mounted) return null; // hoặc <Skeleton /> nếu bạn muốn placeholder
18
-
19
- return (
20
- <ActionIcon
21
- onClick={() =>
22
- setColorScheme(computedColorScheme === 'light' ? 'dark' : 'light')
23
- }
24
- variant="default"
25
- size="lg"
26
- radius="md"
27
- aria-label="Toggle color scheme"
28
- >
29
- {computedColorScheme === 'dark' ? (
30
- <IconSun width="22px" height="22px" stroke={1.5} />
31
- ) : (
32
- <IconMoon width="22px" height="22px" stroke={1.5} />
33
- )}
34
- </ActionIcon>
35
- );
36
- }
@@ -1,112 +0,0 @@
1
- "use client";
2
-
3
- import { Spotlight, spotlight } from "@mantine/spotlight";
4
- import { IconSearch } from "@tabler/icons-react";
5
- import { usePathname, useRouter } from "next/navigation";
6
- import { useMemo, useState } from "react";
7
- import { I_BasicAppShell_LinkItem } from "../Layouts/BasicAppShell/BasicAppShell";
8
- import { useS_BasicAppShell } from "../Layouts/BasicAppShell/useS_BasicAppShell";
9
-
10
- // Hàm đệ quy để chuyển đổi menu thành các action cho Spotlight
11
- function convertMenuToSpotlightActions(
12
- items: I_BasicAppShell_LinkItem[],
13
- router: any,
14
- parentPath: string = "",
15
- sideBarStore: any,
16
- pathName: string
17
- ): any[] {
18
- let actions: any[] = [];
19
-
20
- items.forEach((item) => {
21
- // Nếu có link, thêm action cho item này
22
- if (item.link) {
23
- actions.push({
24
- id: item.label.toLowerCase().replace(/\s+/g, "-"),
25
- label: item.label,
26
- description: `Chuyển đến ${item.label} (Code: ${item.link})`,
27
- onClick: () => {
28
- sideBarStore.setProperty("title", item.label);
29
- sideBarStore.setProperty("menuCode", item.link);
30
- router.push(
31
- pathName.split("/")[0] + "/" + pathName.split("/")[1] + "/" + item.link
32
- );
33
- spotlight.close();
34
- },
35
- rightSection: item.status
36
- ? item.status === "Prototype"
37
- ? "P"
38
- : item.status === "New"
39
- ? "N"
40
- : item.status === "Menu"
41
- ? "M"
42
- : null
43
- : null,
44
- });
45
- }
46
-
47
- // Nếu có submenu, gọi đệ quy để thêm các action con
48
- if (item.links) {
49
- actions = actions.concat(
50
- convertMenuToSpotlightActions(
51
- item.links,
52
- router,
53
- item.link || "",
54
- sideBarStore,
55
- pathName
56
- )
57
- );
58
- }
59
- });
60
-
61
- return actions;
62
- }
63
-
64
- export function MyAppSpotlight({ menu }: { menu: I_BasicAppShell_LinkItem[] }) {
65
- const [query, setQuery] = useState("");
66
- const router = useRouter();
67
- const pathName = usePathname();
68
- const basicAppShellStore = useS_BasicAppShell(); // Get the sidebar store here
69
-
70
- // Chuyển đổi menu thành các action một lần để tối ưu hiệu suất
71
- const spotlightActions = useMemo(
72
- () => convertMenuToSpotlightActions(menu, router, "", basicAppShellStore, pathName),
73
- [menu, router, basicAppShellStore] // Add sideBarStore to the dependency array
74
- );
75
-
76
- return (
77
- <Spotlight
78
- actions={spotlightActions}
79
- query={query}
80
- scrollable
81
- maxHeight={800}
82
- onQueryChange={setQuery}
83
- shortcut={["mod + K", "/"]} // Hỗ trợ Ctrl/Cmd + K và phím /
84
- nothingFound="Không tìm thấy trang"
85
- highlightQuery
86
- searchProps={{
87
- leftSection: <IconSearch stroke={1.5} />,
88
- placeholder: "Tìm kiếm trang...",
89
- }}
90
- />
91
- );
92
- }
93
-
94
- // Nếu muốn thêm nút mở Spotlight
95
- export function SpotlightTrigger() {
96
- return (
97
- <button
98
- onClick={spotlight.open}
99
- style={{
100
- background: "none",
101
- border: "none",
102
- cursor: "pointer",
103
- display: "flex",
104
- alignItems: "center",
105
- gap: "8px",
106
- }}
107
- >
108
- <IconSearch stroke={1.5} />
109
- Tìm kiếm (Ctrl + K)
110
- </button>
111
- );
112
- }
@@ -1,46 +0,0 @@
1
- import { ActionIcon, Anchor, Group, Modal, Paper, Text } from "@mantine/core";
2
- import { useDisclosure } from "@mantine/hooks";
3
- import { IconMaximize, IconMinimize } from "@tabler/icons-react";
4
- import { useState } from "react";
5
-
6
- export function MyAnchorViewPDF({ label, pdfLink }: { label: string; pdfLink: string }) {
7
- const disc = useDisclosure(false);
8
- const fullScreen = useState(false);
9
- const hSize = useState("80vh");
10
- return (
11
- <>
12
- <Anchor onClick={disc[1].open}>{label}</Anchor>
13
- <Modal
14
- fullScreen={fullScreen[0]}
15
- opened={disc[0]}
16
- onClose={disc[1].close}
17
- size={"80%"}
18
- title={
19
- <Group>
20
- <Text>Xem tài liệu trực tiếp</Text>
21
- {fullScreen[0] ? (
22
- <ActionIcon
23
- onClick={() => {
24
- fullScreen[1](false);
25
- hSize[1]("80vh");
26
- }}>
27
- <IconMinimize />
28
- </ActionIcon>
29
- ) : (
30
- <ActionIcon
31
- onClick={() => {
32
- fullScreen[1](true);
33
- hSize[1]("90vh");
34
- }}>
35
- <IconMaximize />
36
- </ActionIcon>
37
- )}
38
- </Group>
39
- }>
40
- <Paper h={hSize[0]}>
41
- <iframe src={pdfLink} width={"100%"} height={"100%"} />
42
- </Paper>
43
- </Modal>
44
- </>
45
- );
46
- }
@@ -1,90 +0,0 @@
1
- import { TYPES_CRUD } from "@/types/types";
2
- import { Button, ButtonProps } from "@mantine/core";
3
- import { IconDeviceFloppy, IconEdit, IconFileExport, IconFileImport, IconPlus, IconPrinter, IconTrash, IconX } from "@tabler/icons-react";
4
- import { ReactNode } from "react";
5
-
6
- interface IMyButton extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "style">, ButtonProps {
7
- crudType?: TYPES_CRUD
8
- children?: ReactNode;
9
- }
10
-
11
- export function MyButton({ children, crudType = "delete", ...rest }: IMyButton) {
12
- if (crudType == "default") {
13
- return (
14
- <Button color="indigo" {...rest}>
15
- {children}
16
- </Button>
17
- );
18
- }
19
- if (crudType == "create") {
20
- return (
21
- <Button color="indigo" type="submit" leftSection={<IconPlus />} {...rest}>
22
- {children ? children : "Lưu"}
23
- </Button>
24
- );
25
- }
26
- if (crudType == "createMultiple") {
27
- return (
28
- <Button color="green" type="submit" leftSection={<IconPlus />} {...rest}>
29
- {children ? children : "Thêm danh sách"}
30
- </Button>
31
- );
32
- }
33
- if (crudType == "delete") {
34
- return (
35
- <Button color="red" leftSection={<IconTrash />} {...rest}>
36
- {children ? children : "Xác nhận xóa"}
37
- </Button>
38
- );
39
- }
40
- if (crudType == "update") {
41
- return (
42
- <Button color="yellow" type="submit" leftSection={<IconEdit />} {...rest}>
43
- {children ? children : "Chỉnh sửa"}
44
- </Button>
45
- );
46
- }
47
- if (crudType == "save") {
48
- return (
49
- <Button color="blue" type="submit" leftSection={<IconDeviceFloppy />} {...rest}>
50
- {children ? children : "Lưu"}
51
- </Button>
52
- );
53
- }
54
- if (crudType == "import") {
55
- return (
56
- <Button color="green.8" leftSection={<IconFileImport />} {...rest}>
57
- {children ? children : "Import"}
58
- </Button>
59
- );
60
- }
61
- if (crudType == "print") {
62
- return (
63
- <Button color="orange.7" leftSection={<IconPrinter />} {...rest}>
64
- {children ? children : "In"}
65
- </Button>
66
- );
67
- }
68
- if (crudType == "export") {
69
- return (
70
- <Button color="green.8" leftSection={<IconFileExport />} {...rest}>
71
- {children ? children : "Export"}
72
- </Button>
73
- );
74
- }
75
- if (crudType == "cancel") {
76
- return (
77
- <Button color="gray" leftSection={<IconX />} {...rest}>
78
- {children ? children : "Hủy thao tác"}
79
- </Button>
80
- );
81
- }
82
- if (crudType == "select") {
83
- return (
84
- <Button {...rest}>
85
- {children ? children : "Chọn"}
86
- </Button>
87
- );
88
- }
89
-
90
- }
@@ -1,81 +0,0 @@
1
- import { MyButton } from "@/components/Buttons/Button/MyButton"
2
- import { MyFlexColumn } from "@/components/Layouts/FlexColumn/MyFlexColumn"
3
- import { utils_notification_show } from "@/utils/utils_notification"
4
- import { FileInput } from "@mantine/core"
5
- import { useForm } from "@mantine/form"
6
- import { useDisclosure } from "@mantine/hooks"
7
- import { IconFileTypeXls } from "@tabler/icons-react"
8
- import { useMutation, useQueryClient } from "@tanstack/react-query"
9
- import { ComponentProps } from "react"
10
- import * as XLSX from 'xlsx'
11
- import { MyButtonModal } from "../ButtonModal/MyButtonModal"
12
-
13
- interface IMyButtonCreate extends Omit<ComponentProps<typeof MyButtonModal>, "disclosure" | "form"> {
14
- onSubmit: () => void,
15
- onSuccess?: () => void; // Custom callback for success handling
16
- onError?: () => void; // Custom callback for error handling
17
- form: ReturnType<typeof useForm>;
18
- setImportedData?: (data: any) => void;
19
- }
20
-
21
- export function AQButtonCreateByImportFile({ form, onSubmit, onSuccess, onError,
22
- // children,
23
- setImportedData,
24
- ...rest }: IMyButtonCreate) {
25
-
26
- const disc = useDisclosure()
27
- const queryClient = useQueryClient()
28
- const mutation = useMutation({
29
- mutationFn: async () => {
30
- return await onSubmit()
31
- },
32
- onSuccess: () => {
33
- queryClient.invalidateQueries()
34
- utils_notification_show({ crudType: "create" });
35
- disc[1].close();
36
- form.reset()
37
- if (onSuccess) onSuccess();
38
- },
39
- onError: () => {
40
- if (onError) onError();
41
- },
42
- })
43
-
44
-
45
- const handleFileChange = (file: File | null) => {
46
- if (!file) return;
47
- const reader = new FileReader();
48
- reader.onload = (event) => {
49
- const binaryStr = event.target?.result;
50
- if (binaryStr) {
51
- const workbook = XLSX.read(binaryStr, { type: 'binary' });
52
- const sheetName = workbook.SheetNames[0]; // Get the first sheet name
53
- const sheet = workbook.Sheets[sheetName]; // Get the first sheet
54
- const data = XLSX.utils.sheet_to_json(sheet); // Convert sheet to JSON
55
- setImportedData && setImportedData(data); // Save the parsed data to the form
56
- }
57
- };
58
- reader.readAsArrayBuffer(file);
59
- };
60
-
61
- return (
62
- <MyButtonModal disclosure={disc} crudType="createMultiple" {...rest}>
63
- <form onSubmit={form.onSubmit((values) => {
64
-
65
- })}>
66
- <MyFlexColumn>
67
- {/* {children} */}
68
- <FileInput
69
- leftSection={<IconFileTypeXls />}
70
- accept=".xlsx"
71
- description="Định dạng hợp lệ: .xlsx"
72
- label="Chọn file"
73
- onChange={handleFileChange}
74
- clearable={true}
75
- placeholder="Chọn file" />
76
- <MyButton type="submit" crudType="createMultiple" />
77
- </MyFlexColumn>
78
- </form>
79
- </MyButtonModal>
80
- )
81
- }
@@ -1,75 +0,0 @@
1
- import { Button } from "@mantine/core";
2
- import { IconDownload } from "@tabler/icons-react";
3
- import * as XLSX from "xlsx";
4
-
5
- interface FieldConfig {
6
- fieldName: string; // Field name in the data
7
- header: string; // Header name for the export
8
- formatFunction?: (value: any, row: any) => any; // Optional formatting function
9
- }
10
-
11
- interface ExportConfig {
12
- fields: FieldConfig[]; // Array of field configurations
13
- }
14
-
15
- interface AQButtonExportDataProps {
16
- isAllData: boolean
17
- objectName: string;
18
- data: any[];
19
- exportConfig: ExportConfig;
20
- }
21
-
22
- export function AQButtonExportData({
23
- isAllData,
24
- objectName,
25
- data,
26
- exportConfig
27
- }: AQButtonExportDataProps) {
28
- const handleExport = () => {
29
- // Process data with formatting functions
30
- const processedData = data.map((row) => {
31
- const newRow: any = {};
32
- exportConfig.fields.forEach(({ fieldName, formatFunction }) => {
33
- newRow[fieldName] = formatFunction ? formatFunction(row[fieldName], row) : row[fieldName];
34
- });
35
- return newRow;
36
- });
37
-
38
- // Map headers to new labels
39
- const headers: { [key: string]: string } = {};
40
- exportConfig.fields.forEach(({ fieldName, header }) => {
41
- headers[fieldName] = header;
42
- });
43
-
44
- // Create a worksheet
45
- const worksheet = XLSX.utils.json_to_sheet(processedData);
46
-
47
- // Rename headers in the worksheet
48
- const headerRow = exportConfig.fields.map(({ fieldName }) => headers[fieldName]);
49
- XLSX.utils.sheet_add_aoa(worksheet, [headerRow], { origin: "A1" });
50
-
51
- // Export worksheet as an Excel file
52
- const workbook = XLSX.utils.book_new();
53
- XLSX.utils.book_append_sheet(workbook, worksheet, "Exported Data");
54
-
55
- // Trigger the download
56
- XLSX.writeFile(workbook, `${objectName}.xlsx`);
57
- };
58
-
59
- return (
60
- <Button
61
- disabled={data.length === 0}
62
- variant="filled"
63
- color="teal"
64
- onClick={(event) => {
65
- event.preventDefault();
66
- handleExport();
67
- }}
68
- leftSection={<IconDownload />}
69
- >
70
- {/* {isAllData ? "Xuất toàn bộ dữ liệu" : "Xuất dữ liệu được chọn"} */}
71
- {"Export"}
72
- </Button>
73
- );
74
- }
75
-
@@ -1,68 +0,0 @@
1
- import { MyFlexColumn } from "@/components/Layouts/FlexColumn/MyFlexColumn"
2
- import { utils_notification_show } from "@/utils/utils_notification"
3
- import { UseFormReturnType } from "@mantine/form"
4
- import { useDisclosure } from "@mantine/hooks"
5
- import { useMutation, useQueryClient } from "@tanstack/react-query"
6
- import { ComponentProps } from "react"
7
- import { MyButton } from "../Button/MyButton"
8
- import { MyButtonModal } from "../ButtonModal/MyButtonModal"
9
-
10
- interface IMyButtonCreate<T> extends Omit<ComponentProps<typeof MyButtonModal>, "disclosure" | "form" | "onSubmit"> {
11
- onSubmit: (values: T) => void
12
- onSuccess?: () => void;
13
- onError?: () => void;
14
- form: UseFormReturnType<T>;
15
- notCloseModalWhenSubmit?: boolean
16
- notResetFormWhenSubmit?: boolean
17
-
18
- disclosure?: ReturnType<typeof useDisclosure>;
19
- }
20
-
21
- export function MyButtonCreate<T>({
22
- form,
23
- onSubmit,
24
- onSuccess,
25
- onError,
26
- notCloseModalWhenSubmit = false,
27
- notResetFormWhenSubmit = false,
28
- children,
29
- disclosure: externalDisclosure,
30
- ...rest
31
- }: IMyButtonCreate<T>) {
32
- const defaultDisclosure = useDisclosure();
33
- const disclosure = externalDisclosure ?? defaultDisclosure;
34
- const queryClient = useQueryClient();
35
- const mutation = useMutation({
36
- mutationFn: async (values: T) => await onSubmit!(values),
37
- onSuccess: () => {
38
- if (onSuccess) {
39
- onSuccess()
40
- }
41
- queryClient.invalidateQueries();
42
- utils_notification_show({ crudType: "create" });
43
-
44
- if (notCloseModalWhenSubmit == false) {
45
- disclosure[1].close();
46
- }
47
- if (notResetFormWhenSubmit == false) {
48
- form.reset();
49
- }
50
- },
51
- onError: () => {
52
- if (onError) onError();
53
- },
54
- });
55
-
56
- return (
57
- <MyButtonModal disclosure={disclosure} crudType="create" {...rest}>
58
- <form onSubmit={form.onSubmit((values) => {
59
- mutation.mutate(values);
60
- })}>
61
- <MyFlexColumn>
62
- {children}
63
- <MyButton type="submit" crudType="save" />
64
- </MyFlexColumn>
65
- </form>
66
- </MyButtonModal>
67
- );
68
- }
@@ -1,29 +0,0 @@
1
- 'use client'
2
- import { Button, Modal, useModalsStack } from "@mantine/core";
3
- import { IconFileImport } from "@tabler/icons-react";
4
- import { SelectFieldModal } from "./SelectFieldModal";
5
- import { SelectFileModal, SelectFileModalProps } from "./SelectFileModal";
6
- import { useS_ButtonImport } from "./useS_ButtonImport";
7
-
8
- interface MyButtonImportProps extends Omit<SelectFileModalProps, "stack"> {
9
- onImport: (data: any) => void
10
- }
11
-
12
- export function MyButtonImport({
13
- onExportStructure,
14
- onImport
15
- }:
16
- MyButtonImportProps
17
- ) {
18
- const stack = useModalsStack(['select-file-page', 'select-field-page', 'implement-page']);
19
- const store = useS_ButtonImport()
20
- return (
21
- <>
22
- <Button color="teal.8" onClick={() => stack.open('select-file-page')} leftSection={<IconFileImport />} title="Import" >Import</Button>
23
- <Modal.Stack>
24
- <SelectFileModal stack={stack} onExportStructure={onExportStructure} />
25
- <SelectFieldModal stack={stack} onImport={() => onImport(store.getDataFinal())} />
26
- </Modal.Stack>
27
- </>
28
- )
29
- }