aq-fe-framework 0.1.578 → 0.1.579
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/IPagePermission-992CbJhp.d.mts +11 -0
- package/dist/{chunk-26ONMI7V.mjs → chunk-FJ4J7EFI.mjs} +1 -1
- package/dist/{chunk-U62R2QKJ.mjs → chunk-PW6WTEVB.mjs} +12 -1
- package/dist/{chunk-NJD4YEJM.mjs → chunk-SSS6YVKX.mjs} +1 -1
- package/dist/{chunk-BTLOCUVO.mjs → chunk-T3XO7B4F.mjs} +45 -8
- package/dist/components/index.d.mts +6 -1
- package/dist/components/index.mjs +6 -2
- package/dist/core/index.mjs +4 -4
- package/dist/coreService/index.mjs +3 -3
- package/dist/interfaces/index.d.mts +2 -11
- package/dist/modules-features/index.d.mts +2 -0
- package/dist/modules-features/index.mjs +51 -24
- package/dist/stores/index.d.mts +12 -1
- package/dist/stores/index.mjs +5 -3
- package/package.json +1 -1
|
@@ -66,7 +66,18 @@ function createStateStore({
|
|
|
66
66
|
return store;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
// src/stores/useStore_Permission.ts
|
|
70
|
+
var useStore = createGenericStore({
|
|
71
|
+
initialState: {},
|
|
72
|
+
storageKey: "useStore_Permission"
|
|
73
|
+
});
|
|
74
|
+
function useStore_Permission() {
|
|
75
|
+
const store = useStore();
|
|
76
|
+
return __spreadValues({}, store);
|
|
77
|
+
}
|
|
78
|
+
|
|
69
79
|
export {
|
|
70
80
|
createGenericStore,
|
|
71
|
-
createStateStore
|
|
81
|
+
createStateStore,
|
|
82
|
+
useStore_Permission
|
|
72
83
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
createGenericStore
|
|
3
|
-
|
|
2
|
+
createGenericStore,
|
|
3
|
+
useStore_Permission
|
|
4
|
+
} from "./chunk-PW6WTEVB.mjs";
|
|
4
5
|
import {
|
|
5
6
|
utils_pdf_download
|
|
6
7
|
} from "./chunk-5U2JSHSJ.mjs";
|
|
@@ -7221,6 +7222,29 @@ import {
|
|
|
7221
7222
|
import Link3 from "next/link";
|
|
7222
7223
|
import { usePathname as usePathname2 } from "next/navigation";
|
|
7223
7224
|
import { useEffect as useEffect10, useMemo as useMemo3, useState as useState10 } from "react";
|
|
7225
|
+
|
|
7226
|
+
// src/components/Layouts/BasicAppShell/utils/filterMenuWithPermission.ts
|
|
7227
|
+
function getReadablePageIdSet(permissions) {
|
|
7228
|
+
return new Set(
|
|
7229
|
+
permissions.filter((p5) => p5.isRead && p5.pageId !== void 0).map((p5) => p5.pageId)
|
|
7230
|
+
);
|
|
7231
|
+
}
|
|
7232
|
+
function filterMenuByPermission(menuList, readablePageIds) {
|
|
7233
|
+
return menuList.map((menu) => {
|
|
7234
|
+
if (menu.links && Array.isArray(menu.links)) {
|
|
7235
|
+
const filteredLinks = filterMenuByPermission(menu.links, readablePageIds);
|
|
7236
|
+
if (filteredLinks.length > 0) {
|
|
7237
|
+
return __spreadProps(__spreadValues({}, menu), { links: filteredLinks });
|
|
7238
|
+
}
|
|
7239
|
+
}
|
|
7240
|
+
if (menu.pageId !== void 0 && readablePageIds.has(menu.pageId)) {
|
|
7241
|
+
return menu;
|
|
7242
|
+
}
|
|
7243
|
+
return null;
|
|
7244
|
+
}).filter((item) => item !== null);
|
|
7245
|
+
}
|
|
7246
|
+
|
|
7247
|
+
// src/components/Layouts/BasicAppShell/BasicAppShell.tsx
|
|
7224
7248
|
import { Fragment as Fragment12, jsx as jsx52, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
7225
7249
|
function findBreadcrumbPath(items, currentPath, parents = []) {
|
|
7226
7250
|
for (const item of items) {
|
|
@@ -7358,10 +7382,15 @@ function BasicAppShell_transformMenuToEnum(prefixProjectName, menu) {
|
|
|
7358
7382
|
function BasicAppShell({ children, menu, extraTopRight, title, logoutRedirect }) {
|
|
7359
7383
|
var _a, _b;
|
|
7360
7384
|
const pathName = usePathname2();
|
|
7385
|
+
const permissionStore = useStore_Permission();
|
|
7361
7386
|
const basicAppShellStore = useS_BasicAppShell();
|
|
7387
|
+
const readablePageIds = getReadablePageIdSet(permissionStore.state.permission || []);
|
|
7388
|
+
const filteredMenu = filterMenuByPermission(menu, readablePageIds);
|
|
7362
7389
|
const media = useMediaQuery("(min-width: 72em)");
|
|
7363
7390
|
const GetAQModule_query = useQ_AQ_GetAQModule();
|
|
7364
7391
|
const BasicAppShell_store = useS_BasicAppShell();
|
|
7392
|
+
const isLoadingPermission = useState10(true);
|
|
7393
|
+
const isAccessibleState = useState10(false);
|
|
7365
7394
|
const [faviconUrl, setFaviconUrl] = useState10("");
|
|
7366
7395
|
const allChildItems = useMemo3(() => {
|
|
7367
7396
|
const result = [];
|
|
@@ -7375,9 +7404,9 @@ function BasicAppShell({ children, menu, extraTopRight, title, logoutRedirect })
|
|
|
7375
7404
|
}
|
|
7376
7405
|
});
|
|
7377
7406
|
};
|
|
7378
|
-
extractChildren(
|
|
7407
|
+
extractChildren(filteredMenu);
|
|
7379
7408
|
return result;
|
|
7380
|
-
}, [
|
|
7409
|
+
}, [filteredMenu]);
|
|
7381
7410
|
useFavicon(faviconUrl);
|
|
7382
7411
|
useEffect10(() => {
|
|
7383
7412
|
var _a2;
|
|
@@ -7408,12 +7437,15 @@ function BasicAppShell({ children, menu, extraTopRight, title, logoutRedirect })
|
|
|
7408
7437
|
}, [GetAQModule_query.data]);
|
|
7409
7438
|
useEffect10(() => {
|
|
7410
7439
|
const linkItem = allChildItems.find((item) => pathName.includes(item.link));
|
|
7411
|
-
const breadcrumb = findBreadcrumbPath(
|
|
7440
|
+
const breadcrumb = findBreadcrumbPath(filteredMenu, linkItem == null ? void 0 : linkItem.link);
|
|
7441
|
+
basicAppShellStore.setProperty("currentPageId", linkItem == null ? void 0 : linkItem.pageId);
|
|
7442
|
+
isAccessibleState[1]((linkItem == null ? void 0 : linkItem.pageId) ? readablePageIds.has(linkItem.pageId) : false);
|
|
7412
7443
|
basicAppShellStore.setProperty("breadcrumb", breadcrumb);
|
|
7413
7444
|
basicAppShellStore.setProperty("title", linkItem == null ? void 0 : linkItem.label);
|
|
7414
7445
|
basicAppShellStore.setProperty("menuCode", linkItem == null ? void 0 : linkItem.link);
|
|
7415
7446
|
basicAppShellStore.setProperty("note", linkItem == null ? void 0 : linkItem.note);
|
|
7416
7447
|
basicAppShellStore.setProperty("status", linkItem == null ? void 0 : linkItem.status);
|
|
7448
|
+
isLoadingPermission[1](false);
|
|
7417
7449
|
}, [pathName]);
|
|
7418
7450
|
return /* @__PURE__ */ jsxs29(
|
|
7419
7451
|
AppShell,
|
|
@@ -7494,8 +7526,8 @@ function BasicAppShell({ children, menu, extraTopRight, title, logoutRedirect })
|
|
|
7494
7526
|
] })
|
|
7495
7527
|
) }),
|
|
7496
7528
|
/* @__PURE__ */ jsxs29(AppShell.Navbar, { children: [
|
|
7497
|
-
/* @__PURE__ */ jsx52(MyAppSpotlight, { menu }),
|
|
7498
|
-
/* @__PURE__ */ jsx52(AppShell.Section, { grow: true, component: ScrollArea3, p: 5, children: /* @__PURE__ */ jsx52(RenderNavLinks, { items:
|
|
7529
|
+
/* @__PURE__ */ jsx52(MyAppSpotlight, { menu: filteredMenu }),
|
|
7530
|
+
/* @__PURE__ */ jsx52(AppShell.Section, { grow: true, component: ScrollArea3, p: 5, children: /* @__PURE__ */ jsx52(RenderNavLinks, { items: filteredMenu }) }),
|
|
7499
7531
|
/* @__PURE__ */ jsxs29(AppShell.Section, { px: "md", children: [
|
|
7500
7532
|
/* @__PURE__ */ jsx52(Divider2, {}),
|
|
7501
7533
|
/* @__PURE__ */ jsx52(F_authenticate_Logout, { redirectURL: logoutRedirect }),
|
|
@@ -7527,7 +7559,10 @@ function BasicAppShell({ children, menu, extraTopRight, title, logoutRedirect })
|
|
|
7527
7559
|
AppShell.Main,
|
|
7528
7560
|
{
|
|
7529
7561
|
bg: "light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-8))",
|
|
7530
|
-
children
|
|
7562
|
+
children: isLoadingPermission[0] ? /* @__PURE__ */ jsx52("div", { style: { padding: "2rem", textAlign: "center" }, children: /* @__PURE__ */ jsx52(Text15, { fw: 600, size: "md", children: "\u0110ang t\u1EA3i quy\u1EC1n truy c\u1EADp..." }) }) : isAccessibleState[0] ? children : /* @__PURE__ */ jsxs29("div", { style: { padding: "2rem", textAlign: "center" }, children: [
|
|
7563
|
+
/* @__PURE__ */ jsx52("h1", { children: "404 - Kh\xF4ng t\xECm th\u1EA5y trang" }),
|
|
7564
|
+
/* @__PURE__ */ jsx52("p", { children: "B\u1EA1n kh\xF4ng c\xF3 quy\u1EC1n truy c\u1EADp ho\u1EB7c \u0111\u01B0\u1EDDng d\u1EABn kh\xF4ng t\u1ED3n t\u1EA1i." })
|
|
7565
|
+
] })
|
|
7531
7566
|
}
|
|
7532
7567
|
)
|
|
7533
7568
|
]
|
|
@@ -7966,6 +8001,8 @@ export {
|
|
|
7966
8001
|
MyTextEditor,
|
|
7967
8002
|
useS_authenticate,
|
|
7968
8003
|
F_authenticate_Logout,
|
|
8004
|
+
getReadablePageIdSet,
|
|
8005
|
+
filterMenuByPermission,
|
|
7969
8006
|
flattenMenuGroups,
|
|
7970
8007
|
BasicAppShell_transformMenuToEnum,
|
|
7971
8008
|
BasicAppShell,
|
|
@@ -15,6 +15,7 @@ import { DateInputProps } from '@mantine/dates';
|
|
|
15
15
|
import { RichTextEditorProps } from '@mantine/tiptap';
|
|
16
16
|
import { EditorOptions } from '@tiptap/react';
|
|
17
17
|
import { I as IAQFileDetail } from '../utils_file-D9Yd0c4T.mjs';
|
|
18
|
+
import { I as IPagePermission } from '../IPagePermission-992CbJhp.mjs';
|
|
18
19
|
import { IconProps, Icon } from '@tabler/icons-react';
|
|
19
20
|
import { CalendarEventExternal } from '@schedule-x/calendar';
|
|
20
21
|
import '../type_mutation-C-DWQOlQ.mjs';
|
|
@@ -405,6 +406,7 @@ interface I$2 {
|
|
|
405
406
|
moduleName?: string;
|
|
406
407
|
logoFileDetail?: IAQFileDetail;
|
|
407
408
|
faviconFileDetail?: IAQFileDetail;
|
|
409
|
+
currentPageId?: number;
|
|
408
410
|
opened: boolean;
|
|
409
411
|
title: string;
|
|
410
412
|
note?: string;
|
|
@@ -424,6 +426,9 @@ declare function useS_BasicAppShell(): {
|
|
|
424
426
|
resetState: () => void;
|
|
425
427
|
};
|
|
426
428
|
|
|
429
|
+
declare function getReadablePageIdSet(permissions: IPagePermission[]): Set<number>;
|
|
430
|
+
declare function filterMenuByPermission(menuList: I_BasicAppShell_LinkItem[], readablePageIds: Set<number>): I_BasicAppShell_LinkItem[];
|
|
431
|
+
|
|
427
432
|
interface I$1 extends ContainerProps {
|
|
428
433
|
children?: ReactNode;
|
|
429
434
|
}
|
|
@@ -534,4 +539,4 @@ interface IMySkeletonTable extends SkeletonProps {
|
|
|
534
539
|
}
|
|
535
540
|
declare function MySkeletonTable({ h }: IMySkeletonTable): react_jsx_runtime.JSX.Element;
|
|
536
541
|
|
|
537
|
-
export { AQButtonCreateByImportFile, AQButtonExportData, AQCard, AQSelectTableByOpenModal, AQStatCard1, AQStatCard2, Boxes, FaviconSetter, HeaderMegaMenu, type IAQCardProps, type IMyTextEditor, I_BasicAppShell_LinkItem, MyActionIcon, MyActionIconCheck, MyActionIconDelete, MyActionIconDownloadPDF, MyActionIconModal, MyActionIconUpdate, MyActionIconUpload, MyActionIconViewPDF, MyAnchorViewPDF, MyAppSpotlight, MyBoxesBackground, MyBoxesCore, MyButton, MyButtonCreate, MyButtonDeleteList, MyButtonImport, MyButtonModal, MyButtonPrintPDF, MyButtonPrintTablePDF, MyButtonRouterBack, MyButtonViewPDF, MyCalendar, MyCardInformation, MyCardioLoader, MyCenterFull, MyCheckbox, MyContainer, MyDataTable, type MyDataTableInternalProps, type MyDataTableProps, MyDataTableSelect, MyDateInput, MyFieldset, MyFileInput, MyFlexColumn, MyFlexEnd, MyFlexRow, MyHtmlWrapper, MyIconText, MyNumberFormatter, MyNumberInput, MyPageContent, MyScheduleX, MySelect, MySelectAPIGet, MySkeletonTable, MySwitchTheme, MyTab, MyTextArea, MyTextEditor, MyTextInput, SelectFieldModal, SelectFileModal, type SelectFileModalProps, useHeaderMegaMenuStore, useS_BasicAppShell, useS_ButtonImport };
|
|
542
|
+
export { AQButtonCreateByImportFile, AQButtonExportData, AQCard, AQSelectTableByOpenModal, AQStatCard1, AQStatCard2, Boxes, FaviconSetter, HeaderMegaMenu, type IAQCardProps, type IMyTextEditor, I_BasicAppShell_LinkItem, MyActionIcon, MyActionIconCheck, MyActionIconDelete, MyActionIconDownloadPDF, MyActionIconModal, MyActionIconUpdate, MyActionIconUpload, MyActionIconViewPDF, MyAnchorViewPDF, MyAppSpotlight, MyBoxesBackground, MyBoxesCore, MyButton, MyButtonCreate, MyButtonDeleteList, MyButtonImport, MyButtonModal, MyButtonPrintPDF, MyButtonPrintTablePDF, MyButtonRouterBack, MyButtonViewPDF, MyCalendar, MyCardInformation, MyCardioLoader, MyCenterFull, MyCheckbox, MyContainer, MyDataTable, type MyDataTableInternalProps, type MyDataTableProps, MyDataTableSelect, MyDateInput, MyFieldset, MyFileInput, MyFlexColumn, MyFlexEnd, MyFlexRow, MyHtmlWrapper, MyIconText, MyNumberFormatter, MyNumberInput, MyPageContent, MyScheduleX, MySelect, MySelectAPIGet, MySkeletonTable, MySwitchTheme, MyTab, MyTextArea, MyTextEditor, MyTextInput, SelectFieldModal, SelectFileModal, type SelectFileModalProps, filterMenuByPermission, getReadablePageIdSet, useHeaderMegaMenuStore, useS_BasicAppShell, useS_ButtonImport };
|
|
@@ -61,14 +61,16 @@ import {
|
|
|
61
61
|
MyTextInput,
|
|
62
62
|
SelectFieldModal,
|
|
63
63
|
SelectFileModal,
|
|
64
|
+
filterMenuByPermission,
|
|
64
65
|
flattenMenuGroups,
|
|
66
|
+
getReadablePageIdSet,
|
|
65
67
|
groupToTwoLevels,
|
|
66
68
|
useHeaderMegaMenuStore,
|
|
67
69
|
useS_BasicAppShell,
|
|
68
70
|
useS_ButtonImport,
|
|
69
71
|
utils_layout_getItemsWithoutLinks
|
|
70
|
-
} from "../chunk-
|
|
71
|
-
import "../chunk-
|
|
72
|
+
} from "../chunk-T3XO7B4F.mjs";
|
|
73
|
+
import "../chunk-PW6WTEVB.mjs";
|
|
72
74
|
import "../chunk-5U2JSHSJ.mjs";
|
|
73
75
|
import "../chunk-OMJJAHOC.mjs";
|
|
74
76
|
import "../chunk-I6PPEZBF.mjs";
|
|
@@ -138,7 +140,9 @@ export {
|
|
|
138
140
|
MyTextInput,
|
|
139
141
|
SelectFieldModal,
|
|
140
142
|
SelectFileModal,
|
|
143
|
+
filterMenuByPermission,
|
|
141
144
|
flattenMenuGroups,
|
|
145
|
+
getReadablePageIdSet,
|
|
142
146
|
groupToTwoLevels,
|
|
143
147
|
useHeaderMegaMenuStore,
|
|
144
148
|
useS_BasicAppShell,
|
package/dist/core/index.mjs
CHANGED
|
@@ -22,13 +22,13 @@ import {
|
|
|
22
22
|
MyStatsCard,
|
|
23
23
|
MyTextInput,
|
|
24
24
|
MyWeeklySessionSchedulerPicker
|
|
25
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-SSS6YVKX.mjs";
|
|
26
26
|
import "../chunk-GFEMKKFH.mjs";
|
|
27
27
|
import {
|
|
28
28
|
MyModalDelete
|
|
29
|
-
} from "../chunk-
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
29
|
+
} from "../chunk-FJ4J7EFI.mjs";
|
|
30
|
+
import "../chunk-T3XO7B4F.mjs";
|
|
31
|
+
import "../chunk-PW6WTEVB.mjs";
|
|
32
32
|
import "../chunk-5U2JSHSJ.mjs";
|
|
33
33
|
import "../chunk-OMJJAHOC.mjs";
|
|
34
34
|
import "../chunk-K6S7R6LU.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MyModalDelete
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-FJ4J7EFI.mjs";
|
|
4
|
+
import "../chunk-T3XO7B4F.mjs";
|
|
5
|
+
import "../chunk-PW6WTEVB.mjs";
|
|
6
6
|
import "../chunk-5U2JSHSJ.mjs";
|
|
7
7
|
import "../chunk-OMJJAHOC.mjs";
|
|
8
8
|
import {
|
|
@@ -2,6 +2,7 @@ import { I as IBaseEntity } from '../IBaseEntity-ChMy9RzQ.mjs';
|
|
|
2
2
|
import { I as IAQFileDetail } from '../utils_file-D9Yd0c4T.mjs';
|
|
3
3
|
export { I as IAQModule } from '../IAQModule-4U3n2emx.mjs';
|
|
4
4
|
export { I as IEmailConfig } from '../IEmailConfig-CioPObC1.mjs';
|
|
5
|
+
export { I as IPagePermission } from '../IPagePermission-992CbJhp.mjs';
|
|
5
6
|
|
|
6
7
|
interface IAccount extends IBaseEntity {
|
|
7
8
|
password?: string;
|
|
@@ -55,16 +56,6 @@ interface IDocumentAttribute {
|
|
|
55
56
|
isEnabled?: boolean;
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
interface IPagePermission {
|
|
59
|
-
pageId?: number;
|
|
60
|
-
isCreate?: boolean;
|
|
61
|
-
isUpdate?: boolean;
|
|
62
|
-
isDelete?: boolean;
|
|
63
|
-
isRead?: boolean;
|
|
64
|
-
isPrint?: boolean;
|
|
65
|
-
isExport?: boolean;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
59
|
interface IRole extends IBaseEntity {
|
|
69
60
|
isCreate?: boolean;
|
|
70
61
|
isUpdate?: boolean;
|
|
@@ -86,4 +77,4 @@ interface IPageContent extends IBaseEntity {
|
|
|
86
77
|
description?: string;
|
|
87
78
|
}
|
|
88
79
|
|
|
89
|
-
export { type IAccount, IBaseEntity, type IDocument, type IDocumentAttribute, type IFile, type IPageContent, type
|
|
80
|
+
export { type IAccount, IBaseEntity, type IDocument, type IDocumentAttribute, type IFile, type IPageContent, type IRole, type IUser };
|
|
@@ -4,6 +4,7 @@ import { I as IBaseEntity } from '../IBaseEntity-ChMy9RzQ.mjs';
|
|
|
4
4
|
import { SelectProps, ButtonProps } from '@mantine/core';
|
|
5
5
|
import { I as IEmailConfig } from '../IEmailConfig-CioPObC1.mjs';
|
|
6
6
|
import { I as IAQModule } from '../IAQModule-4U3n2emx.mjs';
|
|
7
|
+
import { I as IPagePermission } from '../IPagePermission-992CbJhp.mjs';
|
|
7
8
|
import { ReactNode } from 'react';
|
|
8
9
|
|
|
9
10
|
declare function Feat_accessControl({ menuData }: {
|
|
@@ -933,6 +934,7 @@ interface IData {
|
|
|
933
934
|
userFullName?: string;
|
|
934
935
|
token?: string;
|
|
935
936
|
roleIds?: number[];
|
|
937
|
+
permissions?: IPagePermission[];
|
|
936
938
|
}
|
|
937
939
|
interface IResponseData {
|
|
938
940
|
data?: IData;
|
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
MyButton as MyButton2,
|
|
16
16
|
MyDataTableSelectOne,
|
|
17
17
|
MyTextInput as MyTextInput2
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-SSS6YVKX.mjs";
|
|
19
19
|
import {
|
|
20
20
|
const_object_documentTypes
|
|
21
21
|
} from "../chunk-GFEMKKFH.mjs";
|
|
22
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-FJ4J7EFI.mjs";
|
|
23
23
|
import {
|
|
24
24
|
F_authenticate_Logout,
|
|
25
25
|
MyActionIconDelete,
|
|
@@ -45,10 +45,11 @@ import {
|
|
|
45
45
|
groupToTwoLevels,
|
|
46
46
|
useS_authenticate,
|
|
47
47
|
utils_layout_getItemsWithoutLinks
|
|
48
|
-
} from "../chunk-
|
|
48
|
+
} from "../chunk-T3XO7B4F.mjs";
|
|
49
49
|
import {
|
|
50
|
-
createGenericStore
|
|
51
|
-
|
|
50
|
+
createGenericStore,
|
|
51
|
+
useStore_Permission
|
|
52
|
+
} from "../chunk-PW6WTEVB.mjs";
|
|
52
53
|
import "../chunk-5U2JSHSJ.mjs";
|
|
53
54
|
import {
|
|
54
55
|
const_object_colors
|
|
@@ -80,6 +81,9 @@ import {
|
|
|
80
81
|
// src/api/services/service_account.ts
|
|
81
82
|
var CONTROLLER = "/account";
|
|
82
83
|
var service_account = __spreadProps(__spreadValues({}, createBaseApi(CONTROLLER, baseAxios_default)), {
|
|
84
|
+
signIn: (values) => {
|
|
85
|
+
return baseAxios_default.post(CONTROLLER + `/SignIn`, { values });
|
|
86
|
+
},
|
|
83
87
|
getAdminAccount: (paging) => {
|
|
84
88
|
return baseAxios_default.get(CONTROLLER + `/GetAdminAccount`, {
|
|
85
89
|
params: paging
|
|
@@ -3877,7 +3881,7 @@ function F_documentCategories_Select(_a) {
|
|
|
3877
3881
|
}
|
|
3878
3882
|
|
|
3879
3883
|
// src/modules-features/admin/core/formTemplateDocs/F_formTemplateDocs.tsx
|
|
3880
|
-
import {
|
|
3884
|
+
import { Space as Space4 } from "@mantine/core";
|
|
3881
3885
|
|
|
3882
3886
|
// src/api/services/service_document.ts
|
|
3883
3887
|
var CONTROLLER5 = "/Document";
|
|
@@ -4086,7 +4090,14 @@ function F_formTemplateDocs_Read({ FormTypeId }) {
|
|
|
4086
4090
|
return /* @__PURE__ */ jsx77(Skeleton5, { h: 500, visible: documentAttributeQuery.isLoading, children: /* @__PURE__ */ jsx77(MyFlexColumn, { children: /* @__PURE__ */ jsx77(
|
|
4087
4091
|
Accordion4,
|
|
4088
4092
|
{
|
|
4089
|
-
variant: "
|
|
4093
|
+
variant: "separated",
|
|
4094
|
+
radius: "sm",
|
|
4095
|
+
styles: {
|
|
4096
|
+
item: {
|
|
4097
|
+
backgroundColor: "white",
|
|
4098
|
+
border: "1px solid #e9ecef"
|
|
4099
|
+
}
|
|
4100
|
+
},
|
|
4090
4101
|
defaultValue: (_b = documentAttributeQuery.data) == null ? void 0 : _b.map(
|
|
4091
4102
|
(item) => {
|
|
4092
4103
|
var _a2;
|
|
@@ -4171,11 +4182,11 @@ function SubRead4({
|
|
|
4171
4182
|
}
|
|
4172
4183
|
|
|
4173
4184
|
// src/modules-features/admin/core/formTemplateDocs/F_formTemplateDocs.tsx
|
|
4174
|
-
import { jsx as jsx78, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
4185
|
+
import { Fragment, jsx as jsx78, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
4175
4186
|
function F_formTemplateDocs({
|
|
4176
4187
|
FormTypeId
|
|
4177
4188
|
}) {
|
|
4178
|
-
return /* @__PURE__ */ jsxs49(
|
|
4189
|
+
return /* @__PURE__ */ jsxs49(Fragment, { children: [
|
|
4179
4190
|
/* @__PURE__ */ jsx78(MyFlexEnd, { children: /* @__PURE__ */ jsx78(F_formTemplateDocs_Create, { FormTypeId }) }),
|
|
4180
4191
|
/* @__PURE__ */ jsx78(Space4, {}),
|
|
4181
4192
|
/* @__PURE__ */ jsx78(F_formTemplateDocs_Read, { FormTypeId })
|
|
@@ -4386,7 +4397,7 @@ function F_mailConfig() {
|
|
|
4386
4397
|
import { useEffect as useEffect11 } from "react";
|
|
4387
4398
|
|
|
4388
4399
|
// src/modules-features/admin/core/moduleConfig/F_moduleConfig_Form.tsx
|
|
4389
|
-
import { Center as Center2, Grid as Grid6, Image, Paper as
|
|
4400
|
+
import { Center as Center2, Grid as Grid6, Image, Paper as Paper7 } from "@mantine/core";
|
|
4390
4401
|
import { useForm as useForm24 } from "@mantine/form";
|
|
4391
4402
|
import { useEffect as useEffect10 } from "react";
|
|
4392
4403
|
|
|
@@ -4501,7 +4512,7 @@ function F_moduleConfig_Form() {
|
|
|
4501
4512
|
form.setValues(values);
|
|
4502
4513
|
}
|
|
4503
4514
|
}, []);
|
|
4504
|
-
return /* @__PURE__ */ jsxs52(
|
|
4515
|
+
return /* @__PURE__ */ jsxs52(Paper7, { p: "md", children: [
|
|
4505
4516
|
/* @__PURE__ */ jsxs52(Grid6, { children: [
|
|
4506
4517
|
/* @__PURE__ */ jsx84(Grid6.Col, { span: 5, children: /* @__PURE__ */ jsx84(MyTextInput, __spreadProps(__spreadValues({}, form.getInputProps("code")), { label: "M\xE3 module", disabled: true })) }),
|
|
4507
4518
|
/* @__PURE__ */ jsx84(Grid6.Col, { span: { base: 12, md: 7 }, children: /* @__PURE__ */ jsx84(MyTextInput, __spreadProps(__spreadValues({}, form.getInputProps("name")), { label: "T\xEAn module" })) }),
|
|
@@ -4539,7 +4550,7 @@ function F_moduleConfig_Form() {
|
|
|
4539
4550
|
}
|
|
4540
4551
|
}
|
|
4541
4552
|
),
|
|
4542
|
-
/* @__PURE__ */ jsx84(
|
|
4553
|
+
/* @__PURE__ */ jsx84(Paper7, { w: "100%", children: /* @__PURE__ */ jsx84(Center2, { children: /* @__PURE__ */ jsx84(
|
|
4543
4554
|
Image,
|
|
4544
4555
|
{
|
|
4545
4556
|
fit: "contain",
|
|
@@ -4565,7 +4576,7 @@ function F_moduleConfig_Form() {
|
|
|
4565
4576
|
}
|
|
4566
4577
|
}
|
|
4567
4578
|
),
|
|
4568
|
-
/* @__PURE__ */ jsx84(
|
|
4579
|
+
/* @__PURE__ */ jsx84(Paper7, { children: /* @__PURE__ */ jsx84(Center2, { children: /* @__PURE__ */ jsx84(
|
|
4569
4580
|
Image,
|
|
4570
4581
|
{
|
|
4571
4582
|
fit: "contain",
|
|
@@ -4594,7 +4605,7 @@ function F_moduleConfig({ AQModuleId }) {
|
|
|
4594
4605
|
}
|
|
4595
4606
|
|
|
4596
4607
|
// src/modules-features/admin/core/organizationPolicyDocs/F_organizationPolicyDocs.tsx
|
|
4597
|
-
import {
|
|
4608
|
+
import { Space as Space5 } from "@mantine/core";
|
|
4598
4609
|
|
|
4599
4610
|
// src/modules-features/admin/core/organizationPolicyDocs/F_organizationPolicyDocs_Create.tsx
|
|
4600
4611
|
import { useForm as useForm25 } from "@mantine/form";
|
|
@@ -4792,7 +4803,14 @@ function F_organizationPolicyDocs_Read({
|
|
|
4792
4803
|
return /* @__PURE__ */ jsx89(Skeleton6, { h: 500, visible: documentAttributeQuery.isLoading, children: /* @__PURE__ */ jsx89(MyFlexColumn, { children: /* @__PURE__ */ jsx89(
|
|
4793
4804
|
Accordion5,
|
|
4794
4805
|
{
|
|
4795
|
-
variant: "
|
|
4806
|
+
variant: "separated",
|
|
4807
|
+
radius: "sm",
|
|
4808
|
+
styles: {
|
|
4809
|
+
item: {
|
|
4810
|
+
backgroundColor: "white",
|
|
4811
|
+
border: "1px solid #e9ecef"
|
|
4812
|
+
}
|
|
4813
|
+
},
|
|
4796
4814
|
defaultValue: (_b = documentAttributeQuery.data) == null ? void 0 : _b.map(
|
|
4797
4815
|
(item) => {
|
|
4798
4816
|
var _a2;
|
|
@@ -4875,9 +4893,9 @@ function SubRead5({
|
|
|
4875
4893
|
}
|
|
4876
4894
|
|
|
4877
4895
|
// src/modules-features/admin/core/organizationPolicyDocs/F_organizationPolicyDocs.tsx
|
|
4878
|
-
import { jsx as jsx90, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
4896
|
+
import { Fragment as Fragment2, jsx as jsx90, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
4879
4897
|
function F_organizationPolicyDocs({ RegulationsTypeId }) {
|
|
4880
|
-
return /* @__PURE__ */ jsxs56(
|
|
4898
|
+
return /* @__PURE__ */ jsxs56(Fragment2, { children: [
|
|
4881
4899
|
/* @__PURE__ */ jsx90(MyFlexEnd, { children: /* @__PURE__ */ jsx90(F_organizationPolicyDocs_Create, { RegulationsTypeId }) }),
|
|
4882
4900
|
/* @__PURE__ */ jsx90(Space5, {}),
|
|
4883
4901
|
/* @__PURE__ */ jsx90(F_organizationPolicyDocs_Read, { RegulationsTypeId })
|
|
@@ -5723,7 +5741,7 @@ function F_userGuideDocs({ GuidelineTypeId }) {
|
|
|
5723
5741
|
}
|
|
5724
5742
|
|
|
5725
5743
|
// src/modules-features/admin/core/workflowProcessDocs/F_workflowProcessDocs.tsx
|
|
5726
|
-
import {
|
|
5744
|
+
import { Space as Space6 } from "@mantine/core";
|
|
5727
5745
|
|
|
5728
5746
|
// src/modules-features/admin/core/workflowProcessDocs/F_workflowProcessDocs_Create.tsx
|
|
5729
5747
|
import { useForm as useForm34 } from "@mantine/form";
|
|
@@ -5921,7 +5939,14 @@ function F_workflowProcessDocs_Read({
|
|
|
5921
5939
|
return /* @__PURE__ */ jsx117(Skeleton7, { h: 500, visible: documentAttributeQuery.isLoading, children: /* @__PURE__ */ jsx117(MyFlexColumn, { children: /* @__PURE__ */ jsx117(
|
|
5922
5940
|
Accordion6,
|
|
5923
5941
|
{
|
|
5924
|
-
variant: "
|
|
5942
|
+
variant: "separated",
|
|
5943
|
+
radius: "sm",
|
|
5944
|
+
styles: {
|
|
5945
|
+
item: {
|
|
5946
|
+
backgroundColor: "white",
|
|
5947
|
+
border: "1px solid #e9ecef"
|
|
5948
|
+
}
|
|
5949
|
+
},
|
|
5925
5950
|
defaultValue: (_b = documentAttributeQuery.data) == null ? void 0 : _b.map(
|
|
5926
5951
|
(item) => {
|
|
5927
5952
|
var _a2;
|
|
@@ -6004,11 +6029,11 @@ function SubRead6({
|
|
|
6004
6029
|
}
|
|
6005
6030
|
|
|
6006
6031
|
// src/modules-features/admin/core/workflowProcessDocs/F_workflowProcessDocs.tsx
|
|
6007
|
-
import { jsx as jsx118, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
6032
|
+
import { Fragment as Fragment3, jsx as jsx118, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
6008
6033
|
function F_workflowProcessDocs({
|
|
6009
6034
|
WorkflowTypeId
|
|
6010
6035
|
}) {
|
|
6011
|
-
return /* @__PURE__ */ jsxs72(
|
|
6036
|
+
return /* @__PURE__ */ jsxs72(Fragment3, { children: [
|
|
6012
6037
|
/* @__PURE__ */ jsx118(MyFlexEnd, { children: /* @__PURE__ */ jsx118(F_workflowProcessDocs_Create, { WorkflowTypeId }) }),
|
|
6013
6038
|
/* @__PURE__ */ jsx118(Space6, {}),
|
|
6014
6039
|
/* @__PURE__ */ jsx118(F_workflowProcessDocs_Read, { WorkflowTypeId })
|
|
@@ -6041,7 +6066,7 @@ import {
|
|
|
6041
6066
|
Checkbox as Checkbox4,
|
|
6042
6067
|
Flex as Flex4,
|
|
6043
6068
|
Group as Group6,
|
|
6044
|
-
Paper as
|
|
6069
|
+
Paper as Paper8,
|
|
6045
6070
|
PasswordInput as PasswordInput4,
|
|
6046
6071
|
Text as Text4,
|
|
6047
6072
|
TextInput as TextInput3,
|
|
@@ -6072,6 +6097,7 @@ function F_authenticate_Login({
|
|
|
6072
6097
|
}) {
|
|
6073
6098
|
const router = useRouter2();
|
|
6074
6099
|
const authenticate_store = useS_authenticate();
|
|
6100
|
+
const permissionStore = useStore_Permission();
|
|
6075
6101
|
const loadingState = useState11(false);
|
|
6076
6102
|
const mutation = useM_Account_Sigin();
|
|
6077
6103
|
const form = useForm36({
|
|
@@ -6106,7 +6132,7 @@ function F_authenticate_Login({
|
|
|
6106
6132
|
"passWord": passWord
|
|
6107
6133
|
}, {
|
|
6108
6134
|
onSuccess: (data) => {
|
|
6109
|
-
var _a, _b, _c, _d;
|
|
6135
|
+
var _a, _b, _c, _d, _e;
|
|
6110
6136
|
if (data.isSuccess === false) {
|
|
6111
6137
|
form.setFieldError("username", "T\xE0i kho\u1EA3n kh\xF4ng t\u1ED3n t\u1EA1i");
|
|
6112
6138
|
loadingState[1](false);
|
|
@@ -6126,6 +6152,7 @@ function F_authenticate_Login({
|
|
|
6126
6152
|
} else {
|
|
6127
6153
|
authenticate_store.setProperty("username", "");
|
|
6128
6154
|
}
|
|
6155
|
+
permissionStore.setProperty("permission", (_e = data.data) == null ? void 0 : _e.permissions);
|
|
6129
6156
|
if (onSuccess) {
|
|
6130
6157
|
onSuccess(data);
|
|
6131
6158
|
loadingState[1](false);
|
|
@@ -6140,7 +6167,7 @@ function F_authenticate_Login({
|
|
|
6140
6167
|
{
|
|
6141
6168
|
src: backgroundImage,
|
|
6142
6169
|
h: "100vh",
|
|
6143
|
-
children: /* @__PURE__ */ jsx120(Center3, { h: "100vh", children: /* @__PURE__ */ jsxs73(
|
|
6170
|
+
children: /* @__PURE__ */ jsx120(Center3, { h: "100vh", children: /* @__PURE__ */ jsxs73(Paper8, { withBorder: true, w: 400, m: "md", shadow: "md", p: 30, mt: 30, radius: "md", children: [
|
|
6144
6171
|
header ? header : /* @__PURE__ */ jsxs73(Flex4, { direction: "column", mb: "md", children: [
|
|
6145
6172
|
/* @__PURE__ */ jsx120(Title, { ta: "center", className: css_default.title, children: "\u0110\u0103ng nh\u1EADp!" }),
|
|
6146
6173
|
/* @__PURE__ */ jsxs73(Text4, { c: "dimmed", size: "sm", ta: "center", mt: 5, children: [
|
package/dist/stores/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as zustand from 'zustand';
|
|
2
|
+
import { I as IPagePermission } from '../IPagePermission-992CbJhp.mjs';
|
|
2
3
|
|
|
3
4
|
interface GenericStore$1<T> {
|
|
4
5
|
state: T;
|
|
@@ -24,4 +25,14 @@ declare function createStateStore<T extends Record<string, any>>({ initialState,
|
|
|
24
25
|
storageKey?: string;
|
|
25
26
|
}): zustand.UseBoundStore<zustand.StoreApi<GenericStore<T>>>;
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
interface I {
|
|
29
|
+
permission?: IPagePermission[];
|
|
30
|
+
}
|
|
31
|
+
declare function useStore_Permission(): {
|
|
32
|
+
state: I;
|
|
33
|
+
setState: (newState: I) => void;
|
|
34
|
+
setProperty: <K extends "permission">(key: K, value: I[K]) => void;
|
|
35
|
+
resetState: () => void;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export { createGenericStore, createStateStore, useStore_Permission };
|
package/dist/stores/index.mjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createGenericStore,
|
|
3
|
-
createStateStore
|
|
4
|
-
|
|
3
|
+
createStateStore,
|
|
4
|
+
useStore_Permission
|
|
5
|
+
} from "../chunk-PW6WTEVB.mjs";
|
|
5
6
|
import "../chunk-FWCSY2DS.mjs";
|
|
6
7
|
export {
|
|
7
8
|
createGenericStore,
|
|
8
|
-
createStateStore
|
|
9
|
+
createStateStore,
|
|
10
|
+
useStore_Permission
|
|
9
11
|
};
|