aq-fe-framework 0.1.154 → 0.1.156

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 (253) hide show
  1. package/dist/{IAQModule-Cn6xUy-6.d.mts → IAQModule-XZYlbivW.d.mts} +1 -1
  2. package/dist/api/apiFactory.ts +46 -0
  3. package/dist/api/baseAxios.ts +22 -0
  4. package/dist/app/admin/(core)/core12196/page.tsx +13 -0
  5. package/dist/app/admin/(core)/core16209/page.tsx +13 -0
  6. package/dist/app/admin/(core)/core18256/page.tsx +12 -0
  7. package/dist/app/admin/(core)/core26965/page.tsx +13 -0
  8. package/dist/app/admin/(core)/core27311/page.tsx +13 -0
  9. package/dist/app/admin/(core)/core38677/page.tsx +13 -0
  10. package/dist/app/admin/(core)/core40207/page.tsx +13 -0
  11. package/dist/app/admin/(core)/core60524/page.tsx +11 -0
  12. package/dist/app/admin/(core)/core64229/page.tsx +12 -0
  13. package/dist/app/admin/(core)/core71678/page.tsx +11 -0
  14. package/dist/app/admin/(core)/core76318/page.tsx +13 -0
  15. package/dist/app/admin/(core)/core83092/page.tsx +13 -0
  16. package/dist/app/admin/[...slug]/page.tsx +7 -0
  17. package/dist/app/admin/error.tsx +42 -0
  18. package/dist/app/admin/layout.tsx +21 -0
  19. package/dist/app/admin/test/page.tsx +44 -0
  20. package/dist/app/auth/login/page.tsx +14 -0
  21. package/dist/app/globals.css +59 -0
  22. package/dist/app/layout.tsx +39 -0
  23. package/dist/app/page.tsx +18 -0
  24. package/dist/chunk-5U2JSHSJ.mjs +22 -0
  25. package/dist/chunk-7ZCOFATU.mjs +42 -0
  26. package/dist/chunk-FWCSY2DS.mjs +37 -0
  27. package/dist/chunk-JLT4BL7I.mjs +7634 -0
  28. package/dist/chunk-KWCUUD5Z.mjs +235 -0
  29. package/dist/chunk-Y3YGC5IH.mjs +21 -0
  30. package/dist/chunk-Z6OQG54Q.mjs +39 -0
  31. package/dist/components/Aceternity/BoxesBackground/MyBoxes.tsx +66 -0
  32. package/dist/components/Aceternity/BoxesBackground/MyBoxesBackground.tsx +31 -0
  33. package/dist/components/ActionIcons/ActionIcon/MyActionIcon.tsx +47 -0
  34. package/dist/components/ActionIcons/ActionIconCRUD/MyActionIconDelete.tsx +81 -0
  35. package/dist/components/ActionIcons/ActionIconCRUD/MyActionIconUpdate.tsx +68 -0
  36. package/dist/components/ActionIcons/ActionIconCheck/MyActionIconCheck.tsx +50 -0
  37. package/dist/components/ActionIcons/ActionIconDownloadPDF/MyActionIconDownloadPDF.tsx +13 -0
  38. package/dist/components/ActionIcons/ActionIconModal/MyActionIconModal.tsx +113 -0
  39. package/dist/components/ActionIcons/ActionIconUpload/MyActionIconUpload.tsx +19 -0
  40. package/dist/components/ActionIcons/ActionIconViewPdf/MyActionIconViewPDF.tsx +63 -0
  41. package/dist/components/ActionIcons/SwitchTheme/MySwitchTheme.tsx +36 -0
  42. package/dist/components/AppSpotlight/MyAppSpotlight.tsx +112 -0
  43. package/dist/components/Buttons/Anchor/MyAnchorViewPDF.tsx +46 -0
  44. package/dist/components/Buttons/Button/MyButton.tsx +90 -0
  45. package/dist/components/Buttons/ButtonCRUD/AQButtonCreateByImportFile.tsx +81 -0
  46. package/dist/components/Buttons/ButtonCRUD/AQButtonExportData.tsx +75 -0
  47. package/dist/components/Buttons/ButtonCRUD/MyButtonCreate.tsx +68 -0
  48. package/dist/components/Buttons/ButtonImport/MyButtonImport.tsx +29 -0
  49. package/dist/components/Buttons/ButtonImport/SelectFieldModal.tsx +100 -0
  50. package/dist/components/Buttons/ButtonImport/SelectFileModal.tsx +81 -0
  51. package/dist/components/Buttons/ButtonImport/useS_ButtonImport.ts +196 -0
  52. package/dist/components/Buttons/ButtonModal/AQSelectTableByOpenModal.tsx +71 -0
  53. package/dist/components/Buttons/ButtonModal/MyButtonModal.tsx +117 -0
  54. package/dist/components/Buttons/ButtonPrintPDF/MyButtonPrintPDF.tsx +37 -0
  55. package/dist/components/Buttons/ButtonPrintPDFTable/MyButtonPrintTablePDF.tsx +174 -0
  56. package/dist/components/Buttons/ButtonRouterBack/MyButtonRouterBack.tsx +29 -0
  57. package/dist/components/Buttons/ButtonViewPDF/MyButtonViewPDF.tsx +121 -0
  58. package/dist/components/Calendar/MyCalendar.tsx +118 -0
  59. package/dist/components/CenterFull/MyCenterFull.tsx +10 -0
  60. package/dist/components/Checkbox/MyCheckbox.tsx +9 -0
  61. package/dist/components/Combobox/Select/MySelect.tsx +12 -0
  62. package/dist/components/DataDisplay/Card/AQCard.tsx +49 -0
  63. package/dist/components/DataDisplay/CardInformation/MyCardInformation.tsx +77 -0
  64. package/dist/components/DataDisplay/DataTable/MyDataTable.tsx +184 -0
  65. package/dist/components/DataDisplay/IconText/MyIconText.tsx +17 -0
  66. package/dist/components/DataDisplay/KeyLabel/MyKeyLabel.tsx +15 -0
  67. package/dist/components/DataDisplay/NumberFormatter/MyNumberFormatter.tsx +9 -0
  68. package/dist/components/DataDisplay/StatCard/AQStatCard1.tsx +68 -0
  69. package/dist/components/FaviconSetter/FaviconSetter.tsx +33 -0
  70. package/dist/components/Inputs/DateInput/MyDateInput.tsx +11 -0
  71. package/dist/components/Inputs/Fieldset/MyFieldset.tsx +32 -0
  72. package/dist/components/Inputs/FileInput/MyFileInput.tsx +12 -0
  73. package/dist/components/Inputs/NumberInput/MyNumberInput.tsx +12 -0
  74. package/dist/components/Inputs/TextArea/MyTextArea.tsx +11 -0
  75. package/dist/components/Inputs/TextEditor/MyTextEditor.tsx +191 -0
  76. package/dist/components/Inputs/TextInput/MyTextInput.tsx +30 -0
  77. package/dist/components/Layouts/BasicAppShell/BasicAppShell.tsx +357 -0
  78. package/dist/components/Layouts/BasicAppShell/css.module.css +62 -0
  79. package/dist/components/Layouts/BasicAppShell/useS_BasicAppShell.ts +64 -0
  80. package/dist/components/Layouts/Container/MyContainer.tsx +16 -0
  81. package/dist/components/Layouts/FlexColumn/MyFlexColumn.tsx +14 -0
  82. package/dist/components/Layouts/FlexEnd/MyFlexEnd.tsx +14 -0
  83. package/dist/components/Layouts/FlexRow/MyFlexRow.tsx +14 -0
  84. package/dist/components/Layouts/HeaderMegaMenu/HeaderMegaMenu.tsx +147 -0
  85. package/dist/components/Layouts/HeaderMegaMenu/HeaderMegaMenuStore.ts +19 -0
  86. package/dist/components/Layouts/HeaderMegaMenu/css.module.css +50 -0
  87. package/dist/components/Layouts/HtmlWrapper/MyHtmlWrapper.tsx +29 -0
  88. package/dist/components/Layouts/PageContent/MyPageContent.tsx +67 -0
  89. package/dist/components/Layouts/Tab/MyTab.tsx +33 -0
  90. package/dist/components/Loaders/MyCardioLoader.tsx +12 -0
  91. package/dist/components/RESTAPIComponents/DataTableSelect/MyDataTableSelect.tsx +61 -0
  92. package/dist/components/RESTAPIComponents/SelectAPIGet/MySelectAPIGet.tsx +37 -0
  93. package/dist/components/ScheduleX/MyScheduleX.tsx +58 -0
  94. package/dist/components/Skeletons/SkeletonTable/MySkeletonTable.tsx +9 -0
  95. package/dist/components/index.mjs +143 -62
  96. package/dist/components/index.ts +62 -0
  97. package/dist/constants/array/daysOfWeek.ts +9 -0
  98. package/dist/constants/enum/ENUM_EMAILCONFIG.ts +6 -0
  99. package/dist/constants/enum/global.ts +26 -0
  100. package/dist/constants/object/color.ts +5 -0
  101. package/dist/constants/object/documentTypes.ts +8 -0
  102. package/dist/css.module-4ICLUKPO.module.css +107 -0
  103. package/dist/css.module-P45UW6UZ.module.css +4 -0
  104. package/dist/data/menuData.ts +31 -0
  105. package/dist/hooks/custom-hooks/useC_MutationAction.tsx +36 -0
  106. package/dist/hooks/index.d.mts +1 -1
  107. package/dist/hooks/index.mjs +11 -2
  108. package/dist/hooks/index.ts +2 -0
  109. package/dist/hooks/query/AQ/useQ_AQ_GetAQModule.ts +14 -0
  110. package/dist/interfaces/EmailConfig.ts +10 -0
  111. package/dist/interfaces/IAQModule.ts +21 -0
  112. package/dist/interfaces/base.ts +9 -0
  113. package/dist/interfaces/global-interface/IAQSSO.ts +15 -0
  114. package/dist/interfaces/global-interface/IAQSyncData.ts +9 -0
  115. package/dist/interfaces/global-interface/IAcademicYear.ts +12 -0
  116. package/dist/interfaces/global-interface/IChangePassWord.ts +8 -0
  117. package/dist/interfaces/global-interface/IComplaintProccess.ts +9 -0
  118. package/dist/interfaces/global-interface/ICreateAccount.ts +24 -0
  119. package/dist/interfaces/global-interface/IDocument.ts +25 -0
  120. package/dist/interfaces/global-interface/IDocumentAttribute.ts +12 -0
  121. package/dist/interfaces/global-interface/IEvent.ts +30 -0
  122. package/dist/interfaces/global-interface/IEventComplaint.ts +20 -0
  123. package/dist/interfaces/global-interface/IEventFillter.ts +14 -0
  124. package/dist/interfaces/global-interface/IFile.ts +8 -0
  125. package/dist/interfaces/global-interface/IImportStudentPaticipation.ts +8 -0
  126. package/dist/interfaces/global-interface/IPagePermission.ts +12 -0
  127. package/dist/interfaces/global-interface/IRolePermission.ts +7 -0
  128. package/dist/interfaces/global-interface/ISRMUserinfo.ts +35 -0
  129. package/dist/interfaces/global-interface/IScientificProfileProjectUser.ts +15 -0
  130. package/dist/interfaces/global-interface/IScientificProfileResearchGroup.ts +15 -0
  131. package/dist/interfaces/global-interface/IScientificProfileResearchGroupUser.ts +14 -0
  132. package/dist/interfaces/global-interface/IScientificProfileResearchProject.ts +21 -0
  133. package/dist/interfaces/global-interface/ISignIn.ts +7 -0
  134. package/dist/interfaces/global-interface/ISystemCatalogAcademicYear.ts +15 -0
  135. package/dist/interfaces/global-interface/ISystemCatalogDomainCategory.ts +11 -0
  136. package/dist/interfaces/global-interface/ISystemCatalogProjectLevelCategory.ts +11 -0
  137. package/dist/interfaces/global-interface/ISystemCatalogProjectTypeCategory.ts +11 -0
  138. package/dist/interfaces/global-interface/ISystemCatalogRoleActivity.ts +11 -0
  139. package/dist/interfaces/global-interface/ISystemCatalogTaskCategory.ts +11 -0
  140. package/dist/interfaces/global-interface/ISystemManagementAcademicHistory.ts +31 -0
  141. package/dist/interfaces/global-interface/ISystemManagementProfessionalWorkHistory.ts +14 -0
  142. package/dist/interfaces/global-interface/ISystemManagementPublishedScientificWork.ts +14 -0
  143. package/dist/interfaces/global-interface/ISystemManagementRoleGroup.ts +12 -0
  144. package/dist/interfaces/global-interface/ISystemManagementRoleGroupMenuPermission.ts +18 -0
  145. package/dist/interfaces/global-interface/ISystemManagementScientificResearchProject.ts +16 -0
  146. package/dist/interfaces/global-interface/ISystemManagementUserMenuPermission.ts +18 -0
  147. package/dist/interfaces/global-interface/IUpdateAccount.ts +15 -0
  148. package/dist/interfaces/global-interface/IUser.ts +21 -0
  149. package/dist/interfaces/global-interface/IUserPermission.ts +7 -0
  150. package/dist/lib/utils.ts +6 -0
  151. package/dist/modules-features/admin/core/MainDashboard/BarChart_CourseStatus.tsx +87 -0
  152. package/dist/modules-features/admin/core/MainDashboard/BarChart_ExamStatus.tsx +65 -0
  153. package/dist/modules-features/admin/core/MainDashboard/BarChart_RevenueByAcademicYear.tsx +82 -0
  154. package/dist/modules-features/admin/core/MainDashboard/BarChart_StudentStatusIn30Days.tsx +67 -0
  155. package/dist/modules-features/admin/core/MainDashboard/HBarChart_CourseDropOutPercentage.tsx +77 -0
  156. package/dist/modules-features/admin/core/MainDashboard/HBarChart_CourseProgressPercentage.tsx +77 -0
  157. package/dist/modules-features/admin/core/MainDashboard/LineChart_RevenueIn12Months.tsx +78 -0
  158. package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByDiscountIn3Months.tsx +69 -0
  159. package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByVoucherIn3Months.tsx +69 -0
  160. package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalStudentIn12Months.tsx +64 -0
  161. package/dist/modules-features/admin/core/MainDashboard/ViewDiscountStat.tsx +311 -0
  162. package/dist/modules-features/admin/core/MainDashboard/ViewVoucherStat.tsx +311 -0
  163. package/dist/modules-features/admin/core/core12196/F_core12196.tsx +20 -0
  164. package/dist/modules-features/admin/core/core12196/F_core12196_Create.tsx +101 -0
  165. package/dist/modules-features/admin/core/core12196/F_core12196_Delete.tsx +19 -0
  166. package/dist/modules-features/admin/core/core12196/F_core12196_Read.tsx +165 -0
  167. package/dist/modules-features/admin/core/core12196/F_core12196_Update.tsx +112 -0
  168. package/dist/modules-features/admin/core/core16209/F_core16209.tsx +108 -0
  169. package/dist/modules-features/admin/core/core16209/F_core16209_Create.tsx +112 -0
  170. package/dist/modules-features/admin/core/core16209/F_core16209_Delete.tsx +17 -0
  171. package/dist/modules-features/admin/core/core16209/F_core16209_Update.tsx +114 -0
  172. package/dist/modules-features/admin/core/core18256/F_core18256.tsx +29 -0
  173. package/dist/modules-features/admin/core/core18256/F_core18256_Create.tsx +34 -0
  174. package/dist/modules-features/admin/core/core18256/F_core18256_Delete.tsx +14 -0
  175. package/dist/modules-features/admin/core/core18256/F_core18256_Read.tsx +59 -0
  176. package/dist/modules-features/admin/core/core18256/F_core18256_Select.tsx +40 -0
  177. package/dist/modules-features/admin/core/core18256/F_core18256_Update.tsx +22 -0
  178. package/dist/modules-features/admin/core/core26965/F_core26965.tsx +17 -0
  179. package/dist/modules-features/admin/core/core26965/F_core26965_Create.tsx +106 -0
  180. package/dist/modules-features/admin/core/core26965/F_core26965_Delete.tsx +19 -0
  181. package/dist/modules-features/admin/core/core26965/F_core26965_Read.tsx +165 -0
  182. package/dist/modules-features/admin/core/core26965/F_core26965_Update.tsx +112 -0
  183. package/dist/modules-features/admin/core/core27311/F_core27311.tsx +21 -0
  184. package/dist/modules-features/admin/core/core27311/F_core27311_Create.tsx +109 -0
  185. package/dist/modules-features/admin/core/core27311/F_core27311_Delete.tsx +19 -0
  186. package/dist/modules-features/admin/core/core27311/F_core27311_Read.tsx +165 -0
  187. package/dist/modules-features/admin/core/core27311/F_core27311_Update.tsx +113 -0
  188. package/dist/modules-features/admin/core/core35923/F_core35923.tsx +46 -0
  189. package/dist/modules-features/admin/core/core38677/F_core38677.tsx +28 -0
  190. package/dist/modules-features/admin/core/core38677/F_core38677_ReadUser.tsx +79 -0
  191. package/dist/modules-features/admin/core/core38677/F_core38677_Save.tsx +52 -0
  192. package/dist/modules-features/admin/core/core38677/F_core38677_ViewMenuPermissions.tsx +264 -0
  193. package/dist/modules-features/admin/core/core40207/F_core40207.tsx +9 -0
  194. package/dist/modules-features/admin/core/core40207/F_core40207_Create.tsx +81 -0
  195. package/dist/modules-features/admin/core/core40207/F_core40207_Delete.tsx +17 -0
  196. package/dist/modules-features/admin/core/core40207/F_core40207_Read.tsx +98 -0
  197. package/dist/modules-features/admin/core/core40207/F_core40207_Update.tsx +83 -0
  198. package/dist/modules-features/admin/core/core47643/F_core47643.tsx +10 -0
  199. package/dist/modules-features/admin/core/core47643/F_core47643_Delete.tsx +13 -0
  200. package/dist/modules-features/admin/core/core47643/F_core47643_Form.tsx +34 -0
  201. package/dist/modules-features/admin/core/core47643/F_core47643_Read.tsx +57 -0
  202. package/dist/modules-features/admin/core/core60524/F_core60524.tsx +13 -0
  203. package/dist/modules-features/admin/core/core60524/F_core60524_Form.tsx +111 -0
  204. package/dist/modules-features/admin/core/core60524/F_core60524_Save.tsx +56 -0
  205. package/dist/modules-features/admin/core/core60524/useS_core60524.ts +16 -0
  206. package/dist/modules-features/admin/core/core64229/F_core64229.tsx +7 -0
  207. package/dist/modules-features/admin/core/core64229/F_core64229_Delete.tsx +21 -0
  208. package/dist/modules-features/admin/core/core64229/F_core64229_Form.tsx +95 -0
  209. package/dist/modules-features/admin/core/core64229/F_core64229_Read.tsx +67 -0
  210. package/dist/modules-features/admin/core/core71678/F_core71678.tsx +8 -0
  211. package/dist/modules-features/admin/core/core71678/F_core71678_ChangePermission.tsx +117 -0
  212. package/dist/modules-features/admin/core/core71678/F_core71678_Create.tsx +61 -0
  213. package/dist/modules-features/admin/core/core71678/F_core71678_Delete.tsx +16 -0
  214. package/dist/modules-features/admin/core/core71678/F_core71678_Read.tsx +92 -0
  215. package/dist/modules-features/admin/core/core71678/F_core71678_Update.tsx +49 -0
  216. package/dist/modules-features/admin/core/core76318/F_core76318.tsx +9 -0
  217. package/dist/modules-features/admin/core/core76318/F_core76318_Create.tsx +89 -0
  218. package/dist/modules-features/admin/core/core76318/F_core76318_Delete.tsx +17 -0
  219. package/dist/modules-features/admin/core/core76318/F_core76318_Read.tsx +104 -0
  220. package/dist/modules-features/admin/core/core76318/F_core76318_Update.tsx +89 -0
  221. package/dist/modules-features/admin/core/core83092/F_core83092.tsx +27 -0
  222. package/dist/modules-features/admin/core/core83092/F_core83092_ReadUser.tsx +85 -0
  223. package/dist/modules-features/admin/core/core83092/F_core83092_Save.tsx +52 -0
  224. package/dist/modules-features/admin/core/core83092/F_core83092_ViewMenuPermissions.tsx +263 -0
  225. package/dist/modules-features/admin/core/core83092/useS_core83092.tsx +70 -0
  226. package/dist/modules-features/authenticate/F_authenticate_Login/F_authenticate_Login.tsx +154 -0
  227. package/dist/modules-features/authenticate/F_authenticate_Login/css.module.css +4 -0
  228. package/dist/modules-features/authenticate/F_authenticate_Logout.tsx +22 -0
  229. package/dist/modules-features/authenticate/F_authenticate_SplashPage.tsx +21 -0
  230. package/dist/modules-features/authenticate/useS_authenticate.ts +23 -0
  231. package/dist/modules-features/index.d.mts +1 -1
  232. package/dist/modules-features/index.mjs +4053 -79
  233. package/dist/modules-features/index.ts +79 -0
  234. package/dist/providers/MyMantineProvider.tsx +140 -0
  235. package/dist/providers/MyReactQueryProvider.tsx +24 -0
  236. package/dist/providers/Provider.tsx +13 -0
  237. package/dist/providers/mantine.module.css +21 -0
  238. package/dist/stores/CreateGenericStore.ts +23 -0
  239. package/dist/stores/index.mjs +7 -1
  240. package/dist/stores/index.ts +1 -0
  241. package/dist/types/types.ts +16 -0
  242. package/dist/utils/index.mjs +45 -9
  243. package/dist/utils/index.ts +9 -0
  244. package/dist/utils/utils_converter.ts +39 -0
  245. package/dist/utils/utils_currency.ts +5 -0
  246. package/dist/utils/utils_date.ts +34 -0
  247. package/dist/utils/utils_excel.ts +128 -0
  248. package/dist/utils/utils_file.ts +61 -0
  249. package/dist/utils/utils_notification.ts +46 -0
  250. package/dist/utils/utils_pdf.ts +21 -0
  251. package/dist/utils/utils_time.ts +15 -0
  252. package/dist/utils/utils_validateForm.ts +9 -0
  253. package/package.json +1 -1
@@ -0,0 +1,235 @@
1
+ // src/utils/utils_converter.ts
2
+ var utils_converter_getLabelByValue = (data, value) => {
3
+ const numericValue = Number(value);
4
+ return data[numericValue] || "Kh\xF4ng x\xE1c \u0111\u1ECBnh";
5
+ };
6
+ var utils_converter_getKeyByValue = (obj, value) => {
7
+ var _a;
8
+ return (_a = Object.entries(obj).find(([_, v]) => v === value)) == null ? void 0 : _a[0];
9
+ };
10
+ function utils_converter_enumToSelectOptions(enumObject) {
11
+ const result = [];
12
+ const numericEnumKeys = Object.keys(enumObject).filter((key) => isNaN(Number(key)));
13
+ for (const key of numericEnumKeys) {
14
+ const enumValue = enumObject[key];
15
+ if (typeof enumValue === "number") {
16
+ result.push({
17
+ value: String(enumValue),
18
+ label: key
19
+ });
20
+ }
21
+ }
22
+ return result;
23
+ }
24
+
25
+ // src/utils/utils_currency.ts
26
+ function utils_currency_formatWithSuffix(amount, suffix = "") {
27
+ const formatter = new Intl.NumberFormat("vi-VN");
28
+ const formattedAmount = formatter.format(amount);
29
+ return `${formattedAmount}${suffix}`;
30
+ }
31
+
32
+ // src/utils/utils_date.ts
33
+ function U0DateToDDMMYYYString(date) {
34
+ if (!(date instanceof Date) || isNaN(date.getTime())) return "";
35
+ const day = String(date.getDate()).padStart(2, "0");
36
+ const month = String(date.getMonth() + 1).padStart(2, "0");
37
+ const year = date.getFullYear();
38
+ return `${day}/${month}/${year}`;
39
+ }
40
+ function utils_date_dateToDDMMYYYString(date) {
41
+ const day = String(date.getDate()).padStart(2, "0");
42
+ const month = String(date.getMonth() + 1).padStart(2, "0");
43
+ const year = date.getFullYear();
44
+ return `${day}/${month}/${year}`;
45
+ }
46
+ function utils_date_formatToDateTimeStartEnd(startDate, endDate) {
47
+ const startday = String(startDate.getDate()).padStart(2, "0");
48
+ const startmonth = String(startDate.getMonth() + 1).padStart(2, "0");
49
+ const startyear = startDate.getFullYear();
50
+ const starthour = String(startDate.getHours()).padStart(2, "0");
51
+ const startminute = String(startDate.getMinutes()).padStart(2, "0");
52
+ const endhour = String(endDate.getHours()).padStart(2, "0");
53
+ const endminuate = String(endDate.getMinutes()).padStart(2, "0");
54
+ return `${startday}/${startmonth}/${startyear} [${starthour}:${startminute} - ${endhour}:${endminuate}]`;
55
+ }
56
+ function utils_date_getHHmm(date) {
57
+ if (!(date instanceof Date) || isNaN(date.getTime())) return "";
58
+ const hour = String(date.getHours()).padStart(2, "0");
59
+ const minute = String(date.getMinutes()).padStart(2, "0");
60
+ return `${hour}:${minute}`;
61
+ }
62
+
63
+ // src/utils/utils_excel.ts
64
+ import saveAs from "file-saver";
65
+ function isObjectPath(path) {
66
+ return /^[a-zA-Z_$][a-zA-Z0-9_$]*(\.[a-zA-Z_$][a-zA-Z0-9_$]*)+$/.test(path);
67
+ }
68
+ function getValueByPath(obj, path) {
69
+ if (isObjectPath(path)) {
70
+ return path.split(".").reduce((acc, key) => acc == null ? void 0 : acc[key], obj);
71
+ }
72
+ return obj == null ? void 0 : obj[path];
73
+ }
74
+ async function utils_excel_exportExcel({
75
+ workbook,
76
+ sheetName,
77
+ data,
78
+ config
79
+ }) {
80
+ const sheet = workbook.addWorksheet(sheetName);
81
+ const fieldKeys = config.map((item) => String(item.fieldKey));
82
+ const headerMappings = {};
83
+ const markedColumns = [];
84
+ config.forEach((item) => {
85
+ const fieldKeyStr = String(item.fieldKey);
86
+ headerMappings[fieldKeyStr] = item.fieldName;
87
+ if (item.isRequired) markedColumns.push(fieldKeyStr);
88
+ });
89
+ sheet.columns = fieldKeys.map((fieldKey) => ({
90
+ key: fieldKey,
91
+ width: 20
92
+ }));
93
+ const displayRow = sheet.addRow(
94
+ fieldKeys.map(
95
+ (fieldKey) => markedColumns.includes(fieldKey) ? `${headerMappings[fieldKey]} *` : headerMappings[fieldKey] || fieldKey
96
+ )
97
+ );
98
+ const keyRow = sheet.addRow(fieldKeys);
99
+ data.forEach((item) => {
100
+ const rowData = {};
101
+ fieldKeys.forEach((fieldKey) => {
102
+ rowData[fieldKey] = getValueByPath(item, fieldKey);
103
+ });
104
+ sheet.addRow(rowData);
105
+ });
106
+ for (let i = 1; i <= fieldKeys.length; i++) {
107
+ const cell = displayRow.getCell(i);
108
+ cell.font = { bold: true };
109
+ cell.fill = {
110
+ type: "pattern",
111
+ pattern: "solid",
112
+ fgColor: { argb: "FFE0E0E0" }
113
+ };
114
+ }
115
+ for (let i = 1; i <= fieldKeys.length; i++) {
116
+ const cell = keyRow.getCell(i);
117
+ cell.font = { italic: true };
118
+ cell.fill = {
119
+ type: "pattern",
120
+ pattern: "solid",
121
+ fgColor: { argb: "FFF0F0F0" }
122
+ };
123
+ }
124
+ if (markedColumns.length > 0) {
125
+ for (let i = 1; i <= fieldKeys.length; i++) {
126
+ const cell = displayRow.getCell(i);
127
+ const text = cell.value;
128
+ if (typeof text === "string" && text.endsWith(" *")) {
129
+ cell.value = {
130
+ richText: [
131
+ {
132
+ text: text.slice(0, -2),
133
+ font: { bold: true }
134
+ },
135
+ {
136
+ text: " *",
137
+ font: { bold: true, color: { argb: "FFFF0000" } }
138
+ }
139
+ ]
140
+ };
141
+ }
142
+ }
143
+ }
144
+ return workbook;
145
+ }
146
+ async function utils_excel_download({
147
+ workbook,
148
+ name
149
+ }) {
150
+ const buffer = await workbook.xlsx.writeBuffer();
151
+ const blob = new Blob([buffer], {
152
+ type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
153
+ });
154
+ saveAs(blob, name);
155
+ }
156
+
157
+ // src/utils/utils_file.ts
158
+ import Docxtemplater from "docxtemplater";
159
+ import { saveAs as saveAs2 } from "file-saver";
160
+ import PizZip from "pizzip";
161
+ function utils_file_fileToAQDocumentType(file) {
162
+ return new Promise((resolve, reject) => {
163
+ const fileReader = new FileReader();
164
+ fileReader.onloadend = () => {
165
+ const fileName = file.name;
166
+ const fileExtension = file.name.split(".").pop();
167
+ const fileBase64String = fileReader.result;
168
+ resolve({
169
+ fileName,
170
+ fileExtension,
171
+ fileBase64String: fileBase64String.split(",")[1]
172
+ // Chỉ lấy phần base64 sau dấu phẩy
173
+ });
174
+ };
175
+ fileReader.onerror = reject;
176
+ fileReader.readAsDataURL(file);
177
+ });
178
+ }
179
+ async function utils_file_docxtemplaterDownload({
180
+ data,
181
+ filePath,
182
+ fileName
183
+ }) {
184
+ const response = await fetch(filePath);
185
+ const arrayBuffer = await response.arrayBuffer();
186
+ const zip = new PizZip(arrayBuffer);
187
+ const doc = new Docxtemplater(zip);
188
+ doc.render(data);
189
+ const buffer = doc.getZip().generate({ type: "blob" });
190
+ saveAs2(buffer, fileName || "output.docx");
191
+ }
192
+
193
+ // src/utils/utils_time.ts
194
+ var utils_time_convertTimeStringToSeconds = (time) => {
195
+ const [hours, minutes, seconds] = time.split(":").map(Number);
196
+ return hours * 3600 + minutes * 60 + seconds;
197
+ };
198
+ var utils_time_getCurrentTimeString = () => {
199
+ const formatTime = (number) => {
200
+ return number < 10 ? "0" + number : number;
201
+ };
202
+ const now = /* @__PURE__ */ new Date();
203
+ const hours = formatTime(now.getHours());
204
+ const minutes = formatTime(now.getMinutes());
205
+ const seconds = formatTime(now.getSeconds());
206
+ return `${hours}:${minutes}:${seconds}`;
207
+ };
208
+
209
+ // src/utils/utils_validateForm.ts
210
+ import { isNotEmpty } from "@mantine/form";
211
+ function U0MyValidateEmpty(message) {
212
+ return isNotEmpty(message ? message : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng");
213
+ }
214
+ function U0MyValidateEmail(value) {
215
+ return /^\S+@\S+$/.test(value) ? null : "Email kh\xF4ng \u0111\xFAng \u0111\u1ECBnh d\u1EA1ng";
216
+ }
217
+
218
+ export {
219
+ U0DateToDDMMYYYString,
220
+ utils_date_dateToDDMMYYYString,
221
+ utils_date_formatToDateTimeStartEnd,
222
+ utils_date_getHHmm,
223
+ utils_file_fileToAQDocumentType,
224
+ utils_file_docxtemplaterDownload,
225
+ utils_converter_getLabelByValue,
226
+ utils_converter_getKeyByValue,
227
+ utils_converter_enumToSelectOptions,
228
+ utils_currency_formatWithSuffix,
229
+ utils_excel_exportExcel,
230
+ utils_excel_download,
231
+ utils_time_convertTimeStringToSeconds,
232
+ utils_time_getCurrentTimeString,
233
+ U0MyValidateEmpty,
234
+ U0MyValidateEmail
235
+ };
@@ -0,0 +1,21 @@
1
+ import {
2
+ __spreadProps,
3
+ __spreadValues
4
+ } from "./chunk-FWCSY2DS.mjs";
5
+
6
+ // src/stores/CreateGenericStore.ts
7
+ import { create } from "zustand";
8
+ import { persist } from "zustand/middleware";
9
+ function createGenericStore({ initialState, storageKey }) {
10
+ const storeCreator = (set) => ({
11
+ state: initialState,
12
+ setState: (newState) => set({ state: newState }),
13
+ setProperty: (key, value) => set((store) => ({ state: __spreadProps(__spreadValues({}, store.state), { [key]: value }) })),
14
+ resetState: () => set({ state: initialState })
15
+ });
16
+ return storageKey ? create(persist(storeCreator, { name: storageKey })) : create(storeCreator);
17
+ }
18
+
19
+ export {
20
+ createGenericStore
21
+ };
@@ -0,0 +1,39 @@
1
+ // src/api/baseAxios.ts
2
+ import axios from "axios";
3
+ var baseAxios = axios.create({
4
+ baseURL: process.env.NEXT_PUBLIC_API
5
+ });
6
+ baseAxios.interceptors.request.use(
7
+ (config) => {
8
+ var _a, _b;
9
+ const tokenData = localStorage.getItem("useS_authenticate");
10
+ const state = JSON.parse(tokenData);
11
+ const token = (_b = (_a = state == null ? void 0 : state.state) == null ? void 0 : _a.state) == null ? void 0 : _b.token;
12
+ if (token) {
13
+ config.headers.Authorization = `Bearer ${token}`;
14
+ }
15
+ return config;
16
+ },
17
+ (error) => {
18
+ return Promise.reject(error);
19
+ }
20
+ );
21
+ var baseAxios_default = baseAxios;
22
+
23
+ // src/hooks/query/AQ/useQ_AQ_GetAQModule.ts
24
+ import { useQuery } from "@tanstack/react-query";
25
+ function useQ_AQ_GetAQModule() {
26
+ const query = useQuery({
27
+ queryKey: ["/AQ/GetAQModule"],
28
+ queryFn: async () => {
29
+ const res = await baseAxios_default.get("/AQ/GetAQModule");
30
+ return res.data.data;
31
+ }
32
+ });
33
+ return query;
34
+ }
35
+
36
+ export {
37
+ baseAxios_default,
38
+ useQ_AQ_GetAQModule
39
+ };
@@ -0,0 +1,66 @@
1
+ "use client";
2
+ import { cn } from "@/lib/utils";
3
+ import { motion } from "framer-motion";
4
+ import React from "react";
5
+
6
+ export const MyBoxesCore = ({ className, ...rest }: { className?: string }) => {
7
+ const rows = new Array(150).fill(1);
8
+ const cols = new Array(100).fill(1);
9
+ let colors = [
10
+ "--sky-300",
11
+ "--pink-300",
12
+ "--green-300",
13
+ "--yellow-300",
14
+ "--red-300",
15
+ "--purple-300",
16
+ "--blue-300",
17
+ "--indigo-300",
18
+ "--violet-300",
19
+ ];
20
+ const getRandomColor = () => {
21
+ return colors[Math.floor(Math.random() * colors.length)];
22
+ };
23
+
24
+ return (
25
+ <div
26
+ style={{
27
+ transform: `translate(-40%,-60%) skewX(-48deg) skewY(14deg) scale(0.675) rotate(0deg) translateZ(0)`,
28
+ }}
29
+ className={cn(
30
+ "absolute left-1/4 p-4 -top-1/4 flex -translate-x-1/2 -translate-y-1/2 w-full h-full z-0 ",
31
+ className
32
+ )}
33
+ {...rest}>
34
+ {rows.map((_, i) => (
35
+ <motion.div key={`row` + i} className="w-16 h-8 border-l border-slate-700 relative">
36
+ {cols.map((_, j) => (
37
+ <motion.div
38
+ whileHover={{
39
+ backgroundColor: `var(${getRandomColor()})`,
40
+ transition: { duration: 0 },
41
+ }}
42
+ animate={{
43
+ transition: { duration: 2 },
44
+ }}
45
+ key={`col` + j}
46
+ className="w-16 h-8 border-r border-t border-slate-700 relative">
47
+ {j % 2 === 0 && i % 2 === 0 ? (
48
+ <svg
49
+ xmlns="http://www.w3.org/2000/svg"
50
+ fill="none"
51
+ viewBox="0 0 24 24"
52
+ strokeWidth="1.5"
53
+ stroke="currentColor"
54
+ className="absolute h-6 w-10 -top-[14px] -left-[22px] text-slate-700 stroke-[1px] pointer-events-none">
55
+ <path strokeLinecap="round" strokeLinejoin="round" d="M12 6v12m6-6H6" />
56
+ </svg>
57
+ ) : null}
58
+ </motion.div>
59
+ ))}
60
+ </motion.div>
61
+ ))}
62
+ </div>
63
+ );
64
+ };
65
+
66
+ export const Boxes = React.memo(MyBoxesCore);
@@ -0,0 +1,31 @@
1
+ "use client";
2
+
3
+ import { MyCardioLoader } from "@/components/Loaders/MyCardioLoader";
4
+ import { cn } from "@/lib/utils";
5
+ import { Center, Space, Text } from "@mantine/core";
6
+ import { MyBoxesCore } from "./MyBoxes";
7
+
8
+ // Default values shown
9
+
10
+ export function MyBoxesBackground({ title, desc = "Được phát triển bởi công ty công nghệ Anh Quân." }: { title: string, desc?: string }) {
11
+ return (
12
+ <div className="h-[100vh] relative w-full overflow-hidden bg-slate-900 flex flex-col items-center justify-center rounded-lg">
13
+ <div className="absolute inset-0 w-full h-full bg-slate-900 z-20 [mask-image:radial-gradient(transparent,white)] pointer-events-none" />
14
+ <MyBoxesCore />
15
+ <Center className="z-20">
16
+ <MyCardioLoader />
17
+ </Center>
18
+ <Space my={7} />
19
+ <Center>
20
+ <Text className="z-20" fs="italic" fw={"bold"} c={"white"}>
21
+ Đang tải...
22
+ </Text>
23
+ </Center>
24
+ <Space my={7} />
25
+ <h1 className={cn("md:text-4xl text-xl text-white relative z-20")}>
26
+ {title}
27
+ </h1>
28
+ <p className="text-center mt-2 text-neutral-300 relative z-20">{desc}</p>
29
+ </div>
30
+ );
31
+ }
@@ -0,0 +1,47 @@
1
+ import { TYPES_CRUD } from "@/types/types";
2
+ import { ActionIcon, ActionIconProps } from "@mantine/core";
3
+ import { IconDeviceFloppy, IconEdit, IconPlus, IconTrash } from "@tabler/icons-react";
4
+ import { ReactNode } from "react";
5
+
6
+ interface IMyActionIcon extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "style">, ActionIconProps {
7
+ crudType?: TYPES_CRUD
8
+ children?: ReactNode;
9
+ }
10
+
11
+ export function MyActionIcon({ children, crudType = "default", ...rest }: IMyActionIcon) {
12
+ if (crudType == "default") {
13
+ return (
14
+ <ActionIcon color="indigo" {...rest}>
15
+ {children}
16
+ </ActionIcon>
17
+ );
18
+ }
19
+ if (crudType == "create") {
20
+ return (
21
+ <ActionIcon color="indigo" {...rest}>
22
+ <IconPlus />
23
+ </ActionIcon>
24
+ );
25
+ }
26
+ if (crudType == "delete") {
27
+ return (
28
+ <ActionIcon color="red" {...rest}>
29
+ <IconTrash />
30
+ </ActionIcon>
31
+ );
32
+ }
33
+ if (crudType == "update") {
34
+ return (
35
+ <ActionIcon color="yellow"{...rest}>
36
+ <IconEdit />
37
+ </ActionIcon>
38
+ );
39
+ }
40
+ if (crudType == "save") {
41
+ return (
42
+ <ActionIcon color="green" {...rest}>
43
+ <IconDeviceFloppy />
44
+ </ActionIcon>
45
+ );
46
+ }
47
+ }
@@ -0,0 +1,81 @@
1
+ import { MyButton } from "@/components/Buttons/Button/MyButton";
2
+ import { utils_notification_show } from "@/utils/utils_notification";
3
+ import { Group, Highlight } from "@mantine/core";
4
+ import { useDisclosure } from "@mantine/hooks";
5
+ import { useMutation, useQueryClient } from "@tanstack/react-query";
6
+ import { ComponentProps, useState } from "react";
7
+ import { MyActionIconModal } from "../ActionIconModal/MyActionIconModal";
8
+ interface IActionIconDelete extends Omit<ComponentProps<typeof MyActionIconModal>, "disclosure"> {
9
+ onSubmit: () => void;
10
+ onSuccess?: () => void;
11
+ onError?: () => void;
12
+ contextData?: string;
13
+ loading?: boolean;
14
+ }
15
+
16
+ export function MyActionIconDelete({
17
+ onSubmit,
18
+ onSuccess,
19
+ onError,
20
+ contextData,
21
+ ...rest
22
+ }: IActionIconDelete) {
23
+ const queryClient = useQueryClient();
24
+ const disc = useDisclosure();
25
+ const loadingState = useState<boolean>()
26
+
27
+
28
+ const mutation = useMutation({
29
+ mutationFn: async () => await onSubmit(),
30
+ onSuccess: () => {
31
+ if (onSuccess) {
32
+ onSuccess()
33
+ return
34
+ }
35
+ queryClient.invalidateQueries();
36
+ utils_notification_show({ crudType: "delete" });
37
+ disc[1].close();
38
+ },
39
+ onError: () => {
40
+ if (onError) {
41
+ onError()
42
+ return
43
+ }
44
+ },
45
+ });
46
+
47
+ function handleCLick() {
48
+ loadingState[1](true)
49
+ mutation.mutate();
50
+ }
51
+ return (
52
+ <MyActionIconModal
53
+ disclosure={disc}
54
+ crudType="delete"
55
+ {...rest}
56
+ >
57
+ <Highlight
58
+ highlight={contextData || []}
59
+ color="red.6"
60
+ highlightStyles={{
61
+ fontWeight: 700,
62
+ WebkitBackgroundClip: 'text',
63
+ WebkitTextFillColor: 'transparent',
64
+ }}
65
+ >
66
+ {`Bạn sắp xóa dữ liệu ${contextData || ""}. Hành động này không thể hoàn tác. Bạn có chắc chắn muốn tiếp tục?`}
67
+ </Highlight>
68
+ <Group grow>
69
+ <MyButton
70
+ crudType="delete"
71
+ onClick={handleCLick}
72
+ loading={loadingState[0]}
73
+ />
74
+ <MyButton
75
+ crudType="cancel"
76
+ onClick={disc[1].close}
77
+ />
78
+ </Group>
79
+ </MyActionIconModal>
80
+ );
81
+ }
@@ -0,0 +1,68 @@
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 { UseFormReturnType } from "@mantine/form"
5
+ import { useDisclosure } from "@mantine/hooks"
6
+ import { useMutation, useQueryClient } from "@tanstack/react-query"
7
+ import { ComponentProps, useEffect } from "react"
8
+ import { MyActionIconModal } from "../ActionIconModal/MyActionIconModal"
9
+
10
+ interface IActionIconUpdate<T> extends Omit<ComponentProps<typeof MyActionIconModal>, "form" | "disclosure" | "onSubmit"> {
11
+ resetFormWhenclose?: boolean
12
+ onSubmit: (values: T) => void
13
+ onSuccess?: () => void; // Custom callback for success handling
14
+ onError?: () => void; // Custom callback for error handling
15
+ form: UseFormReturnType<T>;
16
+ disclosure?: ReturnType<typeof useDisclosure>;
17
+ }
18
+
19
+ export function MyActionIconUpdate<T>({
20
+ resetFormWhenclose,
21
+ form,
22
+ onSubmit,
23
+ onSuccess,
24
+ onError,
25
+ children,
26
+ ...rest
27
+ }: IActionIconUpdate<T>) {
28
+ const disc = useDisclosure()
29
+ const queryClient = useQueryClient()
30
+
31
+ const mutation = useMutation({
32
+ mutationFn: async (values: T) => {
33
+ await onSubmit(values);
34
+ },
35
+ onSuccess: () => {
36
+ if (onSuccess) {
37
+ onSuccess()
38
+ }
39
+ queryClient.invalidateQueries()
40
+ utils_notification_show({ crudType: "update" });
41
+ disc[1].close();
42
+
43
+ },
44
+ onError: () => {
45
+ if (onError) onError();
46
+ },
47
+ })
48
+ useEffect(() => {
49
+ if (!resetFormWhenclose) return
50
+ if (disc[0] == true) return
51
+ form.reset()
52
+ }, [disc[0]])
53
+ return (
54
+ <MyActionIconModal disclosure={disc} crudType="update" {...rest}>
55
+ <form onSubmit={form.onSubmit((values) => {
56
+ mutation.mutate(values);
57
+ })}>
58
+ <MyFlexColumn>
59
+ {children}
60
+ <MyButton
61
+ type="submit"
62
+ crudType="save"
63
+ />
64
+ </MyFlexColumn>
65
+ </form>
66
+ </MyActionIconModal>
67
+ )
68
+ }
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ import { MyTextInput } from "@/components/Inputs/TextInput/MyTextInput";
3
+ import { MyFlexColumn } from "@/components/Layouts/FlexColumn/MyFlexColumn";
4
+ import { ActionIcon, ActionIconProps, Button, Checkbox, Modal, Switch, Text, Tooltip } from "@mantine/core";
5
+ import { useDisclosure } from "@mantine/hooks";
6
+ import { IconChecklist } from "@tabler/icons-react";
7
+ import { useState } from "react";
8
+
9
+
10
+ interface IActionIconCheck extends ActionIconProps {
11
+ modalSize?: string; comment?: string
12
+ }
13
+
14
+ export function MyActionIconCheck({ modalSize = "50%", comment = "", ...rest }: IActionIconCheck) {
15
+ const disc = useDisclosure(false);
16
+ const fullScreen = useState(false);
17
+ const hSize = useState("50vh");
18
+ return (
19
+ <>
20
+ <Tooltip label="Xem tài liệu trực tiếp" >
21
+ <ActionIcon color="cyan" onClick={disc[1].open} {...rest}>
22
+ <IconChecklist size={24} color="blue" />
23
+ </ActionIcon>
24
+ </Tooltip>
25
+
26
+ <Modal
27
+ fullScreen={fullScreen[0]}
28
+ opened={disc[0]}
29
+ onClose={disc[1].close}
30
+ size={modalSize}
31
+ title={
32
+ <Text>Kiểm tra hồ sơ đã đăng ký</Text>
33
+
34
+ }>
35
+ <Switch
36
+ defaultChecked
37
+ label="Đạt yêu cầu"
38
+ />
39
+ <MyFlexColumn>
40
+ <MyTextInput label="Nhận xét" />
41
+ <Checkbox label="Gửi mail thông báo" />
42
+ <Button>Cập nhập</Button>
43
+ </MyFlexColumn>
44
+
45
+ </Modal>
46
+
47
+
48
+ </>
49
+ );
50
+ }
@@ -0,0 +1,13 @@
1
+ import { utils_pdf_download } from "@/utils/utils_pdf";
2
+ import { ActionIcon, Tooltip } from "@mantine/core";
3
+ import { IconDownload } from "@tabler/icons-react";
4
+
5
+ export function MyActionIconDownloadPDF({ pdfLink = "https://datafiles.chinhphu.vn/cpp/files/vbpq/2021/07/17-bgd.signed.pdf" }: { pdfLink: string }) {
6
+ return (
7
+ <Tooltip label="Nhấp để tải xuống">
8
+ <ActionIcon onClick={async () => await utils_pdf_download(pdfLink)} color="red">
9
+ <IconDownload />
10
+ </ActionIcon>
11
+ </Tooltip>
12
+ );
13
+ }