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.
- package/dist/{chunk-JLT4BL7I.mjs → chunk-ZO7PLULO.mjs} +4 -4
- package/dist/{css.module-4ICLUKPO.module.css → components/index.css} +16 -29
- package/dist/components/index.mjs +2 -2
- package/dist/modules-features/index.css +100 -0
- package/dist/modules-features/index.mjs +5 -5
- package/package.json +1 -1
- package/dist/api/apiFactory.ts +0 -46
- package/dist/api/baseAxios.ts +0 -22
- package/dist/app/admin/(core)/core12196/page.tsx +0 -13
- package/dist/app/admin/(core)/core16209/page.tsx +0 -13
- package/dist/app/admin/(core)/core18256/page.tsx +0 -12
- package/dist/app/admin/(core)/core26965/page.tsx +0 -13
- package/dist/app/admin/(core)/core27311/page.tsx +0 -13
- package/dist/app/admin/(core)/core38677/page.tsx +0 -13
- package/dist/app/admin/(core)/core40207/page.tsx +0 -13
- package/dist/app/admin/(core)/core60524/page.tsx +0 -11
- package/dist/app/admin/(core)/core64229/page.tsx +0 -12
- package/dist/app/admin/(core)/core71678/page.tsx +0 -11
- package/dist/app/admin/(core)/core76318/page.tsx +0 -13
- package/dist/app/admin/(core)/core83092/page.tsx +0 -13
- package/dist/app/admin/[...slug]/page.tsx +0 -7
- package/dist/app/admin/error.tsx +0 -42
- package/dist/app/admin/layout.tsx +0 -21
- package/dist/app/admin/test/page.tsx +0 -44
- package/dist/app/auth/login/page.tsx +0 -14
- package/dist/app/globals.css +0 -59
- package/dist/app/layout.tsx +0 -39
- package/dist/app/page.tsx +0 -18
- package/dist/components/Aceternity/BoxesBackground/MyBoxes.tsx +0 -66
- package/dist/components/Aceternity/BoxesBackground/MyBoxesBackground.tsx +0 -31
- package/dist/components/ActionIcons/ActionIcon/MyActionIcon.tsx +0 -47
- package/dist/components/ActionIcons/ActionIconCRUD/MyActionIconDelete.tsx +0 -81
- package/dist/components/ActionIcons/ActionIconCRUD/MyActionIconUpdate.tsx +0 -68
- package/dist/components/ActionIcons/ActionIconCheck/MyActionIconCheck.tsx +0 -50
- package/dist/components/ActionIcons/ActionIconDownloadPDF/MyActionIconDownloadPDF.tsx +0 -13
- package/dist/components/ActionIcons/ActionIconModal/MyActionIconModal.tsx +0 -113
- package/dist/components/ActionIcons/ActionIconUpload/MyActionIconUpload.tsx +0 -19
- package/dist/components/ActionIcons/ActionIconViewPdf/MyActionIconViewPDF.tsx +0 -63
- package/dist/components/ActionIcons/SwitchTheme/MySwitchTheme.tsx +0 -36
- package/dist/components/AppSpotlight/MyAppSpotlight.tsx +0 -112
- package/dist/components/Buttons/Anchor/MyAnchorViewPDF.tsx +0 -46
- package/dist/components/Buttons/Button/MyButton.tsx +0 -90
- package/dist/components/Buttons/ButtonCRUD/AQButtonCreateByImportFile.tsx +0 -81
- package/dist/components/Buttons/ButtonCRUD/AQButtonExportData.tsx +0 -75
- package/dist/components/Buttons/ButtonCRUD/MyButtonCreate.tsx +0 -68
- package/dist/components/Buttons/ButtonImport/MyButtonImport.tsx +0 -29
- package/dist/components/Buttons/ButtonImport/SelectFieldModal.tsx +0 -100
- package/dist/components/Buttons/ButtonImport/SelectFileModal.tsx +0 -81
- package/dist/components/Buttons/ButtonImport/useS_ButtonImport.ts +0 -196
- package/dist/components/Buttons/ButtonModal/AQSelectTableByOpenModal.tsx +0 -71
- package/dist/components/Buttons/ButtonModal/MyButtonModal.tsx +0 -117
- package/dist/components/Buttons/ButtonPrintPDF/MyButtonPrintPDF.tsx +0 -37
- package/dist/components/Buttons/ButtonPrintPDFTable/MyButtonPrintTablePDF.tsx +0 -174
- package/dist/components/Buttons/ButtonRouterBack/MyButtonRouterBack.tsx +0 -29
- package/dist/components/Buttons/ButtonViewPDF/MyButtonViewPDF.tsx +0 -121
- package/dist/components/Calendar/MyCalendar.tsx +0 -118
- package/dist/components/CenterFull/MyCenterFull.tsx +0 -10
- package/dist/components/Checkbox/MyCheckbox.tsx +0 -9
- package/dist/components/Combobox/Select/MySelect.tsx +0 -12
- package/dist/components/DataDisplay/Card/AQCard.tsx +0 -49
- package/dist/components/DataDisplay/CardInformation/MyCardInformation.tsx +0 -77
- package/dist/components/DataDisplay/DataTable/MyDataTable.tsx +0 -184
- package/dist/components/DataDisplay/IconText/MyIconText.tsx +0 -17
- package/dist/components/DataDisplay/KeyLabel/MyKeyLabel.tsx +0 -15
- package/dist/components/DataDisplay/NumberFormatter/MyNumberFormatter.tsx +0 -9
- package/dist/components/DataDisplay/StatCard/AQStatCard1.tsx +0 -68
- package/dist/components/FaviconSetter/FaviconSetter.tsx +0 -33
- package/dist/components/Inputs/DateInput/MyDateInput.tsx +0 -11
- package/dist/components/Inputs/Fieldset/MyFieldset.tsx +0 -32
- package/dist/components/Inputs/FileInput/MyFileInput.tsx +0 -12
- package/dist/components/Inputs/NumberInput/MyNumberInput.tsx +0 -12
- package/dist/components/Inputs/TextArea/MyTextArea.tsx +0 -11
- package/dist/components/Inputs/TextEditor/MyTextEditor.tsx +0 -191
- package/dist/components/Inputs/TextInput/MyTextInput.tsx +0 -30
- package/dist/components/Layouts/BasicAppShell/BasicAppShell.tsx +0 -357
- package/dist/components/Layouts/BasicAppShell/css.module.css +0 -62
- package/dist/components/Layouts/BasicAppShell/useS_BasicAppShell.ts +0 -64
- package/dist/components/Layouts/Container/MyContainer.tsx +0 -16
- package/dist/components/Layouts/FlexColumn/MyFlexColumn.tsx +0 -14
- package/dist/components/Layouts/FlexEnd/MyFlexEnd.tsx +0 -14
- package/dist/components/Layouts/FlexRow/MyFlexRow.tsx +0 -14
- package/dist/components/Layouts/HeaderMegaMenu/HeaderMegaMenu.tsx +0 -147
- package/dist/components/Layouts/HeaderMegaMenu/HeaderMegaMenuStore.ts +0 -19
- package/dist/components/Layouts/HeaderMegaMenu/css.module.css +0 -50
- package/dist/components/Layouts/HtmlWrapper/MyHtmlWrapper.tsx +0 -29
- package/dist/components/Layouts/PageContent/MyPageContent.tsx +0 -67
- package/dist/components/Layouts/Tab/MyTab.tsx +0 -33
- package/dist/components/Loaders/MyCardioLoader.tsx +0 -12
- package/dist/components/RESTAPIComponents/DataTableSelect/MyDataTableSelect.tsx +0 -61
- package/dist/components/RESTAPIComponents/SelectAPIGet/MySelectAPIGet.tsx +0 -37
- package/dist/components/ScheduleX/MyScheduleX.tsx +0 -58
- package/dist/components/Skeletons/SkeletonTable/MySkeletonTable.tsx +0 -9
- package/dist/components/index.ts +0 -62
- package/dist/constants/array/daysOfWeek.ts +0 -9
- package/dist/constants/enum/ENUM_EMAILCONFIG.ts +0 -6
- package/dist/constants/enum/global.ts +0 -26
- package/dist/constants/object/color.ts +0 -5
- package/dist/constants/object/documentTypes.ts +0 -8
- package/dist/css.module-P45UW6UZ.module.css +0 -4
- package/dist/data/menuData.ts +0 -31
- package/dist/hooks/custom-hooks/useC_MutationAction.tsx +0 -36
- package/dist/hooks/index.ts +0 -2
- package/dist/hooks/query/AQ/useQ_AQ_GetAQModule.ts +0 -14
- package/dist/interfaces/EmailConfig.ts +0 -10
- package/dist/interfaces/IAQModule.ts +0 -21
- package/dist/interfaces/base.ts +0 -9
- package/dist/interfaces/global-interface/IAQSSO.ts +0 -15
- package/dist/interfaces/global-interface/IAQSyncData.ts +0 -9
- package/dist/interfaces/global-interface/IAcademicYear.ts +0 -12
- package/dist/interfaces/global-interface/IChangePassWord.ts +0 -8
- package/dist/interfaces/global-interface/IComplaintProccess.ts +0 -9
- package/dist/interfaces/global-interface/ICreateAccount.ts +0 -24
- package/dist/interfaces/global-interface/IDocument.ts +0 -25
- package/dist/interfaces/global-interface/IDocumentAttribute.ts +0 -12
- package/dist/interfaces/global-interface/IEvent.ts +0 -30
- package/dist/interfaces/global-interface/IEventComplaint.ts +0 -20
- package/dist/interfaces/global-interface/IEventFillter.ts +0 -14
- package/dist/interfaces/global-interface/IFile.ts +0 -8
- package/dist/interfaces/global-interface/IImportStudentPaticipation.ts +0 -8
- package/dist/interfaces/global-interface/IPagePermission.ts +0 -12
- package/dist/interfaces/global-interface/IRolePermission.ts +0 -7
- package/dist/interfaces/global-interface/ISRMUserinfo.ts +0 -35
- package/dist/interfaces/global-interface/IScientificProfileProjectUser.ts +0 -15
- package/dist/interfaces/global-interface/IScientificProfileResearchGroup.ts +0 -15
- package/dist/interfaces/global-interface/IScientificProfileResearchGroupUser.ts +0 -14
- package/dist/interfaces/global-interface/IScientificProfileResearchProject.ts +0 -21
- package/dist/interfaces/global-interface/ISignIn.ts +0 -7
- package/dist/interfaces/global-interface/ISystemCatalogAcademicYear.ts +0 -15
- package/dist/interfaces/global-interface/ISystemCatalogDomainCategory.ts +0 -11
- package/dist/interfaces/global-interface/ISystemCatalogProjectLevelCategory.ts +0 -11
- package/dist/interfaces/global-interface/ISystemCatalogProjectTypeCategory.ts +0 -11
- package/dist/interfaces/global-interface/ISystemCatalogRoleActivity.ts +0 -11
- package/dist/interfaces/global-interface/ISystemCatalogTaskCategory.ts +0 -11
- package/dist/interfaces/global-interface/ISystemManagementAcademicHistory.ts +0 -31
- package/dist/interfaces/global-interface/ISystemManagementProfessionalWorkHistory.ts +0 -14
- package/dist/interfaces/global-interface/ISystemManagementPublishedScientificWork.ts +0 -14
- package/dist/interfaces/global-interface/ISystemManagementRoleGroup.ts +0 -12
- package/dist/interfaces/global-interface/ISystemManagementRoleGroupMenuPermission.ts +0 -18
- package/dist/interfaces/global-interface/ISystemManagementScientificResearchProject.ts +0 -16
- package/dist/interfaces/global-interface/ISystemManagementUserMenuPermission.ts +0 -18
- package/dist/interfaces/global-interface/IUpdateAccount.ts +0 -15
- package/dist/interfaces/global-interface/IUser.ts +0 -21
- package/dist/interfaces/global-interface/IUserPermission.ts +0 -7
- package/dist/lib/utils.ts +0 -6
- package/dist/modules-features/admin/core/MainDashboard/BarChart_CourseStatus.tsx +0 -87
- package/dist/modules-features/admin/core/MainDashboard/BarChart_ExamStatus.tsx +0 -65
- package/dist/modules-features/admin/core/MainDashboard/BarChart_RevenueByAcademicYear.tsx +0 -82
- package/dist/modules-features/admin/core/MainDashboard/BarChart_StudentStatusIn30Days.tsx +0 -67
- package/dist/modules-features/admin/core/MainDashboard/HBarChart_CourseDropOutPercentage.tsx +0 -77
- package/dist/modules-features/admin/core/MainDashboard/HBarChart_CourseProgressPercentage.tsx +0 -77
- package/dist/modules-features/admin/core/MainDashboard/LineChart_RevenueIn12Months.tsx +0 -78
- package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByDiscountIn3Months.tsx +0 -69
- package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByVoucherIn3Months.tsx +0 -69
- package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalStudentIn12Months.tsx +0 -64
- package/dist/modules-features/admin/core/MainDashboard/ViewDiscountStat.tsx +0 -311
- package/dist/modules-features/admin/core/MainDashboard/ViewVoucherStat.tsx +0 -311
- package/dist/modules-features/admin/core/core12196/F_core12196.tsx +0 -20
- package/dist/modules-features/admin/core/core12196/F_core12196_Create.tsx +0 -101
- package/dist/modules-features/admin/core/core12196/F_core12196_Delete.tsx +0 -19
- package/dist/modules-features/admin/core/core12196/F_core12196_Read.tsx +0 -165
- package/dist/modules-features/admin/core/core12196/F_core12196_Update.tsx +0 -112
- package/dist/modules-features/admin/core/core16209/F_core16209.tsx +0 -108
- package/dist/modules-features/admin/core/core16209/F_core16209_Create.tsx +0 -112
- package/dist/modules-features/admin/core/core16209/F_core16209_Delete.tsx +0 -17
- package/dist/modules-features/admin/core/core16209/F_core16209_Update.tsx +0 -114
- package/dist/modules-features/admin/core/core18256/F_core18256.tsx +0 -29
- package/dist/modules-features/admin/core/core18256/F_core18256_Create.tsx +0 -34
- package/dist/modules-features/admin/core/core18256/F_core18256_Delete.tsx +0 -14
- package/dist/modules-features/admin/core/core18256/F_core18256_Read.tsx +0 -59
- package/dist/modules-features/admin/core/core18256/F_core18256_Select.tsx +0 -40
- package/dist/modules-features/admin/core/core18256/F_core18256_Update.tsx +0 -22
- package/dist/modules-features/admin/core/core26965/F_core26965.tsx +0 -17
- package/dist/modules-features/admin/core/core26965/F_core26965_Create.tsx +0 -106
- package/dist/modules-features/admin/core/core26965/F_core26965_Delete.tsx +0 -19
- package/dist/modules-features/admin/core/core26965/F_core26965_Read.tsx +0 -165
- package/dist/modules-features/admin/core/core26965/F_core26965_Update.tsx +0 -112
- package/dist/modules-features/admin/core/core27311/F_core27311.tsx +0 -21
- package/dist/modules-features/admin/core/core27311/F_core27311_Create.tsx +0 -109
- package/dist/modules-features/admin/core/core27311/F_core27311_Delete.tsx +0 -19
- package/dist/modules-features/admin/core/core27311/F_core27311_Read.tsx +0 -165
- package/dist/modules-features/admin/core/core27311/F_core27311_Update.tsx +0 -113
- package/dist/modules-features/admin/core/core35923/F_core35923.tsx +0 -46
- package/dist/modules-features/admin/core/core38677/F_core38677.tsx +0 -28
- package/dist/modules-features/admin/core/core38677/F_core38677_ReadUser.tsx +0 -79
- package/dist/modules-features/admin/core/core38677/F_core38677_Save.tsx +0 -52
- package/dist/modules-features/admin/core/core38677/F_core38677_ViewMenuPermissions.tsx +0 -264
- package/dist/modules-features/admin/core/core40207/F_core40207.tsx +0 -9
- package/dist/modules-features/admin/core/core40207/F_core40207_Create.tsx +0 -81
- package/dist/modules-features/admin/core/core40207/F_core40207_Delete.tsx +0 -17
- package/dist/modules-features/admin/core/core40207/F_core40207_Read.tsx +0 -98
- package/dist/modules-features/admin/core/core40207/F_core40207_Update.tsx +0 -83
- package/dist/modules-features/admin/core/core47643/F_core47643.tsx +0 -10
- package/dist/modules-features/admin/core/core47643/F_core47643_Delete.tsx +0 -13
- package/dist/modules-features/admin/core/core47643/F_core47643_Form.tsx +0 -34
- package/dist/modules-features/admin/core/core47643/F_core47643_Read.tsx +0 -57
- package/dist/modules-features/admin/core/core60524/F_core60524.tsx +0 -13
- package/dist/modules-features/admin/core/core60524/F_core60524_Form.tsx +0 -111
- package/dist/modules-features/admin/core/core60524/F_core60524_Save.tsx +0 -56
- package/dist/modules-features/admin/core/core60524/useS_core60524.ts +0 -16
- package/dist/modules-features/admin/core/core64229/F_core64229.tsx +0 -7
- package/dist/modules-features/admin/core/core64229/F_core64229_Delete.tsx +0 -21
- package/dist/modules-features/admin/core/core64229/F_core64229_Form.tsx +0 -95
- package/dist/modules-features/admin/core/core64229/F_core64229_Read.tsx +0 -67
- package/dist/modules-features/admin/core/core71678/F_core71678.tsx +0 -8
- package/dist/modules-features/admin/core/core71678/F_core71678_ChangePermission.tsx +0 -117
- package/dist/modules-features/admin/core/core71678/F_core71678_Create.tsx +0 -61
- package/dist/modules-features/admin/core/core71678/F_core71678_Delete.tsx +0 -16
- package/dist/modules-features/admin/core/core71678/F_core71678_Read.tsx +0 -92
- package/dist/modules-features/admin/core/core71678/F_core71678_Update.tsx +0 -49
- package/dist/modules-features/admin/core/core76318/F_core76318.tsx +0 -9
- package/dist/modules-features/admin/core/core76318/F_core76318_Create.tsx +0 -89
- package/dist/modules-features/admin/core/core76318/F_core76318_Delete.tsx +0 -17
- package/dist/modules-features/admin/core/core76318/F_core76318_Read.tsx +0 -104
- package/dist/modules-features/admin/core/core76318/F_core76318_Update.tsx +0 -89
- package/dist/modules-features/admin/core/core83092/F_core83092.tsx +0 -27
- package/dist/modules-features/admin/core/core83092/F_core83092_ReadUser.tsx +0 -85
- package/dist/modules-features/admin/core/core83092/F_core83092_Save.tsx +0 -52
- package/dist/modules-features/admin/core/core83092/F_core83092_ViewMenuPermissions.tsx +0 -263
- package/dist/modules-features/admin/core/core83092/useS_core83092.tsx +0 -70
- package/dist/modules-features/authenticate/F_authenticate_Login/F_authenticate_Login.tsx +0 -154
- package/dist/modules-features/authenticate/F_authenticate_Login/css.module.css +0 -4
- package/dist/modules-features/authenticate/F_authenticate_Logout.tsx +0 -22
- package/dist/modules-features/authenticate/F_authenticate_SplashPage.tsx +0 -21
- package/dist/modules-features/authenticate/useS_authenticate.ts +0 -23
- package/dist/modules-features/index.ts +0 -79
- package/dist/providers/MyMantineProvider.tsx +0 -140
- package/dist/providers/MyReactQueryProvider.tsx +0 -24
- package/dist/providers/Provider.tsx +0 -13
- package/dist/providers/mantine.module.css +0 -21
- package/dist/stores/CreateGenericStore.ts +0 -23
- package/dist/stores/index.ts +0 -1
- package/dist/types/types.ts +0 -16
- package/dist/utils/index.ts +0 -9
- package/dist/utils/utils_converter.ts +0 -39
- package/dist/utils/utils_currency.ts +0 -5
- package/dist/utils/utils_date.ts +0 -34
- package/dist/utils/utils_excel.ts +0 -128
- package/dist/utils/utils_file.ts +0 -61
- package/dist/utils/utils_notification.ts +0 -46
- package/dist/utils/utils_pdf.ts +0 -21
- package/dist/utils/utils_time.ts +0 -15
- package/dist/utils/utils_validateForm.ts +0 -9
@@ -1,184 +0,0 @@
|
|
1
|
-
"use client"
|
2
|
-
import { Button, Group, Portal } from '@mantine/core';
|
3
|
-
import { IconDownload } from '@tabler/icons-react';
|
4
|
-
import { ConfigOptions, download, generateCsv, mkConfig } from 'export-to-csv';
|
5
|
-
import {
|
6
|
-
MantineReactTable,
|
7
|
-
MRT_Row,
|
8
|
-
MRT_TableInstance,
|
9
|
-
useMantineReactTable,
|
10
|
-
type MRT_ColumnDef,
|
11
|
-
type MRT_RowData,
|
12
|
-
type MRT_TableOptions
|
13
|
-
} from 'mantine-react-table';
|
14
|
-
import { MRT_Localization_VI } from "mantine-react-table/locales/vi/index.cjs";
|
15
|
-
import { ReactNode, useEffect } from 'react';
|
16
|
-
|
17
|
-
type FormatFunction<TData extends MRT_RowData> = (value: any) => any;
|
18
|
-
|
19
|
-
interface IDataTable<TData extends MRT_RowData> extends MRT_TableOptions<TData> {
|
20
|
-
columns: MRT_ColumnDef<TData>[]; // Table columns
|
21
|
-
data: TData[]; // Table data
|
22
|
-
rowActionSize?: number; // Row action button size
|
23
|
-
exportAble?: boolean; // Flag to enable export all data
|
24
|
-
renderTopToolbarCustomActions?: ((props: {
|
25
|
-
table: MRT_TableInstance<TData>;
|
26
|
-
}) => ReactNode) | undefined,
|
27
|
-
csvConfigProps?: ConfigOptions,
|
28
|
-
formats?: {
|
29
|
-
[K in keyof TData]?: FormatFunction<TData>;
|
30
|
-
};
|
31
|
-
setSelectedRow?: (data: any) => void;
|
32
|
-
}
|
33
|
-
|
34
|
-
function formatData<TData extends MRT_RowData>(
|
35
|
-
data: TData[],
|
36
|
-
formats: {
|
37
|
-
[K in keyof TData]?: FormatFunction<TData>;
|
38
|
-
}
|
39
|
-
): TData[] {
|
40
|
-
return data.map((row) => {
|
41
|
-
const transformedRow: Partial<TData> = {};
|
42
|
-
Object.entries(row).forEach(([key, value]) => {
|
43
|
-
// Type-safe format application
|
44
|
-
const formatFn = formats[key as keyof TData];
|
45
|
-
|
46
|
-
// Special handling for Date type
|
47
|
-
if (value instanceof Date) {
|
48
|
-
transformedRow[key as keyof TData] = formatFn
|
49
|
-
? formatFn(value.toISOString())
|
50
|
-
: value.toISOString();
|
51
|
-
}
|
52
|
-
// Special handling for objects (excluding null)
|
53
|
-
else if (value !== null && typeof value === "object") {
|
54
|
-
transformedRow[key as keyof TData] = formatFn
|
55
|
-
? formatFn(JSON.stringify(value))
|
56
|
-
: JSON.stringify(value);
|
57
|
-
}
|
58
|
-
// General case
|
59
|
-
else {
|
60
|
-
transformedRow[key as keyof TData] = formatFn ? formatFn(value) : value;
|
61
|
-
}
|
62
|
-
});
|
63
|
-
return transformedRow as TData;
|
64
|
-
});
|
65
|
-
}
|
66
|
-
|
67
|
-
|
68
|
-
export function MyDataTable<TData extends MRT_RowData>(
|
69
|
-
{ formats = {}, exportAble = false, csvConfigProps, rowActionSize, columns, data, renderTopToolbarCustomActions, setSelectedRow, ...rest }: IDataTable<TData>) {
|
70
|
-
const { renderRowActions } = { ...rest };
|
71
|
-
const csvConfig = mkConfig({
|
72
|
-
fieldSeparator: ',',
|
73
|
-
decimalSeparator: '.',
|
74
|
-
useKeysAsHeaders: csvConfigProps?.columnHeaders ? false : true,
|
75
|
-
...csvConfigProps
|
76
|
-
});
|
77
|
-
|
78
|
-
const handleExport = (rows: MRT_Row<TData>[]) => {
|
79
|
-
if (rows.length == 0) {
|
80
|
-
const transformedData = formatData(data, formats); // Sử dụng formats từ props
|
81
|
-
const csv = generateCsv(csvConfig)(transformedData);
|
82
|
-
download(csvConfig)(csv);
|
83
|
-
return
|
84
|
-
}
|
85
|
-
const rowData = rows.map((row) => row.original);
|
86
|
-
const transformedRows = formatData(rowData, formats);
|
87
|
-
const csv = generateCsv(csvConfig)(transformedRows);
|
88
|
-
download(csvConfig)(csv);
|
89
|
-
};
|
90
|
-
|
91
|
-
const table = useMantineReactTable({
|
92
|
-
columns,
|
93
|
-
data,
|
94
|
-
renderTopToolbarCustomActions: ({ table }) => {
|
95
|
-
return (
|
96
|
-
<Group>
|
97
|
-
{renderTopToolbarCustomActions && renderTopToolbarCustomActions({ table: table })}
|
98
|
-
{exportAble &&
|
99
|
-
<>
|
100
|
-
{/* <Button
|
101
|
-
color='green.8'
|
102
|
-
onClick={() => handleExport(table.getSelectedRowModel().rows)}
|
103
|
-
leftSection={<IconDownload />}
|
104
|
-
variant="filled"
|
105
|
-
>
|
106
|
-
Import
|
107
|
-
</Button> */}
|
108
|
-
|
109
|
-
<Button
|
110
|
-
color='green.8'
|
111
|
-
onClick={() => handleExport(table.getSelectedRowModel().rows)}
|
112
|
-
leftSection={<IconDownload />}
|
113
|
-
variant="filled"
|
114
|
-
>
|
115
|
-
Export
|
116
|
-
</Button>
|
117
|
-
|
118
|
-
</>
|
119
|
-
|
120
|
-
}
|
121
|
-
</Group>
|
122
|
-
);
|
123
|
-
},
|
124
|
-
enableRowNumbers: true,
|
125
|
-
enableRowSelection: exportAble,
|
126
|
-
enableEditing: renderRowActions ? true : false,
|
127
|
-
positionActionsColumn: "last",
|
128
|
-
enableColumnResizing: true,
|
129
|
-
layoutMode: "semantic",
|
130
|
-
displayColumnDefOptions: {
|
131
|
-
"mrt-row-actions": {
|
132
|
-
header: "Thao tác",
|
133
|
-
size: rowActionSize,
|
134
|
-
},
|
135
|
-
"mrt-row-numbers": {
|
136
|
-
Header: "STT",
|
137
|
-
size: 1
|
138
|
-
},
|
139
|
-
},
|
140
|
-
enableColumnPinning: true,
|
141
|
-
initialState: {
|
142
|
-
density: "md",
|
143
|
-
pagination: { pageIndex: 0, pageSize: 30 },
|
144
|
-
columnPinning: { right: ["mrt-row-actions"] },
|
145
|
-
columnVisibility: {
|
146
|
-
nguoiCapNhat: false,
|
147
|
-
ngayCapNhat: false
|
148
|
-
}
|
149
|
-
},
|
150
|
-
mantineTableHeadCellProps: {
|
151
|
-
style: {
|
152
|
-
verticalAlign: "middle",
|
153
|
-
paddingTop: "2px",
|
154
|
-
paddingBottom: "2px",
|
155
|
-
},
|
156
|
-
},
|
157
|
-
mantineTableBodyCellProps: {
|
158
|
-
style: {
|
159
|
-
paddingTop: "2px",
|
160
|
-
paddingBottom: "2px",
|
161
|
-
},
|
162
|
-
},
|
163
|
-
localization: MRT_Localization_VI,
|
164
|
-
...rest, // Override default table options
|
165
|
-
});
|
166
|
-
|
167
|
-
|
168
|
-
useEffect(() => {
|
169
|
-
setSelectedRow && setSelectedRow(table.getSelectedRowModel().rows.map((row) => row.original));
|
170
|
-
}, [table.getState().rowSelection]);
|
171
|
-
|
172
|
-
if (data == undefined) return
|
173
|
-
return (
|
174
|
-
<main style={{ position: "relative", zIndex: 1 }}>
|
175
|
-
{table.getState().isFullScreen ? (
|
176
|
-
<Portal>
|
177
|
-
<MantineReactTable table={table} />
|
178
|
-
</Portal>
|
179
|
-
) : (
|
180
|
-
<MantineReactTable table={table} />
|
181
|
-
)}
|
182
|
-
</main>
|
183
|
-
)
|
184
|
-
}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { Group, Text } from "@mantine/core";
|
2
|
-
|
3
|
-
interface MyIconTextProps {
|
4
|
-
icon?: React.ElementType;
|
5
|
-
text?: string;
|
6
|
-
}
|
7
|
-
|
8
|
-
export function MyIconText({ icon: Icon, text }: MyIconTextProps) {
|
9
|
-
return (
|
10
|
-
<Group wrap="nowrap" gap={10} mt={3}>
|
11
|
-
{Icon && <Icon stroke={1.5} size={16} />}
|
12
|
-
<Text fz="lg" c="dimmed">
|
13
|
-
{text}
|
14
|
-
</Text>
|
15
|
-
</Group>
|
16
|
-
);
|
17
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import { Group, Text } from "@mantine/core";
|
2
|
-
|
3
|
-
|
4
|
-
interface I {
|
5
|
-
keyLabel?: string,
|
6
|
-
label?: string
|
7
|
-
}
|
8
|
-
export function MyKeyLabel({ keyLabel, label }: I) {
|
9
|
-
return (
|
10
|
-
<Group gap={5}>
|
11
|
-
<Text fw={'bold'}>{keyLabel}:</Text>
|
12
|
-
<Text>{label}</Text>
|
13
|
-
</Group>
|
14
|
-
)
|
15
|
-
}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import { NumberFormatter, NumberFormatterProps } from '@mantine/core'
|
2
|
-
|
3
|
-
|
4
|
-
interface I extends NumberFormatterProps { }
|
5
|
-
export function MyNumberFormatter({ ...rest }: I) {
|
6
|
-
return (
|
7
|
-
<NumberFormatter thousandSeparator suffix=' VNĐ' {...rest}></NumberFormatter>
|
8
|
-
)
|
9
|
-
}
|
@@ -1,68 +0,0 @@
|
|
1
|
-
import { Box, Button, Flex, Group, Paper, Text } from "@mantine/core";
|
2
|
-
import { IconArrowDownRight, IconArrowUpRight } from "@tabler/icons-react";
|
3
|
-
import { ReactNode } from "react";
|
4
|
-
|
5
|
-
export function AQStatCard1(
|
6
|
-
{ title, value, unit = "", description, icons, diff }: { title: string, value: string, unit?: string, description: string, icons: ReactNode, diff: number }
|
7
|
-
) {
|
8
|
-
return (
|
9
|
-
<>
|
10
|
-
<Paper withBorder
|
11
|
-
p="md"
|
12
|
-
radius="md"
|
13
|
-
key={title}>
|
14
|
-
<Group justify="space-between">
|
15
|
-
<Flex direction={"column"}>
|
16
|
-
<Text
|
17
|
-
tt="uppercase"
|
18
|
-
size="lg"
|
19
|
-
c="dimmed"
|
20
|
-
>
|
21
|
-
{title}
|
22
|
-
</Text>
|
23
|
-
{unit == "" ?
|
24
|
-
<Text size="xs" style={{ visibility: 'hidden' }}>Đơn vị: <strong>{unit}</strong></Text>
|
25
|
-
:
|
26
|
-
<Text size="xs">Đơn vị: <strong>{unit}</strong></Text>
|
27
|
-
}
|
28
|
-
</Flex>
|
29
|
-
<Box>
|
30
|
-
{icons}
|
31
|
-
</Box>
|
32
|
-
</Group>
|
33
|
-
|
34
|
-
<Group
|
35
|
-
mt={"5"}
|
36
|
-
align="flex-end"
|
37
|
-
gap={"xs"}
|
38
|
-
>
|
39
|
-
<Text
|
40
|
-
fw={700}
|
41
|
-
fz="h1"
|
42
|
-
>{value}
|
43
|
-
</Text>
|
44
|
-
<Text
|
45
|
-
mb={"2"}
|
46
|
-
c={diff > 0 ? 'teal' : 'red'}
|
47
|
-
fz="h2"
|
48
|
-
fw={500}
|
49
|
-
>
|
50
|
-
<span>{diff}%</span>{diff > 0 ? <IconArrowUpRight /> : <IconArrowDownRight />}
|
51
|
-
</Text>
|
52
|
-
</Group>
|
53
|
-
|
54
|
-
<Group justify="space-between">
|
55
|
-
<Text tt="uppercase" fz="xs" c="dimmed">
|
56
|
-
{description}
|
57
|
-
</Text>
|
58
|
-
<Button
|
59
|
-
variant="light"
|
60
|
-
size="xs"
|
61
|
-
>
|
62
|
-
Xem chi tiết
|
63
|
-
</Button>
|
64
|
-
</Group>
|
65
|
-
</Paper>
|
66
|
-
</>
|
67
|
-
);
|
68
|
-
}
|
@@ -1,33 +0,0 @@
|
|
1
|
-
'use client';
|
2
|
-
|
3
|
-
import { useEffect } from 'react';
|
4
|
-
import { useS_BasicAppShell } from '../Layouts/BasicAppShell/useS_BasicAppShell';
|
5
|
-
|
6
|
-
export function FaviconSetter() {
|
7
|
-
const store = useS_BasicAppShell()
|
8
|
-
useEffect(() => {
|
9
|
-
if (!store.state.faviconFileDetail?.fileBase64String) return
|
10
|
-
try {
|
11
|
-
// Get base64 icon from localStorage
|
12
|
-
const base64Icon = `data:image/${store.state.faviconFileDetail.fileExtension?.replaceAll(".", "")};base64,${store.state.faviconFileDetail?.fileBase64String}`
|
13
|
-
|
14
|
-
if (base64Icon) {
|
15
|
-
// Find existing favicon or create a new link element
|
16
|
-
let link = document.querySelector("link[rel~='icon']") as HTMLLinkElement;
|
17
|
-
if (!link) {
|
18
|
-
link = document.createElement('link');
|
19
|
-
link.rel = 'icon';
|
20
|
-
document.head.appendChild(link);
|
21
|
-
}
|
22
|
-
|
23
|
-
// Set the href to the base64 data
|
24
|
-
link.href = base64Icon;
|
25
|
-
}
|
26
|
-
} catch (error) {
|
27
|
-
console.error('Error setting favicon from localStorage:', error);
|
28
|
-
}
|
29
|
-
}, [store.state.faviconFileDetail?.fileBase64String]);
|
30
|
-
|
31
|
-
// This component doesn't render anything visible
|
32
|
-
return null;
|
33
|
-
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { DateInput, DateInputProps } from '@mantine/dates';
|
2
|
-
|
3
|
-
interface IDateInput extends DateInputProps {
|
4
|
-
label?: string
|
5
|
-
}
|
6
|
-
|
7
|
-
export function MyDateInput({ label, ...rest }: IDateInput) {
|
8
|
-
return (
|
9
|
-
<DateInput label={label} placeholder={label ? `Chọn ${label?.toLowerCase()}` : ""} {...rest} />
|
10
|
-
)
|
11
|
-
}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
import { Box, Fieldset, FieldsetProps, Text } from '@mantine/core'
|
2
|
-
import { ReactNode } from 'react'
|
3
|
-
|
4
|
-
interface MyFieldsetProps extends FieldsetProps {
|
5
|
-
chilren?: ReactNode,
|
6
|
-
title?: string
|
7
|
-
}
|
8
|
-
|
9
|
-
export function MyFieldset({
|
10
|
-
children,
|
11
|
-
title,
|
12
|
-
...rest
|
13
|
-
}: MyFieldsetProps) {
|
14
|
-
return (
|
15
|
-
<Fieldset
|
16
|
-
{...rest}
|
17
|
-
legend={(
|
18
|
-
<Box
|
19
|
-
bg="blue.4"
|
20
|
-
px="xs"
|
21
|
-
py={2}
|
22
|
-
style={{ borderRadius: 4 }}
|
23
|
-
>
|
24
|
-
<Text c="white" fw={500}>
|
25
|
-
{title}
|
26
|
-
</Text>
|
27
|
-
</Box>
|
28
|
-
)}>
|
29
|
-
{children}
|
30
|
-
</Fieldset>
|
31
|
-
)
|
32
|
-
}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import { FileInput, FileInputProps } from '@mantine/core'
|
2
|
-
|
3
|
-
interface IFileInput extends FileInputProps {
|
4
|
-
label?: string
|
5
|
-
}
|
6
|
-
|
7
|
-
|
8
|
-
export function MyFileInput({ label, ...rest }: IFileInput) {
|
9
|
-
return (
|
10
|
-
<FileInput label={label} placeholder={label ? `Chọn ${label?.toLowerCase()}` : ""}{...rest} />
|
11
|
-
)
|
12
|
-
}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import { NumberInput, NumberInputProps } from '@mantine/core'
|
2
|
-
|
3
|
-
interface INumberInput extends NumberInputProps {
|
4
|
-
label?: string
|
5
|
-
}
|
6
|
-
|
7
|
-
|
8
|
-
export function MyNumberInput({ label, ...rest }: INumberInput) {
|
9
|
-
return (
|
10
|
-
<NumberInput label={label} placeholder={label ? `Nhập ${label?.toLowerCase()}` : ""}{...rest} />
|
11
|
-
)
|
12
|
-
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { Textarea, TextareaProps } from '@mantine/core';
|
2
|
-
|
3
|
-
interface IMyTextArea extends TextareaProps {
|
4
|
-
label?: string
|
5
|
-
}
|
6
|
-
|
7
|
-
export function MyTextArea({ label, ...rest }: IMyTextArea) {
|
8
|
-
return (
|
9
|
-
<Textarea label={label} placeholder={label ? `Nhập ${label?.toLowerCase()}` : ""}{...rest} />
|
10
|
-
)
|
11
|
-
}
|
@@ -1,191 +0,0 @@
|
|
1
|
-
'use client'
|
2
|
-
import { Input, MantineSize, ScrollArea } from '@mantine/core';
|
3
|
-
import { Link, RichTextEditor } from '@mantine/tiptap';
|
4
|
-
import FileHandler from '@tiptap-pro/extension-file-handler';
|
5
|
-
import Highlight from '@tiptap/extension-highlight';
|
6
|
-
import Image from '@tiptap/extension-image';
|
7
|
-
import SubScript from '@tiptap/extension-subscript';
|
8
|
-
import Superscript from '@tiptap/extension-superscript';
|
9
|
-
import TextAlign from '@tiptap/extension-text-align';
|
10
|
-
import Underline from '@tiptap/extension-underline';
|
11
|
-
import { EditorOptions, useEditor } from '@tiptap/react';
|
12
|
-
import StarterKit from '@tiptap/starter-kit';
|
13
|
-
import { useEffect, useState } from 'react';
|
14
|
-
export interface IMyTextEditor extends Partial<EditorOptions> {
|
15
|
-
label?: string,
|
16
|
-
error?: string,
|
17
|
-
value?: string,
|
18
|
-
onChange?: any,
|
19
|
-
contentHeight?: MantineSize | string,
|
20
|
-
autoHiddenToolBar?: boolean
|
21
|
-
withAsterisk?: boolean
|
22
|
-
}
|
23
|
-
|
24
|
-
|
25
|
-
export function MyTextEditor({
|
26
|
-
autoHiddenToolBar = false,
|
27
|
-
contentHeight = "400px",
|
28
|
-
onChange,
|
29
|
-
value,
|
30
|
-
error,
|
31
|
-
label,
|
32
|
-
withAsterisk,
|
33
|
-
...rest
|
34
|
-
}:
|
35
|
-
IMyTextEditor) {
|
36
|
-
const [hiddenToolBar, setHiddenToolBar] = useState(autoHiddenToolBar)
|
37
|
-
const editor = useEditor({
|
38
|
-
extensions: [
|
39
|
-
StarterKit,
|
40
|
-
Underline,
|
41
|
-
Link,
|
42
|
-
Superscript,
|
43
|
-
SubScript,
|
44
|
-
Highlight,
|
45
|
-
Image.extend({
|
46
|
-
addAttributes() {
|
47
|
-
return {
|
48
|
-
src: {
|
49
|
-
default: null,
|
50
|
-
},
|
51
|
-
alt: {
|
52
|
-
default: null,
|
53
|
-
},
|
54
|
-
};
|
55
|
-
},
|
56
|
-
parseHTML() {
|
57
|
-
return [
|
58
|
-
{
|
59
|
-
tag: 'img[src]',
|
60
|
-
},
|
61
|
-
];
|
62
|
-
},
|
63
|
-
renderHTML({ HTMLAttributes }) {
|
64
|
-
return ['img', HTMLAttributes];
|
65
|
-
},
|
66
|
-
}),
|
67
|
-
TextAlign.configure({ types: ['heading', 'paragraph'] }),
|
68
|
-
FileHandler.configure({
|
69
|
-
allowedMimeTypes: ['image/png', 'image/jpeg', 'image/gif', 'image/webp'],
|
70
|
-
onDrop: (currentEditor, files, pos) => {
|
71
|
-
files.forEach(file => {
|
72
|
-
const fileReader = new FileReader()
|
73
|
-
|
74
|
-
fileReader.readAsDataURL(file)
|
75
|
-
fileReader.onload = () => {
|
76
|
-
currentEditor.chain().insertContentAt(pos, {
|
77
|
-
type: 'image',
|
78
|
-
attrs: {
|
79
|
-
src: fileReader.result,
|
80
|
-
},
|
81
|
-
}).focus().run()
|
82
|
-
}
|
83
|
-
})
|
84
|
-
},
|
85
|
-
onPaste: (currentEditor, files, htmlContent) => {
|
86
|
-
files.forEach(file => {
|
87
|
-
if (htmlContent) {
|
88
|
-
console.log(htmlContent)
|
89
|
-
return false
|
90
|
-
}
|
91
|
-
const fileReader = new FileReader()
|
92
|
-
fileReader.readAsDataURL(file)
|
93
|
-
fileReader.onload = () => {
|
94
|
-
currentEditor.chain().insertContentAt(currentEditor.state.selection.anchor, {
|
95
|
-
type: 'image',
|
96
|
-
attrs: {
|
97
|
-
src: fileReader.result,
|
98
|
-
},
|
99
|
-
}).focus().run()
|
100
|
-
}
|
101
|
-
})
|
102
|
-
},
|
103
|
-
}),
|
104
|
-
],
|
105
|
-
content: value,
|
106
|
-
onUpdate: ({ editor }) => {
|
107
|
-
const content = editor.getHTML();
|
108
|
-
if (content === '<p></p>') {
|
109
|
-
onChange('');
|
110
|
-
} else {
|
111
|
-
onChange(content);
|
112
|
-
}
|
113
|
-
},
|
114
|
-
...rest,
|
115
|
-
|
116
|
-
});
|
117
|
-
useEffect(() => {
|
118
|
-
if (editor && value !== editor.getHTML()) {
|
119
|
-
editor.commands.setContent(value!);
|
120
|
-
}
|
121
|
-
}, [value, editor]);
|
122
|
-
return (
|
123
|
-
|
124
|
-
<Input.Wrapper label={label} flex={1} error={error} withAsterisk={withAsterisk}>
|
125
|
-
<RichTextEditor editor={editor} style={{ border: error && '1px solid #e03131', }}>
|
126
|
-
<RichTextEditor.Toolbar hidden={hiddenToolBar} sticky stickyOffset={60}>
|
127
|
-
<RichTextEditor.ControlsGroup>
|
128
|
-
<RichTextEditor.Bold />
|
129
|
-
<RichTextEditor.Italic />
|
130
|
-
<RichTextEditor.Underline />
|
131
|
-
<RichTextEditor.Strikethrough />
|
132
|
-
<RichTextEditor.ClearFormatting />
|
133
|
-
<RichTextEditor.Highlight />
|
134
|
-
<RichTextEditor.Code />
|
135
|
-
</RichTextEditor.ControlsGroup>
|
136
|
-
|
137
|
-
<RichTextEditor.ControlsGroup>
|
138
|
-
<RichTextEditor.H1 />
|
139
|
-
<RichTextEditor.H2 />
|
140
|
-
<RichTextEditor.H3 />
|
141
|
-
<RichTextEditor.H4 />
|
142
|
-
</RichTextEditor.ControlsGroup>
|
143
|
-
|
144
|
-
<RichTextEditor.ControlsGroup>
|
145
|
-
<RichTextEditor.Blockquote />
|
146
|
-
<RichTextEditor.Hr />
|
147
|
-
<RichTextEditor.BulletList />
|
148
|
-
<RichTextEditor.OrderedList />
|
149
|
-
<RichTextEditor.Subscript />
|
150
|
-
<RichTextEditor.Superscript />
|
151
|
-
</RichTextEditor.ControlsGroup>
|
152
|
-
|
153
|
-
<RichTextEditor.ControlsGroup>
|
154
|
-
<RichTextEditor.Link />
|
155
|
-
<RichTextEditor.Unlink />
|
156
|
-
</RichTextEditor.ControlsGroup>
|
157
|
-
|
158
|
-
<RichTextEditor.ControlsGroup>
|
159
|
-
<RichTextEditor.AlignLeft />
|
160
|
-
<RichTextEditor.AlignCenter />
|
161
|
-
<RichTextEditor.AlignJustify />
|
162
|
-
<RichTextEditor.AlignRight />
|
163
|
-
</RichTextEditor.ControlsGroup>
|
164
|
-
|
165
|
-
{/* <RichTextEditor.ControlsGroup>
|
166
|
-
<RichTextEditor.Undo />
|
167
|
-
<RichTextEditor.Redo />
|
168
|
-
</RichTextEditor.ControlsGroup> */}
|
169
|
-
</RichTextEditor.Toolbar>
|
170
|
-
|
171
|
-
<ScrollArea.Autosize
|
172
|
-
onMouseDown={() => {
|
173
|
-
editor?.commands.focus();
|
174
|
-
}}
|
175
|
-
onBlur={() => {
|
176
|
-
if (autoHiddenToolBar == false) return
|
177
|
-
setHiddenToolBar(true);
|
178
|
-
}}
|
179
|
-
onFocus={() => {
|
180
|
-
if (autoHiddenToolBar == false) return
|
181
|
-
setHiddenToolBar(false);
|
182
|
-
}}
|
183
|
-
style={{ cursor: "text", maxHeight: "400px" }}
|
184
|
-
>
|
185
|
-
<RichTextEditor.Content mih={contentHeight} />
|
186
|
-
</ScrollArea.Autosize>
|
187
|
-
|
188
|
-
</RichTextEditor>
|
189
|
-
</Input.Wrapper>
|
190
|
-
);
|
191
|
-
}
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import { TextInput, TextInputProps } from '@mantine/core';
|
2
|
-
|
3
|
-
interface IMyTextInput extends TextInputProps {
|
4
|
-
label?: string; defaultValue?: string,
|
5
|
-
isPhoneNumber?: boolean
|
6
|
-
}
|
7
|
-
|
8
|
-
export function MyTextInput({ label, defaultValue, isPhoneNumber, ...rest }: IMyTextInput) {
|
9
|
-
return (
|
10
|
-
<TextInput
|
11
|
-
onKeyDown={(e) => {
|
12
|
-
if (!isPhoneNumber) return
|
13
|
-
const allowedKeys = [
|
14
|
-
"Backspace", "Tab", "ArrowLeft", "ArrowRight", "Delete",
|
15
|
-
"+", "-", "(", ")", " ", // các ký tự đặc biệt cho số điện thoại
|
16
|
-
]
|
17
|
-
if (
|
18
|
-
!/[0-9]/.test(e.key) &&
|
19
|
-
!allowedKeys.includes(e.key)
|
20
|
-
) {
|
21
|
-
e.preventDefault()
|
22
|
-
}
|
23
|
-
}}
|
24
|
-
label={label}
|
25
|
-
defaultValue={defaultValue}
|
26
|
-
placeholder={label ? `Nhập ${label?.toLowerCase()}` : ""}
|
27
|
-
{...rest}
|
28
|
-
/>
|
29
|
-
)
|
30
|
-
}
|