aq-fe-framework 0.1.45 → 0.1.47
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.
|
@@ -568,48 +568,68 @@ function MySwitchTheme() {
|
|
|
568
568
|
);
|
|
569
569
|
}
|
|
570
570
|
|
|
571
|
-
// src/stores/S0Sidebar.ts
|
|
572
|
-
import { create } from "zustand";
|
|
573
|
-
import { persist } from "zustand/middleware";
|
|
574
|
-
var useS0Sidebar = create()(
|
|
575
|
-
persist(
|
|
576
|
-
(set, get) => ({
|
|
577
|
-
opened: true,
|
|
578
|
-
toggle: () => {
|
|
579
|
-
set({ opened: !get().opened });
|
|
580
|
-
},
|
|
581
|
-
title: "",
|
|
582
|
-
setTitle: (newTitle) => {
|
|
583
|
-
set({ title: newTitle });
|
|
584
|
-
},
|
|
585
|
-
groupMenuOpenId: [],
|
|
586
|
-
toggleGroupMenuOpenId: (id) => {
|
|
587
|
-
const currentIds = get().groupMenuOpenId;
|
|
588
|
-
if (currentIds.includes(id)) {
|
|
589
|
-
set({
|
|
590
|
-
groupMenuOpenId: currentIds.filter((existingId) => existingId !== id)
|
|
591
|
-
});
|
|
592
|
-
} else {
|
|
593
|
-
set({ groupMenuOpenId: [...currentIds, id] });
|
|
594
|
-
}
|
|
595
|
-
},
|
|
596
|
-
clearGroupMenuOpenId: () => {
|
|
597
|
-
set({ groupMenuOpenId: [] });
|
|
598
|
-
},
|
|
599
|
-
menuCode: "",
|
|
600
|
-
setMenuCode: (newMenuCode) => {
|
|
601
|
-
set({ menuCode: newMenuCode });
|
|
602
|
-
}
|
|
603
|
-
}),
|
|
604
|
-
{ name: "S0Sidebar" }
|
|
605
|
-
)
|
|
606
|
-
);
|
|
607
|
-
|
|
608
571
|
// src/components/AppSpotlight/MyAppSpotlight.tsx
|
|
609
572
|
import { Spotlight, spotlight } from "@mantine/spotlight";
|
|
610
573
|
import { IconSearch } from "@tabler/icons-react";
|
|
611
574
|
import { usePathname, useRouter } from "next/navigation";
|
|
612
575
|
import { useMemo, useState as useState4 } from "react";
|
|
576
|
+
|
|
577
|
+
// src/stores/CreateGenericStore.ts
|
|
578
|
+
import { create } from "zustand";
|
|
579
|
+
import { persist } from "zustand/middleware";
|
|
580
|
+
function createGenericStore({ initialState, storageKey }) {
|
|
581
|
+
const storeCreator = (set) => ({
|
|
582
|
+
state: initialState,
|
|
583
|
+
setState: (newState) => set({ state: newState }),
|
|
584
|
+
setProperty: (key, value) => set((store) => ({ state: __spreadProps(__spreadValues({}, store.state), { [key]: value }) })),
|
|
585
|
+
resetState: () => set({ state: initialState })
|
|
586
|
+
});
|
|
587
|
+
return storageKey ? create(persist(storeCreator, { name: storageKey })) : create(storeCreator);
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
// src/stores/useS_Authenticate.ts
|
|
591
|
+
var useStore = createGenericStore({
|
|
592
|
+
initialState: { token: "" },
|
|
593
|
+
storageKey: "useS_Authenticate"
|
|
594
|
+
});
|
|
595
|
+
function useS_Authenticate() {
|
|
596
|
+
const store = useStore();
|
|
597
|
+
return __spreadValues({}, store);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
// src/stores/useS_Sidebar.ts
|
|
601
|
+
var useStore2 = createGenericStore({
|
|
602
|
+
initialState: {
|
|
603
|
+
title: "",
|
|
604
|
+
opened: true,
|
|
605
|
+
groupMenuOpenId: []
|
|
606
|
+
},
|
|
607
|
+
storageKey: "useS_Sidebar"
|
|
608
|
+
});
|
|
609
|
+
function useS_Sidebar() {
|
|
610
|
+
const store = useStore2();
|
|
611
|
+
function toggle() {
|
|
612
|
+
store.setProperty("opened", !store.state.opened);
|
|
613
|
+
}
|
|
614
|
+
function toggleGroupMenuOpenId(id) {
|
|
615
|
+
const currentIds = store.state.groupMenuOpenId;
|
|
616
|
+
if (currentIds.includes(id)) {
|
|
617
|
+
store.setProperty("groupMenuOpenId", currentIds.filter((existingId) => existingId !== id));
|
|
618
|
+
} else {
|
|
619
|
+
store.setProperty("groupMenuOpenId", [...currentIds, id]);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
function clearGroupMenuOpenId() {
|
|
623
|
+
store.setProperty("groupMenuOpenId", []);
|
|
624
|
+
}
|
|
625
|
+
return __spreadProps(__spreadValues({}, store), {
|
|
626
|
+
toggle,
|
|
627
|
+
toggleGroupMenuOpenId,
|
|
628
|
+
clearGroupMenuOpenId
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
// src/components/AppSpotlight/MyAppSpotlight.tsx
|
|
613
633
|
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
614
634
|
function convertMenuToSpotlightActions(items, router, parentPath = "", sideBarStore, pathName) {
|
|
615
635
|
let actions = [];
|
|
@@ -640,7 +660,7 @@ function MyAppSpotlight({ menu }) {
|
|
|
640
660
|
const [query, setQuery] = useState4("");
|
|
641
661
|
const router = useRouter();
|
|
642
662
|
const pathName = usePathname();
|
|
643
|
-
const sideBarStore =
|
|
663
|
+
const sideBarStore = useS_Sidebar();
|
|
644
664
|
const spotlightActions = useMemo(
|
|
645
665
|
() => convertMenuToSpotlightActions(menu, router, "", sideBarStore, pathName),
|
|
646
666
|
[menu, router, sideBarStore]
|
|
@@ -1038,23 +1058,10 @@ function MyFlexEnd(_a) {
|
|
|
1038
1058
|
import { Button as Button5, Divider, Fieldset, Group as Group5, Modal as Modal6, SimpleGrid, Space as Space2, Table } from "@mantine/core";
|
|
1039
1059
|
import { IconArrowBackUp, IconArrowBigLeft, IconArrowBigRight, IconSquareRoundedX } from "@tabler/icons-react";
|
|
1040
1060
|
|
|
1041
|
-
// src/stores/S0GenericStore.ts
|
|
1042
|
-
import { create as create2 } from "zustand";
|
|
1043
|
-
import { persist as persist2 } from "zustand/middleware";
|
|
1044
|
-
function createGenericStore({ initialState, storageKey }) {
|
|
1045
|
-
const storeCreator = (set) => ({
|
|
1046
|
-
state: initialState,
|
|
1047
|
-
setState: (newState) => set({ state: newState }),
|
|
1048
|
-
setProperty: (key, value) => set((store) => ({ state: __spreadProps(__spreadValues({}, store.state), { [key]: value }) })),
|
|
1049
|
-
resetState: () => set({ state: initialState })
|
|
1050
|
-
});
|
|
1051
|
-
return storageKey ? create2(persist2(storeCreator, { name: storageKey })) : create2(storeCreator);
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
1061
|
// src/components/Buttons/ButtonImport/useS_ButtonImport.ts
|
|
1055
1062
|
import { useEffect as useEffect2, useMemo as useMemo2 } from "react";
|
|
1056
1063
|
import * as XLSX3 from "xlsx";
|
|
1057
|
-
var
|
|
1064
|
+
var useStore3 = createGenericStore({
|
|
1058
1065
|
initialState: {
|
|
1059
1066
|
data: [],
|
|
1060
1067
|
title: [],
|
|
@@ -1063,7 +1070,7 @@ var useStore = createGenericStore({
|
|
|
1063
1070
|
}
|
|
1064
1071
|
});
|
|
1065
1072
|
function useS_ButtonImport() {
|
|
1066
|
-
const store =
|
|
1073
|
+
const store = useStore3();
|
|
1067
1074
|
function autoMap() {
|
|
1068
1075
|
if (!store.state.data || !store.state.data.length || !store.state.fieldConfig) return;
|
|
1069
1076
|
const sampleRow = store.state.data[0];
|
|
@@ -1672,7 +1679,7 @@ var baseAxios = axios.create({
|
|
|
1672
1679
|
baseAxios.interceptors.request.use(
|
|
1673
1680
|
(config2) => {
|
|
1674
1681
|
var _a, _b;
|
|
1675
|
-
const tokenData = localStorage.getItem("
|
|
1682
|
+
const tokenData = localStorage.getItem("useS_Authenticate");
|
|
1676
1683
|
const state = JSON.parse(tokenData);
|
|
1677
1684
|
const token = (_b = (_a = state == null ? void 0 : state.state) == null ? void 0 : _a.state) == null ? void 0 : _b.token;
|
|
1678
1685
|
if (token) {
|
|
@@ -6190,16 +6197,6 @@ function MyTextEditor(_a) {
|
|
|
6190
6197
|
] }) });
|
|
6191
6198
|
}
|
|
6192
6199
|
|
|
6193
|
-
// src/stores/S0Auth.ts
|
|
6194
|
-
var useStore2 = createGenericStore({
|
|
6195
|
-
initialState: { token: "" },
|
|
6196
|
-
storageKey: "S0Auth"
|
|
6197
|
-
});
|
|
6198
|
-
function useS0Auth() {
|
|
6199
|
-
const store = useStore2();
|
|
6200
|
-
return __spreadValues({}, store);
|
|
6201
|
-
}
|
|
6202
|
-
|
|
6203
6200
|
// src/modules-features/auth/F0Logout/F0Logout.tsx
|
|
6204
6201
|
import { Button as Button14 } from "@mantine/core";
|
|
6205
6202
|
import { IconLogout } from "@tabler/icons-react";
|
|
@@ -6207,9 +6204,9 @@ import { useRouter as useRouter3 } from "next/navigation";
|
|
|
6207
6204
|
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
6208
6205
|
function F0Logout() {
|
|
6209
6206
|
const router = useRouter3();
|
|
6210
|
-
const
|
|
6207
|
+
const S_Authenticate = useS_Authenticate();
|
|
6211
6208
|
return /* @__PURE__ */ jsx46(Button14, { onClick: () => {
|
|
6212
|
-
|
|
6209
|
+
S_Authenticate.setProperty("token", "");
|
|
6213
6210
|
router.replace("/auth/login");
|
|
6214
6211
|
}, leftSection: /* @__PURE__ */ jsx46(IconLogout, {}), fullWidth: true, justify: "start", variant: "subtle", children: "\u0110\u0103ng xu\u1EA5t" });
|
|
6215
6212
|
}
|
|
@@ -6243,7 +6240,7 @@ function getRightSection(status) {
|
|
|
6243
6240
|
return null;
|
|
6244
6241
|
}
|
|
6245
6242
|
function RenderNavLinks({ items }) {
|
|
6246
|
-
const
|
|
6243
|
+
const sidebarStore = useS_Sidebar();
|
|
6247
6244
|
const pathName = usePathname2();
|
|
6248
6245
|
return /* @__PURE__ */ jsx47(Fragment12, { children: items.map((item, index) => /* @__PURE__ */ jsx47(
|
|
6249
6246
|
NavLink,
|
|
@@ -6251,15 +6248,15 @@ function RenderNavLinks({ items }) {
|
|
|
6251
6248
|
active: item.link === pathName.split("/")[2],
|
|
6252
6249
|
component: Link3,
|
|
6253
6250
|
rightSection: getRightSection(item.status),
|
|
6254
|
-
opened:
|
|
6251
|
+
opened: sidebarStore.state.groupMenuOpenId.includes(item.label),
|
|
6255
6252
|
href: `/${pathName.split("/")[1]}/${item.link}` || "#",
|
|
6256
6253
|
label: item.label,
|
|
6257
6254
|
childrenOffset: 28,
|
|
6258
6255
|
onClick: () => {
|
|
6259
|
-
if (item.links)
|
|
6256
|
+
if (item.links) sidebarStore.toggleGroupMenuOpenId(item.label);
|
|
6260
6257
|
if (item.link) {
|
|
6261
|
-
|
|
6262
|
-
|
|
6258
|
+
sidebarStore.setProperty("menuCode", item.link);
|
|
6259
|
+
sidebarStore.setProperty("title", item.label);
|
|
6263
6260
|
}
|
|
6264
6261
|
},
|
|
6265
6262
|
children: item.links && /* @__PURE__ */ jsx47(RenderNavLinks, { items: item.links })
|
|
@@ -6316,7 +6313,7 @@ function BasicAppShell_transformMenuToEnum(prefixProjectName, menu) {
|
|
|
6316
6313
|
}, {});
|
|
6317
6314
|
}
|
|
6318
6315
|
function BasicAppShell({ children, menu }) {
|
|
6319
|
-
const
|
|
6316
|
+
const sidebarStore = useS_Sidebar();
|
|
6320
6317
|
const media = useMediaQuery("(min-width: 72em)");
|
|
6321
6318
|
const selectMedia = useMediaQuery("(min-width: 80em)");
|
|
6322
6319
|
return /* @__PURE__ */ jsxs25(
|
|
@@ -6326,7 +6323,7 @@ function BasicAppShell({ children, menu }) {
|
|
|
6326
6323
|
navbar: {
|
|
6327
6324
|
width: 333,
|
|
6328
6325
|
breakpoint: "sm",
|
|
6329
|
-
collapsed: { mobile:
|
|
6326
|
+
collapsed: { mobile: sidebarStore.state.opened, desktop: !sidebarStore.state.opened }
|
|
6330
6327
|
},
|
|
6331
6328
|
padding: "md",
|
|
6332
6329
|
children: [
|
|
@@ -6334,8 +6331,8 @@ function BasicAppShell({ children, menu }) {
|
|
|
6334
6331
|
/* @__PURE__ */ jsx47(MyAppSpotlight, { menu }),
|
|
6335
6332
|
media ? /* @__PURE__ */ jsxs25(Group11, { h: "100%", px: "md", justify: "space-between", align: "center", children: [
|
|
6336
6333
|
/* @__PURE__ */ jsxs25(Group11, { h: "100%", children: [
|
|
6337
|
-
/* @__PURE__ */ jsx47(Tooltip5, { label:
|
|
6338
|
-
/* @__PURE__ */ jsx47(Tooltip5, { label: "\u0110\xF3ng t\u1EA5t c\u1EA3 menu", children: /* @__PURE__ */ jsx47(ActionIcon10, { size: "lg", radius: "md", variant: "default", onClick: () =>
|
|
6334
|
+
/* @__PURE__ */ jsx47(Tooltip5, { label: sidebarStore.state.opened ? "\u1EA8n thanh menu" : "Hi\u1EC7n thanh menu", children: /* @__PURE__ */ jsx47(ActionIcon10, { size: "lg", radius: "md", variant: "default", onClick: sidebarStore.toggle, children: sidebarStore.state.opened ? /* @__PURE__ */ jsx47(IconLayoutSidebarLeftExpand, {}) : /* @__PURE__ */ jsx47(IconLayoutSidebarLeftCollapse, {}) }) }),
|
|
6335
|
+
/* @__PURE__ */ jsx47(Tooltip5, { label: "\u0110\xF3ng t\u1EA5t c\u1EA3 menu", children: /* @__PURE__ */ jsx47(ActionIcon10, { size: "lg", radius: "md", variant: "default", onClick: () => sidebarStore.clearGroupMenuOpenId(), children: /* @__PURE__ */ jsx47(IconLibraryMinus, {}) }) })
|
|
6339
6336
|
] }),
|
|
6340
6337
|
/* @__PURE__ */ jsx47(Group11, { style: { position: "absolute", left: "50%", transform: "translateX(-50%)" }, children: /* @__PURE__ */ jsx47(Text11, { c: "green", fw: "bold", children: "AQ EduCourseEvaluation - Ph\u1EA7n m\u1EC1m \u0111\xE1nh gi\xE1 chu\u1EA9n \u0111\u1EA7u ra" }) }),
|
|
6341
6338
|
/* @__PURE__ */ jsxs25(Group11, { children: [
|
|
@@ -6357,7 +6354,7 @@ function BasicAppShell({ children, menu }) {
|
|
|
6357
6354
|
] }) : (
|
|
6358
6355
|
// For mobile screens - simplified layout
|
|
6359
6356
|
/* @__PURE__ */ jsxs25(Group11, { h: "100%", px: "md", justify: "space-between", children: [
|
|
6360
|
-
/* @__PURE__ */ jsx47(ActionIcon10, { size: "lg", radius: "md", variant: "default", onClick:
|
|
6357
|
+
/* @__PURE__ */ jsx47(ActionIcon10, { size: "lg", radius: "md", variant: "default", onClick: sidebarStore.toggle, children: sidebarStore.state.opened ? /* @__PURE__ */ jsx47(IconLayoutSidebarLeftExpand, {}) : /* @__PURE__ */ jsx47(IconLayoutSidebarLeftCollapse, {}) }),
|
|
6361
6358
|
/* @__PURE__ */ jsx47(Text11, { c: "green", fw: "bold", size: "sm", children: "AQ EduCourseEvaluation" }),
|
|
6362
6359
|
/* @__PURE__ */ jsxs25(Group11, { children: [
|
|
6363
6360
|
/* @__PURE__ */ jsx47(
|
|
@@ -6485,12 +6482,12 @@ import Link4 from "next/link";
|
|
|
6485
6482
|
var css_default2 = {};
|
|
6486
6483
|
|
|
6487
6484
|
// src/components/Layouts/HeaderMegaMenu/HeaderMegaMenuStore.ts
|
|
6488
|
-
var
|
|
6485
|
+
var useStore4 = createGenericStore({
|
|
6489
6486
|
initialState: { name: "\u0110\u0103ng k\xFD kh\xF3a h\u1ECDc" },
|
|
6490
6487
|
storageKey: "HeaderMegaMenuStore"
|
|
6491
6488
|
});
|
|
6492
6489
|
function useHeaderMegaMenuStore() {
|
|
6493
|
-
const store =
|
|
6490
|
+
const store = useStore4();
|
|
6494
6491
|
return __spreadValues({}, store);
|
|
6495
6492
|
}
|
|
6496
6493
|
|
|
@@ -6613,8 +6610,8 @@ var PageTitle = ({ title, status }) => {
|
|
|
6613
6610
|
return /* @__PURE__ */ jsx51(Indicator, { label: status, size: 16, inline: true, color, disabled: !status, pt: 6, children: /* @__PURE__ */ jsx51(Title, { children: title }) });
|
|
6614
6611
|
};
|
|
6615
6612
|
function MyPageContent({ leftTopBar, title, canBack = false, rightTopBar, status, children }) {
|
|
6616
|
-
const SidebarStore =
|
|
6617
|
-
const finalTitle = title || SidebarStore.title;
|
|
6613
|
+
const SidebarStore = useS_Sidebar();
|
|
6614
|
+
const finalTitle = title || SidebarStore.state.title;
|
|
6618
6615
|
return /* @__PURE__ */ jsxs27(Container3, { p: 0, fluid: true, children: [
|
|
6619
6616
|
/* @__PURE__ */ jsxs27(Group13, { justify: "space-between", children: [
|
|
6620
6617
|
/* @__PURE__ */ jsxs27(Group13, { children: [
|
|
@@ -6624,7 +6621,7 @@ function MyPageContent({ leftTopBar, title, canBack = false, rightTopBar, status
|
|
|
6624
6621
|
] }),
|
|
6625
6622
|
/* @__PURE__ */ jsxs27(Group13, { children: [
|
|
6626
6623
|
rightTopBar,
|
|
6627
|
-
/* @__PURE__ */ jsx51(Code, { color: "var(--mantine-color-blue-light)", children: SidebarStore.menuCode })
|
|
6624
|
+
/* @__PURE__ */ jsx51(Code, { color: "var(--mantine-color-blue-light)", children: SidebarStore.state.menuCode })
|
|
6628
6625
|
] })
|
|
6629
6626
|
] }),
|
|
6630
6627
|
/* @__PURE__ */ jsx51(Divider4, {}),
|
|
@@ -6746,6 +6743,7 @@ export {
|
|
|
6746
6743
|
MyActionIconUpload,
|
|
6747
6744
|
MyActionIconViewPDF,
|
|
6748
6745
|
MySwitchTheme,
|
|
6746
|
+
createGenericStore,
|
|
6749
6747
|
MyAppSpotlight,
|
|
6750
6748
|
SpotlightTrigger,
|
|
6751
6749
|
MyAnchorViewPDF,
|
|
@@ -6755,7 +6753,6 @@ export {
|
|
|
6755
6753
|
MyButtonCreate,
|
|
6756
6754
|
MySelect,
|
|
6757
6755
|
MyFlexEnd,
|
|
6758
|
-
createGenericStore,
|
|
6759
6756
|
useS_ButtonImport,
|
|
6760
6757
|
SelectFieldModal,
|
|
6761
6758
|
MyDataTable,
|
package/package.json
CHANGED
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"types": "./dist/modules-features//admin/core/index.d.mts"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
"version": "0.1.
|
|
21
|
+
"version": "0.1.47",
|
|
22
22
|
"private": false,
|
|
23
23
|
"files": [
|
|
24
24
|
"dist"
|
|
25
25
|
],
|
|
26
26
|
"scripts": {
|
|
27
|
-
"dev": "next dev --turbopack -p
|
|
27
|
+
"dev": "next dev --turbopack -p 3003",
|
|
28
28
|
"gen": "barrelsby --config barrelsby.json",
|
|
29
29
|
"build": "tsup",
|
|
30
30
|
"start": "next start",
|