aq-fe-framework 0.1.603 → 0.1.604

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.
@@ -663,7 +663,7 @@ function MyButtonViewFile({
663
663
 
664
664
  // src/core/button/MyButtonImport/MyButtonImport.tsx
665
665
  import { Modal as Modal17, useModalsStack as useModalsStack4 } from "@mantine/core";
666
- import { useState as useState21 } from "react";
666
+ import { useState as useState22 } from "react";
667
667
 
668
668
  // src/lib/utils.ts
669
669
  import { clsx } from "clsx";
@@ -7856,7 +7856,7 @@ import {
7856
7856
  IconLibraryMinus
7857
7857
  } from "@tabler/icons-react";
7858
7858
  import { usePathname as usePathname3 } from "next/navigation";
7859
- import { useEffect as useEffect21, useMemo as useMemo32, useState as useState18 } from "react";
7859
+ import { useEffect as useEffect21, useMemo as useMemo32, useState as useState19 } from "react";
7860
7860
 
7861
7861
  // src/components/Layouts/BasicAppShell/RenderNavLinks.tsx
7862
7862
  import { Badge as Badge3, NavLink } from "@mantine/core";
@@ -12205,13 +12205,13 @@ function F_organizationPolicyDocs({ RegulationsTypeId }) {
12205
12205
  ] });
12206
12206
  }
12207
12207
 
12208
- // src/api/services/service_pageContent.ts
12209
- var CONTROLLER7 = "/eva/PageContent";
12210
- var service_pageContent = __spreadValues({}, createBaseApi(CONTROLLER7, baseAxios_default));
12208
+ // src/api/services/service_page.ts
12209
+ var CONTROLLER7 = "/Page";
12210
+ var service_page = __spreadValues({}, createBaseApi(CONTROLLER7, baseAxios_default));
12211
12211
 
12212
12212
  // src/modules-features/admin/core/pageContentConfig/F_pageContentConfig_ReadMenu.tsx
12213
12213
  import { Group as Group20 } from "@mantine/core";
12214
- import { useMemo as useMemo24 } from "react";
12214
+ import { useMemo as useMemo24, useState as useState17 } from "react";
12215
12215
 
12216
12216
  // src/modules-features/admin/core/pageContentConfig/F_pageContentConfig_DeleteDescription.tsx
12217
12217
  import { jsx as jsx149 } from "react/jsx-runtime";
@@ -12225,12 +12225,15 @@ function F_pageContentConfig_Export() {
12225
12225
  return /* @__PURE__ */ jsx150(MyButton, { actionType: "export" });
12226
12226
  }
12227
12227
 
12228
+ // src/api/services/service_pageContent.ts
12229
+ var CONTROLLER8 = "/eva/PageContent";
12230
+ var service_pageContent = __spreadValues({}, createBaseApi(CONTROLLER8, baseAxios_default));
12231
+
12228
12232
  // src/modules-features/admin/core/pageContentConfig/F_pageContentConfig_Save.tsx
12229
12233
  import { jsx as jsx151 } from "react/jsx-runtime";
12230
12234
  function F_pageContentConfig_Save({ menuValues }) {
12231
12235
  const updatePageConfigMutation = useMyReactMutation({
12232
12236
  axiosFn: () => {
12233
- console.log("value");
12234
12237
  return service_pageContent.updateList([{ id: 1 }]);
12235
12238
  }
12236
12239
  });
@@ -12239,42 +12242,17 @@ function F_pageContentConfig_Save({ menuValues }) {
12239
12242
 
12240
12243
  // src/modules-features/admin/core/pageContentConfig/F_pageContentConfig_ReadMenu.tsx
12241
12244
  import { jsx as jsx152, jsxs as jsxs89 } from "react/jsx-runtime";
12242
- var groupToTwoLevels = (menu) => {
12243
- return menu.map((item) => {
12244
- if (item.links) {
12245
- const flattenedLinks = [];
12246
- const flattenSubLinks = (subLinks) => {
12247
- subLinks.forEach((subItem) => {
12248
- if (subItem.links) {
12249
- flattenSubLinks(subItem.links);
12250
- } else {
12251
- if (subItem.pageId != void 0) {
12252
- flattenedLinks.push(subItem);
12253
- }
12254
- }
12255
- });
12256
- };
12257
- flattenSubLinks(item.links);
12258
- return __spreadProps(__spreadValues({}, item), {
12259
- links: flattenedLinks
12260
- // Replace with flattened links
12261
- });
12262
- }
12263
- if (item.pageId != void 0) {
12264
- return item;
12265
- }
12266
- return void 0;
12267
- }).filter((item) => item != void 0);
12268
- };
12269
- function F_pageContentConfig_ReadMenu({ menudataPrototype }) {
12245
+ function F_pageContentConfig_ReadMenu({ menuData }) {
12270
12246
  const pageContentQuery = useMyReactQuery({
12271
12247
  queryKey: ["pageContents"],
12272
- axiosFn: () => service_pageContent.getAll(),
12273
- mockData: groupToTwoLevels(menudataPrototype || []).flatMap((item) => item.links).map((item) => ({
12274
- name: item == null ? void 0 : item.label,
12275
- description: ""
12276
- }))
12248
+ axiosFn: () => service_page.getAll()
12277
12249
  });
12250
+ const [editedDescriptions, setEditedDescriptions] = useState17({});
12251
+ const handleDescriptionChange = (id, value) => {
12252
+ setEditedDescriptions((prev) => __spreadProps(__spreadValues({}, prev), {
12253
+ [id]: value
12254
+ }));
12255
+ };
12278
12256
  const device = useMyDevice();
12279
12257
  const columns = useMemo24(() => [
12280
12258
  {
@@ -12285,11 +12263,21 @@ function F_pageContentConfig_ReadMenu({ menudataPrototype }) {
12285
12263
  header: "M\xF4 t\u1EA3",
12286
12264
  accessorKey: "description",
12287
12265
  size: device.isPc ? 400 : 0,
12288
- Cell: () => {
12289
- return /* @__PURE__ */ jsx152(MyTextInput2, { placeholder: "Nh\u1EADp m\xF4 t\u1EA3 menu" });
12266
+ Cell: ({ row }) => {
12267
+ var _a, _b;
12268
+ const id = row.original.id;
12269
+ const currentValue = (_b = (_a = editedDescriptions[id]) != null ? _a : row.original.code) != null ? _b : "";
12270
+ return /* @__PURE__ */ jsx152(
12271
+ MyTextInput2,
12272
+ {
12273
+ value: currentValue,
12274
+ placeholder: "Nh\u1EADp m\xF4 t\u1EA3 menu",
12275
+ onChange: (e4) => handleDescriptionChange(id.toString(), e4.target.value)
12276
+ }
12277
+ );
12290
12278
  }
12291
12279
  }
12292
- ], []);
12280
+ ], [device, editedDescriptions]);
12293
12281
  return /* @__PURE__ */ jsx152(
12294
12282
  MyDataTable,
12295
12283
  {
@@ -12308,8 +12296,8 @@ function F_pageContentConfig_ReadMenu({ menudataPrototype }) {
12308
12296
 
12309
12297
  // src/modules-features/admin/core/pageContentConfig/F_pageContentConfig.tsx
12310
12298
  import { jsx as jsx153 } from "react/jsx-runtime";
12311
- function F_pageContentConfig({ menudataPrototype }) {
12312
- return /* @__PURE__ */ jsx153(F_pageContentConfig_ReadMenu, { menudataPrototype });
12299
+ function F_pageContentConfig({ menuData }) {
12300
+ return /* @__PURE__ */ jsx153(F_pageContentConfig_ReadMenu, { menuData });
12313
12301
  }
12314
12302
 
12315
12303
  // src/modules-features/admin/core/roleCatalog/F_roleCatalog_Read.tsx
@@ -12662,13 +12650,13 @@ function Adapter_UserTable(_a) {
12662
12650
 
12663
12651
  // src/modules/User/adapter/Adapter_UserAddToRole.tsx
12664
12652
  import { useDisclosure as useDisclosure14 } from "@mantine/hooks";
12665
- import { useState as useState17 } from "react";
12653
+ import { useState as useState18 } from "react";
12666
12654
  import { jsx as jsx165 } from "react/jsx-runtime";
12667
12655
  function Adapter_UserAddToRole({
12668
12656
  roleId
12669
12657
  }) {
12670
12658
  const disc = useDisclosure14();
12671
- const userSelectedId = useState17({});
12659
+ const userSelectedId = useState18({});
12672
12660
  const mutation = useMyReactMutation({
12673
12661
  axiosFn: async ({ userIds, roleId: roleId2 }) => {
12674
12662
  return service_role.addUsers({ roleId: roleId2 }, userIds);
@@ -14109,22 +14097,23 @@ function base64ToFaviconUrl(base64, ext) {
14109
14097
  const blob = new Blob([byteArray], { type: `image/${ext}` });
14110
14098
  return URL.createObjectURL(blob);
14111
14099
  }
14112
- function BasicAppShell({ children, menu, extraTopRight, title, logoutRedirect }) {
14100
+ function BasicAppShell({ children, menu, extraTopRight, title, logoutRedirect, filterMenuPermission }) {
14113
14101
  const isDev = process.env.NEXT_PUBLIC_IS_DEV == "1";
14114
14102
  const pathname = usePathname3();
14115
14103
  const media = useMediaQuery("(min-width: 72em)");
14116
14104
  const permissionStore = useStore_Permission();
14117
14105
  const appShellStore = useStore_BasicAppShell();
14118
14106
  const { data: moduleData } = useQ_AQ_GetAQModule();
14119
- const [faviconUrl, setFaviconUrl] = useState18("");
14120
- const [isLoadingPermission, setIsLoadingPermission] = useState18(true);
14121
- const [isAccessible, setIsAccessible] = useState18(false);
14107
+ const [faviconUrl, setFaviconUrl] = useState19("");
14108
+ const [isLoadingPermission, setIsLoadingPermission] = useState19(true);
14109
+ const [isAccessible, setIsAccessible] = useState19(false);
14122
14110
  const readablePageIds = useMemo32(
14123
14111
  () => getReadablePageIdSet(permissionStore.state.permission || []),
14124
14112
  [permissionStore.state.permission]
14125
14113
  );
14126
14114
  const filteredMenu = useMemo32(
14127
14115
  () => {
14116
+ if (!filterMenuPermission) return menu;
14128
14117
  if (isDev) return menu;
14129
14118
  return filterMenuByPermission(menu, readablePageIds);
14130
14119
  },
@@ -14565,7 +14554,7 @@ function MySelectAPIGet(_a) {
14565
14554
  // src/components/ScheduleX/MyScheduleX.tsx
14566
14555
  import { useNextCalendarApp as useNextCalendarApp2, ScheduleXCalendar as ScheduleXCalendar2 } from "@schedule-x/react";
14567
14556
  import { createEventsServicePlugin as createEventsServicePlugin2 } from "@schedule-x/events-service";
14568
- import { useState as useState19 } from "react";
14557
+ import { useState as useState20 } from "react";
14569
14558
  import { createEventModalPlugin as createEventModalPlugin2 } from "@schedule-x/event-modal";
14570
14559
  import { jsx as jsx199 } from "react/jsx-runtime";
14571
14560
  function MyScheduleX({
@@ -14576,8 +14565,8 @@ function MyScheduleX({
14576
14565
  startDayBoundaries = "05:00",
14577
14566
  endDayBoundaries = "21:00"
14578
14567
  }) {
14579
- const eventsService = useState19(() => createEventsServicePlugin2())[0];
14580
- const eventModalPlugin = useState19(() => createEventModalPlugin2())[0];
14568
+ const eventsService = useState20(() => createEventsServicePlugin2())[0];
14569
+ const eventModalPlugin = useState20(() => createEventModalPlugin2())[0];
14581
14570
  const calendar = useNextCalendarApp2({
14582
14571
  locale: "vi-VN",
14583
14572
  dayBoundaries: {
@@ -14614,7 +14603,7 @@ function MySkeletonTable({ h: h4 = 500 }) {
14614
14603
  // src/core/button/MyButtonImport/MyFileImportConfigModal.tsx
14615
14604
  import { Button as Button26, FileInput as FileInput16, Flex as Flex9, Modal as Modal15, NumberInput as NumberInput3, SimpleGrid as SimpleGrid3, Stack as Stack7 } from "@mantine/core";
14616
14605
  import { notifications as notifications2 } from "@mantine/notifications";
14617
- import { useEffect as useEffect22, useState as useState20 } from "react";
14606
+ import { useEffect as useEffect22, useState as useState21 } from "react";
14618
14607
  import { jsx as jsx201, jsxs as jsxs115 } from "react/jsx-runtime";
14619
14608
 
14620
14609
  // src/core/button/MyButtonImport/MyMappingFieldModal.tsx
@@ -15075,13 +15064,13 @@ import {
15075
15064
  Text as Text26
15076
15065
  } from "@mantine/core";
15077
15066
  import { IconPlus as IconPlus9, IconTrash as IconTrash8 } from "@tabler/icons-react";
15078
- import { useState as useState22 } from "react";
15067
+ import { useState as useState23 } from "react";
15079
15068
  import { jsx as jsx214, jsxs as jsxs123 } from "react/jsx-runtime";
15080
15069
  function MyWeeklySessionSchedulerPicker({
15081
15070
  value = [],
15082
15071
  onChange
15083
15072
  }) {
15084
- const [selectedDays, setSelectedDays] = useState22([]);
15073
+ const [selectedDays, setSelectedDays] = useState23([]);
15085
15074
  const handleAddSession = (dayOfWeek) => {
15086
15075
  const newSession = {
15087
15076
  dayOfWeek,
@@ -15337,7 +15326,7 @@ import {
15337
15326
  Title as Title4
15338
15327
  } from "@mantine/core";
15339
15328
  import { IconChevronLeft, IconChevronRight, IconPlus as IconPlus10, IconRowRemove } from "@tabler/icons-react";
15340
- import { useMemo as useMemo35, useState as useState23 } from "react";
15329
+ import { useMemo as useMemo35, useState as useState24 } from "react";
15341
15330
  import { jsx as jsx219, jsxs as jsxs126 } from "react/jsx-runtime";
15342
15331
  function Usecase_FileFieldMappingModal(_a) {
15343
15332
  var _b = _a, {
@@ -15353,8 +15342,8 @@ function Usecase_FileFieldMappingModal(_a) {
15353
15342
  "handleBack",
15354
15343
  "onCloseAll"
15355
15344
  ]);
15356
- const [selectedFields, setSelectedFields] = useState23([]);
15357
- const [columnMapping, setColumnMapping] = useState23({});
15345
+ const [selectedFields, setSelectedFields] = useState24([]);
15346
+ const [columnMapping, setColumnMapping] = useState24({});
15358
15347
  const excelColumns = useMemo35(() => {
15359
15348
  if (jsonData.length === 0) return [];
15360
15349
  return Object.keys(jsonData[0]);
@@ -15519,7 +15508,7 @@ import {
15519
15508
  Stack as Stack11
15520
15509
  } from "@mantine/core";
15521
15510
  import { IconCopy } from "@tabler/icons-react";
15522
- import { useEffect as useEffect26, useMemo as useMemo36, useState as useState24 } from "react";
15511
+ import { useEffect as useEffect26, useMemo as useMemo36, useState as useState25 } from "react";
15523
15512
  import * as XLSX4 from "xlsx";
15524
15513
  import { jsx as jsx220, jsxs as jsxs127 } from "react/jsx-runtime";
15525
15514
  function Usecase_FileImportConfigModal(_a) {
@@ -15532,11 +15521,11 @@ function Usecase_FileImportConfigModal(_a) {
15532
15521
  "onContinute",
15533
15522
  "onExportStructure"
15534
15523
  ]);
15535
- const [file, setFile] = useState24(null);
15536
- const [rawData, setRawData] = useState24([]);
15537
- const [parsedValueOnly, setParsedValueOnly] = useState24([]);
15538
- const [titleIndex, setTitleIndex] = useState24("2");
15539
- const [dataStartIndex, setDataStartIndex] = useState24("3");
15524
+ const [file, setFile] = useState25(null);
15525
+ const [rawData, setRawData] = useState25([]);
15526
+ const [parsedValueOnly, setParsedValueOnly] = useState25([]);
15527
+ const [titleIndex, setTitleIndex] = useState25("2");
15528
+ const [dataStartIndex, setDataStartIndex] = useState25("3");
15540
15529
  const parseExcel = async (file2) => {
15541
15530
  const data2 = await file2.arrayBuffer();
15542
15531
  const workbook = XLSX4.read(data2);
@@ -15649,7 +15638,7 @@ function Usecase_FileImportConfigModal(_a) {
15649
15638
 
15650
15639
  // src/core/overlays/MyModalStackImport/MyModalStackImport.tsx
15651
15640
  import { Modal as Modal21 } from "@mantine/core";
15652
- import { useState as useState25 } from "react";
15641
+ import { useState as useState26 } from "react";
15653
15642
  import { jsx as jsx221, jsxs as jsxs128 } from "react/jsx-runtime";
15654
15643
  function MyModalImport({
15655
15644
  fieldDefinition = [],
@@ -15657,9 +15646,9 @@ function MyModalImport({
15657
15646
  onExecute,
15658
15647
  onExportStructure
15659
15648
  }) {
15660
- const value = useState25([]);
15661
- const valueMapping = useState25([]);
15662
- const [detailRows, setDetailRows] = useState25([]);
15649
+ const value = useState26([]);
15650
+ const valueMapping = useState26([]);
15651
+ const [detailRows, setDetailRows] = useState26([]);
15663
15652
  return /* @__PURE__ */ jsxs128(Modal21.Stack, { children: [
15664
15653
  /* @__PURE__ */ jsx221(
15665
15654
  Usecase_FileImportConfigModal,
@@ -7,7 +7,7 @@ import { M as MyApiResponse } from '../createBaseApi-75GHCO22.mjs';
7
7
  import { useDisclosure, useListState } from '@mantine/hooks';
8
8
  import { UseFormReturnType, useForm } from '@mantine/form';
9
9
  import { M as MyReactMutationProps } from '../useMyReactMutation-CqcrOOF9.mjs';
10
- import { I as I_BasicAppShell_LinkItem, B as BasicAppShellProps } from '../types-DcfN8y1h.mjs';
10
+ import { I as I_BasicAppShell_LinkItem, B as BasicAppShellProps } from '../types-Crvq4zS5.mjs';
11
11
  import { I as IUtils_Excel_ColumnConfig } from '../utils_excel-BYB9qbHd.mjs';
12
12
  import { MRT_ColumnDef, MRT_RowData, MRT_TableOptions, MRT_TableInstance } from 'mantine-react-table';
13
13
  import { DateInputProps } from '@mantine/dates';
@@ -402,7 +402,7 @@ interface IMyTextInput extends TextInputProps {
402
402
  }
403
403
  declare function MyTextInput({ label, defaultValue, isPhoneNumber, ...rest }: IMyTextInput): react_jsx_runtime.JSX.Element;
404
404
 
405
- declare function BasicAppShell({ children, menu, extraTopRight, title, logoutRedirect }: BasicAppShellProps): react_jsx_runtime.JSX.Element;
405
+ declare function BasicAppShell({ children, menu, extraTopRight, title, logoutRedirect, filterMenuPermission }: BasicAppShellProps): react_jsx_runtime.JSX.Element;
406
406
 
407
407
  interface I$2 {
408
408
  moduleCode?: string;
@@ -68,7 +68,7 @@ import {
68
68
  useHeaderMegaMenuStore,
69
69
  useS_ButtonImport,
70
70
  useStore_BasicAppShell
71
- } from "../chunk-2I35MALV.mjs";
71
+ } from "../chunk-F67DOJR4.mjs";
72
72
  import "../chunk-PW6WTEVB.mjs";
73
73
  import "../chunk-5COIJ2CE.mjs";
74
74
  import "../chunk-7PUDC2WF.mjs";
@@ -23,7 +23,7 @@ import {
23
23
  MyStatsCard,
24
24
  MyTextInput2 as MyTextInput,
25
25
  MyWeeklySessionSchedulerPicker
26
- } from "../chunk-2I35MALV.mjs";
26
+ } from "../chunk-F67DOJR4.mjs";
27
27
  import "../chunk-PW6WTEVB.mjs";
28
28
  import "../chunk-5COIJ2CE.mjs";
29
29
  import "../chunk-7PUDC2WF.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MyModalDelete
3
- } from "../chunk-2I35MALV.mjs";
3
+ } from "../chunk-F67DOJR4.mjs";
4
4
  import "../chunk-PW6WTEVB.mjs";
5
5
  import "../chunk-5COIJ2CE.mjs";
6
6
  import "../chunk-7PUDC2WF.mjs";
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { I as I_BasicAppShell_LinkItem } from '../types-DcfN8y1h.mjs';
2
+ import { I as I_BasicAppShell_LinkItem } from '../types-Crvq4zS5.mjs';
3
3
  import { I as IBaseEntity } from '../IBaseEntity-ChMy9RzQ.mjs';
4
4
  import { SelectProps, ButtonProps } from '@mantine/core';
5
5
  import { I as IEmailConfig, a as IRole } from '../IRole-DMQeBuXf.mjs';
@@ -645,8 +645,8 @@ declare function F_organizationPolicyDocs_Update({ values, RegulationsTypeId, }:
645
645
  RegulationsTypeId: number;
646
646
  }): react_jsx_runtime.JSX.Element;
647
647
 
648
- declare function F_pageContentConfig({ menudataPrototype }: {
649
- menudataPrototype?: I_BasicAppShell_LinkItem[];
648
+ declare function F_pageContentConfig({ menuData }: {
649
+ menuData?: I_BasicAppShell_LinkItem[];
650
650
  }): react_jsx_runtime.JSX.Element;
651
651
 
652
652
  declare function F_roleCatalog(): react_jsx_runtime.JSX.Element;
@@ -102,7 +102,7 @@ import {
102
102
  Feat_accessControlLevel,
103
103
  useS_authenticate,
104
104
  useS_moduleConfig
105
- } from "../chunk-2I35MALV.mjs";
105
+ } from "../chunk-F67DOJR4.mjs";
106
106
  import "../chunk-PW6WTEVB.mjs";
107
107
  import "../chunk-5COIJ2CE.mjs";
108
108
  import "../chunk-7PUDC2WF.mjs";
@@ -9,6 +9,7 @@ interface I_BasicAppShell_LinkItem {
9
9
  note?: string;
10
10
  }
11
11
  interface BasicAppShellProps {
12
+ filterMenuPermission?: boolean;
12
13
  children: React.ReactNode;
13
14
  menu: I_BasicAppShell_LinkItem[];
14
15
  extraTopRight?: React.ReactNode;
package/package.json CHANGED
@@ -50,7 +50,7 @@
50
50
  "types": "./dist/types/index.d.mts"
51
51
  }
52
52
  },
53
- "version": "0.1.603",
53
+ "version": "0.1.604",
54
54
  "private": false,
55
55
  "files": [
56
56
  "dist"