aq-fe-framework 0.1.23 → 0.1.25

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.
@@ -0,0 +1,97 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+
33
+ // src/utils/notification.ts
34
+ import { notifications } from "@mantine/notifications";
35
+ function utils_notification_show({ crudType = "create", message, color }) {
36
+ if (crudType == "create") {
37
+ notifications.show({
38
+ message: message ? message : "Th\xEAm th\xE0nh c\xF4ng!",
39
+ color: color ? color : "green"
40
+ });
41
+ return;
42
+ }
43
+ if (crudType == "update") {
44
+ notifications.show({
45
+ message: message ? message : "C\u1EADp nh\u1EADt th\xE0nh c\xF4ng!",
46
+ color: color ? color : "green"
47
+ });
48
+ return;
49
+ }
50
+ if (crudType == "delete") {
51
+ notifications.show({
52
+ message: message ? message : "X\xF3a th\xE0nh c\xF4ng!",
53
+ color: color ? color : "green"
54
+ });
55
+ return;
56
+ }
57
+ if (crudType == "error") {
58
+ notifications.show({
59
+ message: message ? message : "L\u1ED7i!",
60
+ color: color ? color : "red"
61
+ });
62
+ return;
63
+ }
64
+ if (crudType == "importSucess") {
65
+ notifications.show({
66
+ message: message ? message : "Import th\xE0nh c\xF4ng!"
67
+ });
68
+ return;
69
+ }
70
+ }
71
+
72
+ // src/utils/pdf.ts
73
+ import axios from "axios";
74
+ async function utils_pdf_download(url) {
75
+ try {
76
+ const response = await axios.get(url, {
77
+ responseType: "blob"
78
+ // Đảm bảo nhận dữ liệu dạng blob để tải file
79
+ });
80
+ const blob = new Blob([response.data], { type: "application/pdf" });
81
+ const link = document.createElement("a");
82
+ link.href = window.URL.createObjectURL(blob);
83
+ link.download = "file.pdf";
84
+ link.click();
85
+ window.URL.revokeObjectURL(link.href);
86
+ } catch (error) {
87
+ console.error("Error downloading PDF:", error);
88
+ }
89
+ }
90
+
91
+ export {
92
+ __spreadValues,
93
+ __spreadProps,
94
+ __objRest,
95
+ utils_notification_show,
96
+ utils_pdf_download
97
+ };
@@ -0,0 +1,112 @@
1
+ /* src/components/ActionIcons/SwitchTheme/css.module.css */
2
+ .icon {
3
+ width: calc(1.375rem * var(--mantine-scale));
4
+ height: calc(1.375rem * var(--mantine-scale));
5
+ }
6
+ [data-mantine-color-scheme=dark] .dark {
7
+ display: none;
8
+ }
9
+ [data-mantine-color-scheme=light] .dark {
10
+ display: block;
11
+ }
12
+ [data-mantine-color-scheme=light] .light {
13
+ display: none;
14
+ }
15
+ [data-mantine-color-scheme=dark] .light {
16
+ display: block;
17
+ }
18
+
19
+ /* src/components/Layouts/HeaderMegaMenu/css.module.css */
20
+ .header {
21
+ position: sticky;
22
+ top: 0;
23
+ z-index: 1;
24
+ height: calc(3.75rem * var(--mantine-scale));
25
+ background-color: var(--mantine-color-white);
26
+ }
27
+ [data-mantine-color-scheme=dark] .header {
28
+ background-color: var(--mantine-color-dark);
29
+ }
30
+ .header {
31
+ padding-left: var(--mantine-spacing-md);
32
+ padding-right: var(--mantine-spacing-md);
33
+ border-bottom: 1px solid var(--mantine-color-gray-3);
34
+ }
35
+ [data-mantine-color-scheme=dark] .header {
36
+ border-bottom: 1px solid var(--mantine-color-dark-4);
37
+ }
38
+ .link {
39
+ display: flex;
40
+ align-items: center;
41
+ height: 100%;
42
+ padding-left: var(--mantine-spacing-md);
43
+ padding-right: var(--mantine-spacing-md);
44
+ text-decoration: none;
45
+ color: var(--mantine-color-black);
46
+ }
47
+ [data-mantine-color-scheme=dark] .link {
48
+ color: var(--mantine-color-white);
49
+ }
50
+ .link {
51
+ font-weight: 500;
52
+ font-size: var(--mantine-font-size-sm);
53
+ }
54
+ @media (max-width: $mantine-breakpoint-sm) {
55
+ .link {
56
+ height: calc(2.625rem * var(--mantine-scale));
57
+ width: 100%;
58
+ }
59
+ }
60
+ @media (hover: hover) {
61
+ .link:hover {
62
+ background-color: var(--mantine-color-gray-0);
63
+ }
64
+ [data-mantine-color-scheme=dark] .link:hover {
65
+ background-color: var(--mantine-color-dark-6);
66
+ }
67
+ }
68
+ @media (hover: none) {
69
+ .link:active {
70
+ background-color: var(--mantine-color-gray-0);
71
+ }
72
+ [data-mantine-color-scheme=dark] .link:active {
73
+ background-color: var(--mantine-color-dark-6);
74
+ }
75
+ }
76
+ .subLink {
77
+ width: 100%;
78
+ padding: var(--mantine-spacing-xs) var(--mantine-spacing-md);
79
+ border-radius: var(--mantine-radius-md);
80
+ }
81
+ @media (hover: hover) {
82
+ .subLink:hover {
83
+ background-color: var(--mantine-color-gray-0);
84
+ }
85
+ [data-mantine-color-scheme=dark] .subLink:hover {
86
+ background-color: var(--mantine-color-dark-7);
87
+ }
88
+ }
89
+ @media (hover: none) {
90
+ .subLink:active {
91
+ background-color: var(--mantine-color-gray-0);
92
+ }
93
+ [data-mantine-color-scheme=dark] .subLink:active {
94
+ background-color: var(--mantine-color-dark-7);
95
+ }
96
+ }
97
+ .dropdownFooter {
98
+ background-color: var(--mantine-color-gray-0);
99
+ }
100
+ [data-mantine-color-scheme=dark] .dropdownFooter {
101
+ background-color: var(--mantine-color-dark-7);
102
+ }
103
+ .dropdownFooter {
104
+ margin: calc(var(--mantine-spacing-md) * -1);
105
+ margin-top: var(--mantine-spacing-sm);
106
+ padding: var(--mantine-spacing-md) calc(var(--mantine-spacing-md) * 2);
107
+ padding-bottom: var(--mantine-spacing-xl);
108
+ border-top: 1px solid var(--mantine-color-gray-1);
109
+ }
110
+ [data-mantine-color-scheme=dark] .dropdownFooter {
111
+ border-top: 1px solid var(--mantine-color-dark-5);
112
+ }
@@ -0,0 +1,128 @@
1
+ import * as react from 'react';
2
+ import react__default, { ReactNode } from 'react';
3
+ import { MantineSize, ActionIconProps, ButtonProps, useModalsStack } from '@mantine/core';
4
+ import { useDisclosure } from '@mantine/hooks';
5
+ import { ConfigOptions } from 'export-to-csv';
6
+ import { MRT_RowData, MRT_TableOptions, MRT_ColumnDef, MRT_TableInstance } from 'mantine-react-table';
7
+ import { EditorOptions } from '@tiptap/react';
8
+
9
+ declare const MyBoxesCore: ({ className, ...rest }: {
10
+ className?: string;
11
+ }) => react__default.JSX.Element;
12
+ declare const Boxes: react__default.MemoExoticComponent<({ className, ...rest }: {
13
+ className?: string;
14
+ }) => react__default.JSX.Element>;
15
+
16
+ type T0MANTINE_SIZE = number | MantineSize | (string & {}) | undefined;
17
+ type T0CRUD = "default" | "create" | "update" | "delete" | "save" | "createMultiple" | "check" | "import" | "print" | "cancel" | "export" | "select";
18
+
19
+ interface IMyActionIcon extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "style">, ActionIconProps {
20
+ crudType?: T0CRUD;
21
+ children?: ReactNode;
22
+ }
23
+ declare function MyActionIcon({ children, crudType, ...rest }: IMyActionIcon): react.JSX.Element | undefined;
24
+
25
+ interface IMyActionIconModal extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "style">, ActionIconProps {
26
+ title?: string;
27
+ children?: ReactNode;
28
+ crudType?: T0CRUD;
29
+ modalSize?: T0MANTINE_SIZE;
30
+ disclosure: ReturnType<typeof useDisclosure>;
31
+ fullScreen?: boolean;
32
+ icon?: ReactNode;
33
+ }
34
+ declare function MyActionIconModal({ fullScreen, crudType, disclosure, modalSize, title, children, icon, ...rest }: IMyActionIconModal): react.JSX.Element | undefined;
35
+
36
+ declare function MySwitchTheme(): react.JSX.Element;
37
+
38
+ interface I0LinkItem {
39
+ pageId?: number;
40
+ name?: string;
41
+ label: string;
42
+ status?: "Default" | "Prototype" | "New" | "Menu" | "Change";
43
+ link?: string;
44
+ links?: I0LinkItem[];
45
+ }
46
+ declare function BasicAppShell_transformMenuToEnum(prefixProjectName: string, menu: I0LinkItem[]): Record<string, number>;
47
+ declare function BasicAppShell({ children, menu }: {
48
+ children: ReactNode;
49
+ menu: I0LinkItem[];
50
+ }): react.JSX.Element;
51
+ declare const groupToTwoLevels: (menu: I0LinkItem[]) => I0LinkItem[];
52
+ declare function utils_layout_getItemsWithoutLinks(menu: I0LinkItem[]): I0LinkItem[];
53
+
54
+ declare function MyAppSpotlight({ menu }: {
55
+ menu: I0LinkItem[];
56
+ }): react.JSX.Element;
57
+ declare function SpotlightTrigger(): react.JSX.Element;
58
+
59
+ interface IMyButton extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "style">, ButtonProps {
60
+ crudType?: T0CRUD;
61
+ children?: ReactNode;
62
+ }
63
+ declare function MyButton({ children, crudType, ...rest }: IMyButton): react.JSX.Element | undefined;
64
+
65
+ interface IMyButtonModal extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "style">, ButtonProps {
66
+ label?: string;
67
+ title?: string;
68
+ children?: ReactNode;
69
+ crudType?: T0CRUD;
70
+ modalSize?: T0MANTINE_SIZE;
71
+ objectName?: string;
72
+ disclosure: ReturnType<typeof useDisclosure>;
73
+ fullScreen?: boolean;
74
+ }
75
+ declare function MyButtonModal({ fullScreen, crudType, disclosure, modalSize, title, label, children, objectName, ...rest }: IMyButtonModal): react.JSX.Element | undefined;
76
+
77
+ interface SelectFileModalProps {
78
+ onExportStructure?: () => void;
79
+ stack: ReturnType<typeof useModalsStack<"select-file-page" | "select-field-page" | "implement-page">>;
80
+ }
81
+
82
+ interface IAQCardProps {
83
+ imgSrc?: string | null;
84
+ title?: string;
85
+ description?: string;
86
+ children?: ReactNode;
87
+ date?: string;
88
+ status?: string;
89
+ href?: string;
90
+ }
91
+
92
+ type FormatFunction<TData extends MRT_RowData> = (value: any) => any;
93
+ interface IDataTable<TData extends MRT_RowData> extends MRT_TableOptions<TData> {
94
+ columns: MRT_ColumnDef<TData>[];
95
+ data: TData[];
96
+ rowActionSize?: number;
97
+ exportAble?: boolean;
98
+ renderTopToolbarCustomActions?: ((props: {
99
+ table: MRT_TableInstance<TData>;
100
+ }) => ReactNode) | undefined;
101
+ csvConfigProps?: ConfigOptions;
102
+ formats?: {
103
+ [K in keyof TData]?: FormatFunction<TData>;
104
+ };
105
+ setSelectedRow?: (data: any) => void;
106
+ }
107
+ declare function MyDataTable<TData extends MRT_RowData>({ formats, exportAble, csvConfigProps, rowActionSize, columns, data, renderTopToolbarCustomActions, setSelectedRow, ...rest }: IDataTable<TData>): react.JSX.Element | undefined;
108
+
109
+ interface IMyTextEditor extends Partial<EditorOptions> {
110
+ label?: string;
111
+ error?: string;
112
+ value?: string;
113
+ onChange?: any;
114
+ contentHeight?: MantineSize | string;
115
+ autoHiddenToolBar?: boolean;
116
+ }
117
+
118
+ interface IMenu {
119
+ label?: string;
120
+ href?: string;
121
+ }
122
+ interface IHeaderMegaMenu {
123
+ children?: ReactNode;
124
+ menus?: IMenu[];
125
+ }
126
+ declare function HeaderMegaMenu({ children, menus }: IHeaderMegaMenu): react.JSX.Element;
127
+
128
+ export { BasicAppShell, BasicAppShell_transformMenuToEnum, Boxes, HeaderMegaMenu, type I0LinkItem, type IAQCardProps, type IMyTextEditor, MyActionIcon, MyActionIconModal, MyAppSpotlight, MyBoxesCore, MyButton, MyButtonModal, MyDataTable, MySwitchTheme, type SelectFileModalProps, SpotlightTrigger, groupToTwoLevels, utils_layout_getItemsWithoutLinks };