aq-fe-framework 0.1.664 → 0.1.666

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.
@@ -1,3 +1,7 @@
1
+ import {
2
+ createGenericStore,
3
+ useStore_Permission
4
+ } from "./chunk-SUH3FFFV.mjs";
1
5
  import {
2
6
  U0MyValidateEmail,
3
7
  updateEnableList,
@@ -10,10 +14,6 @@ import {
10
14
  utils_mantineReactTable_sortColumnsByKeyOrder,
11
15
  utils_pdf_download
12
16
  } from "./chunk-GMM6RIVS.mjs";
13
- import {
14
- createGenericStore,
15
- useStore_Permission
16
- } from "./chunk-SUH3FFFV.mjs";
17
17
  import {
18
18
  baseColumns
19
19
  } from "./chunk-7PUDC2WF.mjs";
@@ -23,7 +23,7 @@ import {
23
23
  import {
24
24
  const_object_colors,
25
25
  const_object_documentTypes
26
- } from "./chunk-REMYBOSK.mjs";
26
+ } from "./chunk-IUTUR43V.mjs";
27
27
  import {
28
28
  enum_daysOfWeek,
29
29
  enum_emailConfigModule
@@ -1231,15 +1231,16 @@ var getActionConfig2 = (colorScheme) => ({
1231
1231
  });
1232
1232
  function MyButton2(_a) {
1233
1233
  var _b = _a, { children, actionType: actionType2, isCheckPermission = true } = _b, rest = __objRest(_b, ["children", "actionType", "isCheckPermission"]);
1234
- const currentPermission = useStore_Permission().state.currentPermissionPage;
1234
+ const permissionStore = useStore_Permission();
1235
1235
  const { colorScheme } = useMantineColorScheme3();
1236
1236
  if (!actionType2) {
1237
1237
  return /* @__PURE__ */ jsx21(Button4, __spreadProps(__spreadValues({}, rest), { children }));
1238
1238
  }
1239
1239
  const config2 = actionType2 ? getActionConfig2(colorScheme)[actionType2] : {};
1240
1240
  const shouldHide = (() => {
1241
- if (!isCheckPermission || !actionType2 || !currentPermission) return false;
1242
- return actionType2 === "create" && currentPermission.isCreate === false || actionType2 === "update" && currentPermission.isUpdate === false || actionType2 === "delete" && currentPermission.isDelete === false || actionType2 === "print" && currentPermission.isPrint === false || actionType2 === "export" && currentPermission.isExport === false;
1241
+ if (!isCheckPermission || !actionType2 || !permissionStore.state.currentPermissionPage || permissionStore.state.isSuperAdmin)
1242
+ return false;
1243
+ return actionType2 === "create" && permissionStore.state.currentPermissionPage.isCreate === false || actionType2 === "update" && permissionStore.state.currentPermissionPage.isUpdate === false || actionType2 === "delete" && permissionStore.state.currentPermissionPage.isDelete === false || actionType2 === "print" && permissionStore.state.currentPermissionPage.isPrint === false || actionType2 === "export" && permissionStore.state.currentPermissionPage.isExport === false;
1243
1244
  })();
1244
1245
  return /* @__PURE__ */ jsx21(Button4, __spreadValues(__spreadValues({ hidden: shouldHide }, config2), rest));
1245
1246
  }
@@ -9102,6 +9103,7 @@ function BasicAppShell({ children, menu, extraTopRight, title, logoutRedirect, i
9102
9103
  );
9103
9104
  const filteredMenu = useMemo8(
9104
9105
  () => {
9106
+ if (permissionStore.state.isSuperAdmin) return menu;
9105
9107
  if (isDev) return menu;
9106
9108
  return filterMenuByPermission(menu, readablePageIds);
9107
9109
  },
@@ -16319,6 +16321,7 @@ export {
16319
16321
  MyButtonModal2 as MyButtonModal,
16320
16322
  MyButtonModalForm,
16321
16323
  MyButtonPrintPDF,
16324
+ MyButtonViewFile,
16322
16325
  MyBoxesCore,
16323
16326
  Boxes,
16324
16327
  MyCardioLoader,
@@ -70,12 +70,12 @@ import {
70
70
  useHeaderMegaMenuStore,
71
71
  useS_ButtonImport,
72
72
  useStore_BasicAppShell
73
- } from "../chunk-7GZGQ6GX.mjs";
74
- import "../chunk-GMM6RIVS.mjs";
73
+ } from "../chunk-CMM4EQUV.mjs";
75
74
  import "../chunk-SUH3FFFV.mjs";
75
+ import "../chunk-GMM6RIVS.mjs";
76
76
  import "../chunk-7PUDC2WF.mjs";
77
77
  import "../chunk-EWDS5IOF.mjs";
78
- import "../chunk-REMYBOSK.mjs";
78
+ import "../chunk-IUTUR43V.mjs";
79
79
  import "../chunk-NP2GSNOZ.mjs";
80
80
  import "../chunk-DNYLK76M.mjs";
81
81
  import "../chunk-WZ6PXGGC.mjs";
@@ -3,7 +3,7 @@ import {
3
3
  const_object_colors,
4
4
  const_object_documentTypes,
5
5
  const_object_generalMenuData
6
- } from "../chunk-REMYBOSK.mjs";
6
+ } from "../chunk-IUTUR43V.mjs";
7
7
  import "../chunk-FWCSY2DS.mjs";
8
8
  export {
9
9
  const_array_daysOfWeek,
@@ -8,6 +8,7 @@ import { M as MyApiResponse } from '../createBaseApi-CyDUrrHC.mjs';
8
8
  import { useDisclosure } from '@mantine/hooks';
9
9
  import { M as MyReactMutationProps } from '../useMyReactMutation-E74JAAZE.mjs';
10
10
  import { UseReactToPrintOptions } from 'react-to-print';
11
+ import { I as IAQFileDetail } from '../utils_file-JlhzjLGS.mjs';
11
12
  import { UseQueryResult, QueryKey, UseQueryOptions } from '@tanstack/react-query';
12
13
  import { MRT_RowData, MRT_ColumnDef } from 'mantine-react-table';
13
14
  import { RichTextEditorProps, RichTextEditorToolbarProps, RichTextEditorContentProps } from '@mantine/tiptap';
@@ -90,6 +91,11 @@ interface MyButtonPrintPDFProps {
90
91
  }
91
92
  declare function MyButtonPrintPDF({ children, autoPadding, buttonProps, useReactToPrintProps, pageSize, }: MyButtonPrintPDFProps): react_jsx_runtime.JSX.Element;
92
93
 
94
+ interface MyButtonViewFile extends Omit<MyButtonModalProps, "disclosure"> {
95
+ file: IAQFileDetail;
96
+ }
97
+ declare function MyButtonViewFile({ file, ...rest }: MyButtonViewFile): react_jsx_runtime.JSX.Element;
98
+
93
99
  declare function MyDataTableSelectOne<TData extends MRT_RowData>({ columns, queryResult, idSelection, setIdSelection }: {
94
100
  columns: MRT_ColumnDef<TData>[];
95
101
  queryResult: UseQueryResult<TData[], Error>;
@@ -268,4 +274,4 @@ interface ValidationResult {
268
274
  rows?: RowDetail[];
269
275
  }
270
276
 
271
- export { DroppablePlaceholder, type FieldDefinition, type IWeeklySession, type ModalImportId, MyActionIcon, type MyActionIconProps, MyButton, MyButtonCreateUpdate, type MyButtonExportStructureProps, MyButtonModal, MyButtonModalForm, type MyButtonModalFormProps, type MyButtonModalProps, MyButtonPrintPDF, type MyButtonPrintPDFProps, type MyButtonProps$1 as MyButtonProps, MyDataTableSelectOne, MyDayOfWeekPicker, MyFileInputPreview, MyFlexColumn, MyFlexEnd, MyFlexIconTitle, MyInfoBox, type MyInfoBoxItem, type MyInfoBoxProps, MyLabelValueRow, MyModalImport, MyPrintContent, type MyPrintContentProps, MyRichTextEditor, MySelect, MySelectFromAPI, type MySelectFromAPIProps, type MySelectProps, MyStatsCard, MyTextInput, MyWeeklySessionSchedulerPicker, type RowDetail, type ValidationResult, type WeeklySessionSchedulerProps };
277
+ export { DroppablePlaceholder, type FieldDefinition, type IWeeklySession, type ModalImportId, MyActionIcon, type MyActionIconProps, MyButton, MyButtonCreateUpdate, type MyButtonExportStructureProps, MyButtonModal, MyButtonModalForm, type MyButtonModalFormProps, type MyButtonModalProps, MyButtonPrintPDF, type MyButtonPrintPDFProps, type MyButtonProps$1 as MyButtonProps, MyButtonViewFile, MyDataTableSelectOne, MyDayOfWeekPicker, MyFileInputPreview, MyFlexColumn, MyFlexEnd, MyFlexIconTitle, MyInfoBox, type MyInfoBoxItem, type MyInfoBoxProps, MyLabelValueRow, MyModalImport, MyPrintContent, type MyPrintContentProps, MyRichTextEditor, MySelect, MySelectFromAPI, type MySelectFromAPIProps, type MySelectProps, MyStatsCard, MyTextInput, MyWeeklySessionSchedulerPicker, type RowDetail, type ValidationResult, type WeeklySessionSchedulerProps };
@@ -6,6 +6,7 @@ import {
6
6
  MyButtonModal,
7
7
  MyButtonModalForm,
8
8
  MyButtonPrintPDF,
9
+ MyButtonViewFile,
9
10
  MyDataTableSelectOne,
10
11
  MyDayOfWeekPicker,
11
12
  MyFileInputPreview,
@@ -23,12 +24,12 @@ import {
23
24
  MyStatsCard,
24
25
  MyTextInput2 as MyTextInput,
25
26
  MyWeeklySessionSchedulerPicker
26
- } from "../chunk-7GZGQ6GX.mjs";
27
- import "../chunk-GMM6RIVS.mjs";
27
+ } from "../chunk-CMM4EQUV.mjs";
28
28
  import "../chunk-SUH3FFFV.mjs";
29
+ import "../chunk-GMM6RIVS.mjs";
29
30
  import "../chunk-7PUDC2WF.mjs";
30
31
  import "../chunk-EWDS5IOF.mjs";
31
- import "../chunk-REMYBOSK.mjs";
32
+ import "../chunk-IUTUR43V.mjs";
32
33
  import "../chunk-NP2GSNOZ.mjs";
33
34
  import "../chunk-DNYLK76M.mjs";
34
35
  import "../chunk-WZ6PXGGC.mjs";
@@ -42,6 +43,7 @@ export {
42
43
  MyButtonModal,
43
44
  MyButtonModalForm,
44
45
  MyButtonPrintPDF,
46
+ MyButtonViewFile,
45
47
  MyDataTableSelectOne,
46
48
  MyDayOfWeekPicker,
47
49
  MyFileInputPreview,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  MyModalDelete
3
- } from "../chunk-7GZGQ6GX.mjs";
4
- import "../chunk-GMM6RIVS.mjs";
3
+ } from "../chunk-CMM4EQUV.mjs";
5
4
  import "../chunk-SUH3FFFV.mjs";
5
+ import "../chunk-GMM6RIVS.mjs";
6
6
  import "../chunk-7PUDC2WF.mjs";
7
7
  import "../chunk-EWDS5IOF.mjs";
8
- import "../chunk-REMYBOSK.mjs";
8
+ import "../chunk-IUTUR43V.mjs";
9
9
  import "../chunk-NP2GSNOZ.mjs";
10
10
  import {
11
11
  useMyReactMutation
@@ -106,12 +106,12 @@ import {
106
106
  Feat_accessControlLevel,
107
107
  useS_authenticate,
108
108
  useS_moduleConfig
109
- } from "../chunk-7GZGQ6GX.mjs";
110
- import "../chunk-GMM6RIVS.mjs";
109
+ } from "../chunk-CMM4EQUV.mjs";
111
110
  import "../chunk-SUH3FFFV.mjs";
111
+ import "../chunk-GMM6RIVS.mjs";
112
112
  import "../chunk-7PUDC2WF.mjs";
113
113
  import "../chunk-EWDS5IOF.mjs";
114
- import "../chunk-REMYBOSK.mjs";
114
+ import "../chunk-IUTUR43V.mjs";
115
115
  import "../chunk-NP2GSNOZ.mjs";
116
116
  import "../chunk-DNYLK76M.mjs";
117
117
  import "../chunk-WZ6PXGGC.mjs";
@@ -47,6 +47,7 @@ declare function createTenantSettingsStore<TKey>(params: {
47
47
  interface I {
48
48
  permission?: IPagePermission[];
49
49
  currentPermissionPage?: IPagePermission;
50
+ isSuperAdmin?: boolean;
50
51
  }
51
52
  declare function useStore_Permission(): {
52
53
  state: I;
package/package.json CHANGED
@@ -50,7 +50,7 @@
50
50
  "types": "./dist/types/index.d.mts"
51
51
  }
52
52
  },
53
- "version": "0.1.664",
53
+ "version": "0.1.666",
54
54
  "private": false,
55
55
  "files": [
56
56
  "dist"
@@ -72,8 +72,8 @@ var const_object_generalMenuData = {
72
72
  };
73
73
 
74
74
  export {
75
- const_array_daysOfWeek,
76
75
  const_object_colors,
76
+ const_array_daysOfWeek,
77
77
  const_object_documentTypes,
78
78
  const_object_generalMenuData
79
79
  };