aq-fe-framework 0.1.503 → 0.1.506

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.
@@ -263,6 +263,14 @@ function utils_list_sumField(list, field) {
263
263
  return list.reduce((sum, item) => sum + Number(item[field]), 0);
264
264
  }
265
265
 
266
+ // src/utils/utils_mantineDataTable.ts
267
+ function utils_mantineDataTable_filterColumns(allColumns, visibleFields) {
268
+ if (!visibleFields || visibleFields.length === 0) return allColumns;
269
+ return allColumns.filter(
270
+ (col) => typeof col.accessorKey === "string" && visibleFields.includes(col.accessorKey)
271
+ );
272
+ }
273
+
266
274
  // src/utils/utils_reactQuery.ts
267
275
  function utils_reactQuery_updateListItemInQuery({
268
276
  queryClient,
@@ -336,6 +344,7 @@ var utils_validator_validateCode = (value) => {
336
344
  };
337
345
 
338
346
  export {
347
+ utils_mantineDataTable_filterColumns,
339
348
  U0MyValidateEmpty,
340
349
  U0MyValidateEmail,
341
350
  utils_validator_validateCode,
@@ -2,7 +2,7 @@ import {
2
2
  MyDataTable,
3
3
  MyFlexColumn,
4
4
  MyFlexRow
5
- } from "./chunk-LJRJYSNW.mjs";
5
+ } from "./chunk-KCYPNG4W.mjs";
6
6
  import {
7
7
  const_object_colors
8
8
  } from "./chunk-OMJJAHOC.mjs";
@@ -98,7 +98,7 @@ function MyActionIcon(_a) {
98
98
  }
99
99
 
100
100
  // src/core/button/MyButton.tsx
101
- import { Button } from "@mantine/core";
101
+ import { Button, useMantineColorScheme } from "@mantine/core";
102
102
  import {
103
103
  IconDeviceFloppy as IconDeviceFloppy2,
104
104
  IconDownload,
@@ -110,70 +110,71 @@ import {
110
110
  IconX as IconX2
111
111
  } from "@tabler/icons-react";
112
112
  import { jsx as jsx2 } from "react/jsx-runtime";
113
- var actionConfig2 = {
114
- default: {
115
- children: ""
116
- },
117
- create: {
118
- color: "blue",
119
- type: "submit",
120
- leftSection: /* @__PURE__ */ jsx2(IconPlus2, {}),
121
- children: "Th\xEAm"
122
- },
123
- createMultiple: {
124
- color: "green",
125
- type: "submit",
126
- leftSection: /* @__PURE__ */ jsx2(IconPlus2, {}),
127
- children: "Th\xEAm danh s\xE1ch"
128
- },
129
- delete: {
130
- color: "red",
131
- leftSection: /* @__PURE__ */ jsx2(IconTrash2, {}),
132
- children: "X\xF3a"
133
- },
134
- update: {
135
- color: "yellow",
136
- type: "submit",
137
- leftSection: /* @__PURE__ */ jsx2(IconEdit2, {}),
138
- children: "Ch\u1EC9nh s\u1EEDa"
139
- },
140
- save: {
141
- color: "blue",
142
- type: "submit",
143
- leftSection: /* @__PURE__ */ jsx2(IconDeviceFloppy2, {}),
144
- children: "L\u01B0u"
145
- },
146
- import: {
147
- color: "green",
148
- leftSection: /* @__PURE__ */ jsx2(IconUpload, {}),
149
- children: "Import",
150
- variant: "light"
151
- },
152
- export: {
153
- color: "violet",
154
- leftSection: /* @__PURE__ */ jsx2(IconDownload, {}),
155
- children: "Export",
156
- variant: "light"
157
- },
158
- print: {
159
- color: "orange.7",
160
- leftSection: /* @__PURE__ */ jsx2(IconPrinter2, {}),
161
- children: "In"
162
- },
163
- cancel: {
164
- color: "gray",
165
- leftSection: /* @__PURE__ */ jsx2(IconX2, {}),
166
- children: "H\u1EE7y thao t\xE1c"
167
- },
168
- select: {
169
- children: "Ch\u1ECDn"
170
- },
171
- check: {
172
- children: "Ch\u1ECDn"
173
- }
174
- };
175
113
  function MyButton(_a) {
176
114
  var _b = _a, { children, actionType } = _b, rest = __objRest(_b, ["children", "actionType"]);
115
+ const { colorScheme } = useMantineColorScheme();
116
+ const actionConfig2 = {
117
+ default: {
118
+ children: ""
119
+ },
120
+ create: {
121
+ color: colorScheme == "light" ? "blue" : "blue.3",
122
+ type: "submit",
123
+ leftSection: /* @__PURE__ */ jsx2(IconPlus2, {}),
124
+ children: "Th\xEAm"
125
+ },
126
+ createMultiple: {
127
+ color: "green",
128
+ type: "submit",
129
+ leftSection: /* @__PURE__ */ jsx2(IconPlus2, {}),
130
+ children: "Th\xEAm danh s\xE1ch"
131
+ },
132
+ delete: {
133
+ color: "red",
134
+ leftSection: /* @__PURE__ */ jsx2(IconTrash2, {}),
135
+ children: "X\xF3a"
136
+ },
137
+ update: {
138
+ color: "yellow",
139
+ type: "submit",
140
+ leftSection: /* @__PURE__ */ jsx2(IconEdit2, {}),
141
+ children: "Ch\u1EC9nh s\u1EEDa"
142
+ },
143
+ save: {
144
+ color: "blue",
145
+ type: "submit",
146
+ leftSection: /* @__PURE__ */ jsx2(IconDeviceFloppy2, {}),
147
+ children: "L\u01B0u"
148
+ },
149
+ import: {
150
+ color: colorScheme == "light" ? "green" : "green.3",
151
+ leftSection: /* @__PURE__ */ jsx2(IconUpload, {}),
152
+ children: "Import",
153
+ variant: "light"
154
+ },
155
+ export: {
156
+ color: colorScheme == "light" ? "violet" : "violet.3",
157
+ leftSection: /* @__PURE__ */ jsx2(IconDownload, {}),
158
+ children: "Export",
159
+ variant: "light"
160
+ },
161
+ print: {
162
+ color: "orange.7",
163
+ leftSection: /* @__PURE__ */ jsx2(IconPrinter2, {}),
164
+ children: "In"
165
+ },
166
+ cancel: {
167
+ color: "gray",
168
+ leftSection: /* @__PURE__ */ jsx2(IconX2, {}),
169
+ children: "H\u1EE7y thao t\xE1c"
170
+ },
171
+ select: {
172
+ children: "Ch\u1ECDn"
173
+ },
174
+ check: {
175
+ children: "Ch\u1ECDn"
176
+ }
177
+ };
177
178
  if (!actionType) {
178
179
  return /* @__PURE__ */ jsx2(Button, __spreadProps(__spreadValues({}, rest), { children }));
179
180
  }
@@ -182,7 +183,7 @@ function MyButton(_a) {
182
183
  }
183
184
 
184
185
  // src/core/button/MyButtonCreateUpdate.tsx
185
- import { ActionIcon as ActionIcon2, Button as Button2, Modal, ScrollArea, Space, useMantineColorScheme } from "@mantine/core";
186
+ import { ActionIcon as ActionIcon2, Button as Button2, Modal, ScrollArea, Space, useMantineColorScheme as useMantineColorScheme2 } from "@mantine/core";
186
187
  import { useDisclosure } from "@mantine/hooks";
187
188
  import { IconEdit as IconEdit3, IconPlus as IconPlus3 } from "@tabler/icons-react";
188
189
  import { useQueryClient } from "@tanstack/react-query";
@@ -214,7 +215,7 @@ function MyButtonCreateUpdate({
214
215
  isUpdate = false,
215
216
  scrollAreaAutosizeProps
216
217
  }) {
217
- const theme = useMantineColorScheme();
218
+ const theme = useMantineColorScheme2();
218
219
  const defaultDisclosure = useDisclosure();
219
220
  const disclosure = externalDisclosure != null ? externalDisclosure : defaultDisclosure;
220
221
  const queryClient = useQueryClient();
@@ -2,7 +2,7 @@ import { MRT_ColumnDef } from 'mantine-react-table';
2
2
 
3
3
  interface IBaseColumns {
4
4
  modifiedFullName?: string;
5
- modifiedWhen?: string;
5
+ modifiedWhen?: Date;
6
6
  }
7
7
  declare const baseColumns: MRT_ColumnDef<IBaseColumns>[];
8
8
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  baseColumns
3
- } from "../chunk-BEFEWY44.mjs";
3
+ } from "../chunk-7PUDC2WF.mjs";
4
4
  import "../chunk-EWDS5IOF.mjs";
5
5
  import "../chunk-FWCSY2DS.mjs";
6
6
  export {
@@ -1,22 +1,21 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React__default, { ReactNode, ComponentProps } from 'react';
3
- import { t as type_action, T as TYPES_MANTINE_SIZE } from '../types-B5rmBuXz.mjs';
3
+ import { t as type_action, a as type_mantineSize } from '../types-DI2fdq_c.mjs';
4
4
  import { ActionIconProps, ButtonProps, useModalsStack, CheckboxProps, SelectProps, NumberFormatterProps, FieldsetProps, FileInputProps, NumberInputProps, TextareaProps, MantineSize, InputWrapperProps, TextInputProps, ContainerProps, FlexProps, GroupProps, TypographyStylesProviderProps, TabsProps, SkeletonProps } from '@mantine/core';
5
- import { M as MyApiResponse } from '../createBaseApi-D9OK2lA_.mjs';
5
+ import { M as MyApiResponse } from '../createBaseApi-75GHCO22.mjs';
6
6
  import { AxiosResponse } from 'axios';
7
7
  import { useDisclosure, useListState } from '@mantine/hooks';
8
8
  import { UseFormReturnType, useForm } from '@mantine/form';
9
- import { I as I_BasicAppShell_LinkItem } from '../BasicAppShell-CBONSKKX.mjs';
10
- export { a as BasicAppShell, B as BasicAppShell_transformMenuToEnum, g as groupToTwoLevels, u as utils_layout_getItemsWithoutLinks } from '../BasicAppShell-CBONSKKX.mjs';
9
+ import { I as I_BasicAppShell_LinkItem } from '../BasicAppShell-BOu5-Gvr.mjs';
10
+ export { a as BasicAppShell, B as BasicAppShell_transformMenuToEnum, f as flattenMenuGroups, g as groupToTwoLevels, u as utils_layout_getItemsWithoutLinks } from '../BasicAppShell-BOu5-Gvr.mjs';
11
11
  import { I as IUtils_Excel_ColumnConfig, a as IAQFileDetail } from '../utils_file-G8NTHCO-.mjs';
12
12
  import { MRT_ColumnDef, MRT_RowData, MRT_TableOptions, MRT_TableInstance } from 'mantine-react-table';
13
- import { ConfigOptions } from 'export-to-csv';
14
13
  import { DateInputProps } from '@mantine/dates';
15
14
  import { RichTextEditorProps } from '@mantine/tiptap';
16
15
  import { EditorOptions } from '@tiptap/react';
17
16
  import { IconProps, Icon } from '@tabler/icons-react';
18
17
  import { CalendarEventExternal } from '@schedule-x/calendar';
19
- import '../IBaseEntity-BprRafT5.mjs';
18
+ import '../IBaseEntity-ChMy9RzQ.mjs';
20
19
  import 'exceljs';
21
20
 
22
21
  declare const MyBoxesCore: ({ className, ...rest }: {
@@ -47,7 +46,7 @@ interface IMyActionIconModal extends Omit<React.ButtonHTMLAttributes<HTMLButtonE
47
46
  title?: ReactNode;
48
47
  children?: ReactNode;
49
48
  crudType?: type_action;
50
- modalSize?: TYPES_MANTINE_SIZE;
49
+ modalSize?: type_mantineSize;
51
50
  disclosure: ReturnType<typeof useDisclosure>;
52
51
  fullScreen?: boolean;
53
52
  icon?: ReactNode;
@@ -107,7 +106,7 @@ interface IMyButtonModal extends Omit<React.ButtonHTMLAttributes<HTMLButtonEleme
107
106
  title?: ReactNode;
108
107
  children?: ReactNode;
109
108
  crudType?: type_action;
110
- modalSize?: TYPES_MANTINE_SIZE;
109
+ modalSize?: type_mantineSize;
111
110
  objectName?: string;
112
111
  disclosure: ReturnType<typeof useDisclosure>;
113
112
  fullScreen?: boolean;
@@ -205,7 +204,7 @@ interface IAQSelectTableByOpenModal<TData extends MRT_RowData> extends Omit<MRT_
205
204
  label?: string;
206
205
  listLabel?: string;
207
206
  title?: string;
208
- modalSize?: TYPES_MANTINE_SIZE;
207
+ modalSize?: type_mantineSize;
209
208
  objectName?: string;
210
209
  fullScreen?: boolean;
211
210
  setSelectedData: (data: any) => void;
@@ -298,32 +297,23 @@ interface MyCardInformationProps {
298
297
  }
299
298
  declare function MyCardInformation({ title, value, unit, description, icon, diff, extraControl }: MyCardInformationProps): react_jsx_runtime.JSX.Element;
300
299
 
301
- type FormatFunction<TData extends MRT_RowData> = (value: any) => any;
302
300
  interface MyDataTableInternalProps<TData extends MRT_RowData> extends Omit<MyDataTableProps<TData>, "columns" | "data"> {
303
301
  }
304
302
  interface MyDataTableProps<TData extends MRT_RowData> extends MRT_TableOptions<TData> {
305
303
  columns: MRT_ColumnDef<TData>[];
306
304
  data: TData[];
307
305
  rowActionSize?: number;
308
- exportAble?: boolean;
309
- renderTopToolbarCustomActions?: ((props: {
310
- table: MRT_TableInstance<TData>;
311
- }) => ReactNode) | undefined;
312
- csvConfigProps?: ConfigOptions;
313
- formats?: {
314
- [K in keyof TData]?: FormatFunction<TData>;
315
- };
316
- setSelectedRow?: (data: any) => void;
306
+ setSelectedRow?: (data: TData[]) => void;
317
307
  isError?: boolean;
318
308
  isLoading?: boolean;
319
309
  pagination?: {
320
310
  pageIndex: number;
321
311
  pageSize: number;
322
312
  };
323
- state?: Partial<MRT_TableOptions<TData>['state']>;
324
- initialState?: Partial<MRT_TableOptions<TData>['initialState']>;
313
+ idSelectionOne?: string;
314
+ setIdSelectionOne?: (value: string) => void;
325
315
  }
326
- declare function MyDataTable<TData extends MRT_RowData>({ formats, exportAble, csvConfigProps, rowActionSize, columns, data, renderTopToolbarCustomActions, setSelectedRow, isError, isLoading, pagination, initialState, state, ...rest }: MyDataTableProps<TData>): react_jsx_runtime.JSX.Element | undefined;
316
+ declare function MyDataTable<TData extends MRT_RowData>({ rowActionSize, columns, data, setSelectedRow, isError, isLoading, pagination, idSelectionOne, setIdSelectionOne, ...rest }: MyDataTableProps<TData>): react_jsx_runtime.JSX.Element;
327
317
 
328
318
  interface MyIconTextProps {
329
319
  icon?: React.ElementType;
@@ -61,12 +61,13 @@ import {
61
61
  MyTextInput,
62
62
  SelectFieldModal,
63
63
  SelectFileModal,
64
+ flattenMenuGroups,
64
65
  groupToTwoLevels,
65
66
  useHeaderMegaMenuStore,
66
67
  useS_BasicAppShell,
67
68
  useS_ButtonImport,
68
69
  utils_layout_getItemsWithoutLinks
69
- } from "../chunk-LJRJYSNW.mjs";
70
+ } from "../chunk-KCYPNG4W.mjs";
70
71
  import "../chunk-U62R2QKJ.mjs";
71
72
  import "../chunk-5U2JSHSJ.mjs";
72
73
  import "../chunk-OMJJAHOC.mjs";
@@ -136,6 +137,7 @@ export {
136
137
  MyTextInput,
137
138
  SelectFieldModal,
138
139
  SelectFileModal,
140
+ flattenMenuGroups,
139
141
  groupToTwoLevels,
140
142
  useHeaderMegaMenuStore,
141
143
  useS_BasicAppShell,
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { t as type_action } from '../types-B5rmBuXz.mjs';
2
+ import { t as type_action } from '../types-DI2fdq_c.mjs';
3
3
  import { ActionIconProps, ButtonProps, ModalProps, ScrollAreaAutosizeProps, TextProps, PaperProps, GroupProps, ThemeIconProps, InputWrapperProps, SelectProps, TextInputProps, FlexProps } from '@mantine/core';
4
4
  import { ReactNode, ButtonHTMLAttributes } from 'react';
5
- import { M as MyApiResponse } from '../createBaseApi-D9OK2lA_.mjs';
5
+ import { M as MyApiResponse } from '../createBaseApi-75GHCO22.mjs';
6
6
  import { AxiosResponse } from 'axios';
7
7
  import { UseFormReturnType } from '@mantine/form';
8
8
  import { useDisclosure } from '@mantine/hooks';
@@ -10,7 +10,7 @@ import { UseReactToPrintOptions } from 'react-to-print';
10
10
  import { UseQueryResult, QueryKey, UseQueryOptions } from '@tanstack/react-query';
11
11
  import { MRT_RowData, MRT_ColumnDef } from 'mantine-react-table';
12
12
  import { RichTextEditorProps, RichTextEditorToolbarProps, RichTextEditorContentProps } from '@mantine/tiptap';
13
- import { I as IBaseEntity } from '../IBaseEntity-BprRafT5.mjs';
13
+ import { I as IBaseEntity } from '../IBaseEntity-ChMy9RzQ.mjs';
14
14
 
15
15
  interface MyActionIconProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "style">, ActionIconProps {
16
16
  actionType?: type_action;
@@ -18,11 +18,11 @@ import {
18
18
  MyStatsCard,
19
19
  MyTextInput,
20
20
  MyWeeklySessionSchedulerPicker
21
- } from "../chunk-LB6M373A.mjs";
22
- import "../chunk-LJRJYSNW.mjs";
21
+ } from "../chunk-RVLIJK3A.mjs";
22
+ import "../chunk-GFEMKKFH.mjs";
23
+ import "../chunk-KCYPNG4W.mjs";
23
24
  import "../chunk-U62R2QKJ.mjs";
24
25
  import "../chunk-5U2JSHSJ.mjs";
25
- import "../chunk-GFEMKKFH.mjs";
26
26
  import "../chunk-OMJJAHOC.mjs";
27
27
  import "../chunk-K6S7R6LU.mjs";
28
28
  import "../chunk-5IELATPH.mjs";
@@ -1,6 +1,6 @@
1
1
  import * as axios from 'axios';
2
2
  import { AxiosInstance } from 'axios';
3
- import { I as IBaseEntity } from './IBaseEntity-BprRafT5.mjs';
3
+ import { I as IBaseEntity } from './IBaseEntity-ChMy9RzQ.mjs';
4
4
 
5
5
  interface IPagingParams {
6
6
  pageNumber?: number;
@@ -1,12 +1,12 @@
1
1
  import * as next_dist_shared_lib_app_router_context_shared_runtime from 'next/dist/shared/lib/app-router-context.shared-runtime';
2
- import { M as MyApiResponse } from '../createBaseApi-D9OK2lA_.mjs';
3
- export { I as IPagingParams, c as createBaseApi } from '../createBaseApi-D9OK2lA_.mjs';
2
+ import { M as MyApiResponse } from '../createBaseApi-75GHCO22.mjs';
3
+ export { I as IPagingParams, c as createBaseApi } from '../createBaseApi-75GHCO22.mjs';
4
4
  import * as React from 'react';
5
5
  import { AxiosInstance, AxiosResponse } from 'axios';
6
6
  import * as _tanstack_react_query from '@tanstack/react-query';
7
7
  import { UseMutationOptions, QueryKey, UseQueryOptions } from '@tanstack/react-query';
8
- import { I as IAQModule } from '../IAQModule-DfONsRwE.mjs';
9
- import '../IBaseEntity-BprRafT5.mjs';
8
+ import { I as IAQModule } from '../IAQModule-4U3n2emx.mjs';
9
+ import '../IBaseEntity-ChMy9RzQ.mjs';
10
10
 
11
11
  declare function useMyDevice(): {
12
12
  isMobile: boolean | undefined;
@@ -1,6 +1,6 @@
1
- export { I as IAQModule } from '../IAQModule-DfONsRwE.mjs';
2
- import { I as IBaseEntity } from '../IBaseEntity-BprRafT5.mjs';
3
- export { I as IEmailConfig } from '../IEmailConfig-Bza2PzTi.mjs';
1
+ export { I as IAQModule } from '../IAQModule-4U3n2emx.mjs';
2
+ import { I as IBaseEntity } from '../IBaseEntity-ChMy9RzQ.mjs';
3
+ export { I as IEmailConfig } from '../IEmailConfig-CioPObC1.mjs';
4
4
 
5
5
  interface IFile {
6
6
  fileName?: string | undefined;
@@ -32,6 +32,15 @@ interface IDocument {
32
32
  fileDetail?: IFile;
33
33
  }
34
34
 
35
+ interface IDocumentAttribute {
36
+ documentType?: number;
37
+ id?: number;
38
+ code?: string;
39
+ name?: string;
40
+ concurrencyStamp?: string;
41
+ isEnabled?: boolean;
42
+ }
43
+
35
44
  interface IPagePermission {
36
45
  pageId?: number;
37
46
  isCreate?: boolean;
@@ -43,6 +52,14 @@ interface IPagePermission {
43
52
  }
44
53
 
45
54
  interface IRole extends IBaseEntity {
55
+ isCreate?: boolean;
56
+ isUpdate?: boolean;
57
+ isDelete?: boolean;
58
+ isRead?: boolean;
59
+ isPrint?: boolean;
60
+ isExport?: boolean;
61
+ pageId?: number;
62
+ roleId?: number;
46
63
  }
47
64
 
48
65
  interface IUser extends IBaseEntity {
@@ -55,4 +72,4 @@ interface IPageContent extends IBaseEntity {
55
72
  description?: string;
56
73
  }
57
74
 
58
- export { IBaseEntity, type IDocument, type IFile, type IPageContent, type IPagePermission, type IRole, type IUser };
75
+ export { IBaseEntity, type IDocument, type IDocumentAttribute, type IFile, type IPageContent, type IPagePermission, type IRole, type IUser };
@@ -1,9 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { I as I_BasicAppShell_LinkItem } from '../BasicAppShell-CBONSKKX.mjs';
3
- import { I as IBaseEntity } from '../IBaseEntity-BprRafT5.mjs';
2
+ import { I as I_BasicAppShell_LinkItem } from '../BasicAppShell-BOu5-Gvr.mjs';
3
+ import { I as IBaseEntity } from '../IBaseEntity-ChMy9RzQ.mjs';
4
4
  import { SelectProps, ButtonProps } from '@mantine/core';
5
- import { I as IEmailConfig } from '../IEmailConfig-Bza2PzTi.mjs';
6
- import { I as IAQModule } from '../IAQModule-DfONsRwE.mjs';
5
+ import { I as IEmailConfig } from '../IEmailConfig-CioPObC1.mjs';
6
+ import { I as IAQModule } from '../IAQModule-4U3n2emx.mjs';
7
7
  import { ReactNode } from 'react';
8
8
 
9
9
  declare function F_accessControl({ menuData }: {