@materialui-reactjs/admin 1.0.4
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.
- package/README.md +453 -0
- package/dist/assets/css/SpinnerLoader.css +1 -0
- package/dist/assets/css/form.css +1 -0
- package/dist/assets/css/index.css +1 -0
- package/dist/assets/css/meta.css +1 -0
- package/dist/chunks/Common-C_ZhT4L6.js +217 -0
- package/dist/chunks/Env-DRXhvUcb.js +16 -0
- package/dist/chunks/HeaderUpdate-lrSYWsKp.js +474 -0
- package/dist/chunks/SortableItem-B4-Zsso3.js +31 -0
- package/dist/chunks/SpinnerLoader-h8RDIarB.js +21 -0
- package/dist/chunks/UDragFile-CAiSfTsp.js +92 -0
- package/dist/chunks/Validator-DjZz2bJs.js +203 -0
- package/dist/chunks/echarts-CRmndsxC.js +322 -0
- package/dist/chunks/form-C8gzkYMW.js +45843 -0
- package/dist/chunks/loader-BUiOnhOH.js +1 -0
- package/dist/chunks/meta-k8MmuQjS.js +758 -0
- package/dist/chunks/sidebar-Dj4Xr9du.js +84 -0
- package/dist/chunks/single-DyPwG6ZR.js +1082 -0
- package/dist/chunks/top-navbar-FBw88y_o.js +78 -0
- package/dist/components/echarts/BarChart.d.ts +11 -0
- package/dist/components/echarts/LineChart.d.ts +10 -0
- package/dist/components/echarts/MultiBarChart.d.ts +14 -0
- package/dist/components/echarts/MultiLineChart.d.ts +14 -0
- package/dist/components/echarts/PieChart.d.ts +12 -0
- package/dist/components/echarts/index.d.ts +5 -0
- package/dist/components/echarts/index.js +2 -0
- package/dist/components/form/AdvancedMultiSelect.d.ts +16 -0
- package/dist/components/form/AsxhUImages.d.ts +15 -0
- package/dist/components/form/BoxAddRow.d.ts +26 -0
- package/dist/components/form/CheckTreeBox.d.ts +18 -0
- package/dist/components/form/CusForm.d.ts +105 -0
- package/dist/components/form/DateInput.d.ts +14 -0
- package/dist/components/form/DateTimeInput.d.ts +11 -0
- package/dist/components/form/Editor.d.ts +12 -0
- package/dist/components/form/EfFile.d.ts +15 -0
- package/dist/components/form/EfImage.d.ts +15 -0
- package/dist/components/form/EfImages.d.ts +14 -0
- package/dist/components/form/PImage.d.ts +15 -0
- package/dist/components/form/SelectAddRowBox.d.ts +17 -0
- package/dist/components/form/SelectAddRowBoxAdvanced.d.ts +16 -0
- package/dist/components/form/SelectBox.d.ts +32 -0
- package/dist/components/form/UDragFile.d.ts +13 -0
- package/dist/components/form/UFile.d.ts +15 -0
- package/dist/components/form/UFiles.d.ts +15 -0
- package/dist/components/form/UImages.d.ts +15 -0
- package/dist/components/form/index.d.ts +19 -0
- package/dist/components/form/index.js +3 -0
- package/dist/components/loader/SpinnerLoader.d.ts +8 -0
- package/dist/components/loader/index.d.ts +1 -0
- package/dist/components/loader/index.js +3 -0
- package/dist/components/meta/BtnGroup.d.ts +8 -0
- package/dist/components/meta/CardTable.d.ts +37 -0
- package/dist/components/meta/CusTooltip.d.ts +7 -0
- package/dist/components/meta/ElfinderModal.d.ts +10 -0
- package/dist/components/meta/Error403.d.ts +8 -0
- package/dist/components/meta/Error404.d.ts +8 -0
- package/dist/components/meta/Head.d.ts +1 -0
- package/dist/components/meta/HeaderDetail.d.ts +9 -0
- package/dist/components/meta/HeaderIndex.d.ts +17 -0
- package/dist/components/meta/HeaderUpdate.d.ts +9 -0
- package/dist/components/meta/ModalForm.d.ts +18 -0
- package/dist/components/meta/Navtabs.d.ts +12 -0
- package/dist/components/meta/PDFEmbed.d.ts +11 -0
- package/dist/components/meta/Pagination.d.ts +7 -0
- package/dist/components/meta/Pdfviewer.d.ts +0 -0
- package/dist/components/meta/ScrollTable.d.ts +16 -0
- package/dist/components/meta/SearchBox.d.ts +9 -0
- package/dist/components/meta/SortableItem.d.ts +1 -0
- package/dist/components/meta/index.d.ts +17 -0
- package/dist/components/meta/index.js +4 -0
- package/dist/components/sidebar/Sidebar.d.ts +3 -0
- package/dist/components/sidebar/Sidebar.types.d.ts +25 -0
- package/dist/components/sidebar/Sidebar.utils.d.ts +2 -0
- package/dist/components/sidebar/SidebarItem.d.ts +10 -0
- package/dist/components/sidebar/index.d.ts +2 -0
- package/dist/components/sidebar/index.js +2 -0
- package/dist/components/single/Detail.d.ts +25 -0
- package/dist/components/single/Fields.d.ts +31 -0
- package/dist/components/single/Import.d.ts +24 -0
- package/dist/components/single/List.d.ts +44 -0
- package/dist/components/single/Update.d.ts +33 -0
- package/dist/components/single/UpdateDetail.d.ts +7 -0
- package/dist/components/single/UpdateTableDetail.d.ts +18 -0
- package/dist/components/single/index.d.ts +7 -0
- package/dist/components/single/index.js +2 -0
- package/dist/components/top-navbar/TopNavbar.d.ts +6 -0
- package/dist/components/top-navbar/index.d.ts +1 -0
- package/dist/components/top-navbar/index.js +2 -0
- package/dist/fontawesome/css/all.css +8 -0
- package/dist/fontawesome/css/all.min.css +1 -0
- package/dist/fontawesome/webfonts/fa-brands-400.ttf +0 -0
- package/dist/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
- package/dist/fontawesome/webfonts/fa-duotone-900.ttf +0 -0
- package/dist/fontawesome/webfonts/fa-duotone-900.woff2 +0 -0
- package/dist/fontawesome/webfonts/fa-light-300.ttf +0 -0
- package/dist/fontawesome/webfonts/fa-light-300.woff2 +0 -0
- package/dist/fontawesome/webfonts/fa-regular-400.ttf +0 -0
- package/dist/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
- package/dist/fontawesome/webfonts/fa-sharp-light-300.ttf +0 -0
- package/dist/fontawesome/webfonts/fa-sharp-light-300.woff2 +0 -0
- package/dist/fontawesome/webfonts/fa-sharp-regular-400.ttf +0 -0
- package/dist/fontawesome/webfonts/fa-sharp-regular-400.woff2 +0 -0
- package/dist/fontawesome/webfonts/fa-sharp-solid-900.ttf +0 -0
- package/dist/fontawesome/webfonts/fa-sharp-solid-900.woff2 +0 -0
- package/dist/fontawesome/webfonts/fa-solid-900.ttf +0 -0
- package/dist/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
- package/dist/fontawesome/webfonts/fa-thin-100.ttf +0 -0
- package/dist/fontawesome/webfonts/fa-thin-100.woff2 +0 -0
- package/dist/fontawesome/webfonts/fa-v4compatibility.ttf +0 -0
- package/dist/fontawesome/webfonts/fa-v4compatibility.woff2 +0 -0
- package/dist/hook/detail.d.ts +14 -0
- package/dist/hook/detail.js +12 -0
- package/dist/hook/fields.d.ts +14 -0
- package/dist/hook/fields.js +12 -0
- package/dist/hook/import.d.ts +15 -0
- package/dist/hook/import.js +0 -0
- package/dist/hook/index.d.ts +61 -0
- package/dist/hook/index.js +41 -0
- package/dist/hook/update.d.ts +24 -0
- package/dist/hook/update.js +29 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +11 -0
- package/dist/utils/Common.d.ts +136 -0
- package/dist/utils/CusRoute.d.ts +7 -0
- package/dist/utils/Env.d.ts +2 -0
- package/dist/utils/Group.d.ts +1 -0
- package/dist/utils/Validator.d.ts +53 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.js +671 -0
- package/package.json +171 -0
- package/scripts/postinstall.cjs +80 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NavigateFunction } from 'react-router-dom';
|
|
2
|
+
export interface PropsType {
|
|
3
|
+
menuData: any[];
|
|
4
|
+
navigate: NavigateFunction;
|
|
5
|
+
user: any;
|
|
6
|
+
}
|
|
7
|
+
export interface StateType {
|
|
8
|
+
item: any;
|
|
9
|
+
data: any;
|
|
10
|
+
formValue: any;
|
|
11
|
+
isDetail: boolean | undefined;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
export declare const handleHookChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>, formValue: any) => any;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/hook/detail.ts
|
|
2
|
+
var e = (e, t) => {
|
|
3
|
+
e.preventDefault();
|
|
4
|
+
let { name: n, type: r, value: i } = e.target;
|
|
5
|
+
if (r === "file") {
|
|
6
|
+
let r = e.target.files;
|
|
7
|
+
t[n] = r ? r[0] : null;
|
|
8
|
+
} else t[n] = i;
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { e as handleHookChange };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NavigateFunction } from 'react-router-dom';
|
|
2
|
+
export interface PropsType {
|
|
3
|
+
menuData: any[];
|
|
4
|
+
navigate: NavigateFunction;
|
|
5
|
+
user: any;
|
|
6
|
+
}
|
|
7
|
+
export interface StateType {
|
|
8
|
+
item: any;
|
|
9
|
+
formValue: any;
|
|
10
|
+
isField: boolean;
|
|
11
|
+
isDetail: boolean;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
export declare const handleHookChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>, formValue: any) => any;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/hook/fields.ts
|
|
2
|
+
var e = (e, t) => {
|
|
3
|
+
e.preventDefault();
|
|
4
|
+
let { name: n, type: r, value: i } = e.target;
|
|
5
|
+
if (r === "file") {
|
|
6
|
+
let r = e.target.files;
|
|
7
|
+
t[n] = r ? r[0] : null;
|
|
8
|
+
} else t[n] = i;
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { e as handleHookChange };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NavigateFunction } from 'react-router-dom';
|
|
2
|
+
export interface PropsType {
|
|
3
|
+
menuData: any[];
|
|
4
|
+
navigate: NavigateFunction;
|
|
5
|
+
user: any;
|
|
6
|
+
}
|
|
7
|
+
export interface StateType {
|
|
8
|
+
formValue: any;
|
|
9
|
+
error: {
|
|
10
|
+
[key: string]: string;
|
|
11
|
+
} | string;
|
|
12
|
+
isCre: boolean;
|
|
13
|
+
isEdit: boolean;
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { NavigateFunction } from 'react-router-dom';
|
|
2
|
+
export interface UserType {
|
|
3
|
+
id: number;
|
|
4
|
+
username: string;
|
|
5
|
+
deptId: number;
|
|
6
|
+
groupId: number;
|
|
7
|
+
numberId: number;
|
|
8
|
+
group: string;
|
|
9
|
+
}
|
|
10
|
+
export interface PropsType {
|
|
11
|
+
menuData: any[];
|
|
12
|
+
navigate: NavigateFunction;
|
|
13
|
+
user: UserType;
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}
|
|
16
|
+
export interface StateTable {
|
|
17
|
+
items: any[];
|
|
18
|
+
sort?: Record<string, any>;
|
|
19
|
+
filter?: Record<string, any>;
|
|
20
|
+
page: number;
|
|
21
|
+
length: number;
|
|
22
|
+
pageTotal: number;
|
|
23
|
+
recordTotal: number;
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}
|
|
26
|
+
export interface StateType {
|
|
27
|
+
data: StateTable;
|
|
28
|
+
error?: any;
|
|
29
|
+
status?: any;
|
|
30
|
+
selectedIds: number[];
|
|
31
|
+
isDel: boolean | undefined;
|
|
32
|
+
isCre: boolean | undefined;
|
|
33
|
+
isDelOne: boolean | undefined;
|
|
34
|
+
isEdit: boolean | undefined;
|
|
35
|
+
isDetail: boolean | undefined;
|
|
36
|
+
isIndex: boolean | undefined;
|
|
37
|
+
isImport: boolean | undefined;
|
|
38
|
+
isExport: boolean | undefined;
|
|
39
|
+
isCopy: boolean | undefined;
|
|
40
|
+
ftfield?: any[];
|
|
41
|
+
tbfield?: any[];
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
}
|
|
44
|
+
export declare const convertQueryToSort: (sort: string) => {
|
|
45
|
+
[x: string]: string;
|
|
46
|
+
};
|
|
47
|
+
export declare const convertSortToQuery: (sort: Record<string, string>) => {
|
|
48
|
+
sort: string;
|
|
49
|
+
} | {
|
|
50
|
+
sort?: undefined;
|
|
51
|
+
};
|
|
52
|
+
export declare const fetchHookData: (params: Record<string, any>, getDataUrl: string) => Promise<StateTable>;
|
|
53
|
+
export declare const handleHookClickPage: (e: React.MouseEvent<HTMLAnchorElement>, params: Record<string, any>, cUri: string, navigate: NavigateFunction) => Promise<{
|
|
54
|
+
page: number;
|
|
55
|
+
}>;
|
|
56
|
+
export declare const handleHookSeachForm: (params: Record<string, any>, cUri: string, navigate: NavigateFunction) => Promise<{
|
|
57
|
+
page: number;
|
|
58
|
+
}>;
|
|
59
|
+
export declare const handleHookChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>, params: Record<string, any>) => Promise<{
|
|
60
|
+
[x: string]: any;
|
|
61
|
+
}>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { i as e, t } from "../chunks/Common-C_ZhT4L6.js";
|
|
2
|
+
//#region src/hook/index.ts
|
|
3
|
+
var n = (e) => {
|
|
4
|
+
if (!e) return {};
|
|
5
|
+
let [t, n] = e.split(":");
|
|
6
|
+
return !t || !n ? {} : { [t]: n };
|
|
7
|
+
}, r = (e) => {
|
|
8
|
+
let t = Object.entries(e).filter(([e, t]) => t !== "none").map(([e, t]) => `${e}:${t}`).join(",");
|
|
9
|
+
return t ? { sort: t } : {};
|
|
10
|
+
}, i = async (e, n) => {
|
|
11
|
+
try {
|
|
12
|
+
let r = `${n}?${new URLSearchParams(e).toString()}`;
|
|
13
|
+
return (await t(r, {}, "GET")).data;
|
|
14
|
+
} catch {
|
|
15
|
+
return {
|
|
16
|
+
items: [],
|
|
17
|
+
page: 1,
|
|
18
|
+
length: 10,
|
|
19
|
+
pageTotal: 0,
|
|
20
|
+
recordTotal: 0
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}, a = async (t, n, r, i) => {
|
|
24
|
+
let a = t.currentTarget, o = Number(a.getAttribute("data-page") ?? 1), s = {
|
|
25
|
+
...n,
|
|
26
|
+
page: o
|
|
27
|
+
};
|
|
28
|
+
return i(`${r}?${e(s)}`, { replace: !0 }), s;
|
|
29
|
+
}, o = async (t, n, r) => {
|
|
30
|
+
let i = {
|
|
31
|
+
...t,
|
|
32
|
+
page: 1
|
|
33
|
+
};
|
|
34
|
+
return r(`${n}?${e(i)}`, { replace: !0 }), i;
|
|
35
|
+
}, s = async (e, t) => {
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
let { name: n, value: r } = e.target, i = { ...t };
|
|
38
|
+
return n === "pageLen" ? (i.pageLen = Number(r), i.page = 1) : i[n] = r, i;
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
export { n as convertQueryToSort, r as convertSortToQuery, i as fetchHookData, s as handleHookChange, a as handleHookClickPage, o as handleHookSeachForm };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { NavigateFunction } from 'react-router-dom';
|
|
2
|
+
export interface PropsType {
|
|
3
|
+
menuData: any[];
|
|
4
|
+
navigate: NavigateFunction;
|
|
5
|
+
user: any;
|
|
6
|
+
}
|
|
7
|
+
export interface StateType {
|
|
8
|
+
item?: any;
|
|
9
|
+
formValue: any;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
error?: {
|
|
12
|
+
[key: string]: string;
|
|
13
|
+
} | string;
|
|
14
|
+
isCre?: boolean;
|
|
15
|
+
isEdit?: boolean;
|
|
16
|
+
isDetail?: boolean;
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}
|
|
19
|
+
export declare const handleHookChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>, formValue: Record<string, any>) => Promise<Record<string, any>>;
|
|
20
|
+
export declare const handleObjChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>, data: Record<string, any>) => {
|
|
21
|
+
name: string;
|
|
22
|
+
type: string;
|
|
23
|
+
value: any;
|
|
24
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/hook/update.ts
|
|
2
|
+
var e = async (e, n) => {
|
|
3
|
+
e.preventDefault();
|
|
4
|
+
let { name: r, type: i, value: a } = t(e, n);
|
|
5
|
+
if (i === "file") {
|
|
6
|
+
let t = e.target.files;
|
|
7
|
+
n[r] = t ? t[0] : null;
|
|
8
|
+
} else n[r] = a;
|
|
9
|
+
return n;
|
|
10
|
+
}, t = (e, t) => {
|
|
11
|
+
let { name: n, type: r, value: i } = e.target, a = n.split(/[\{\}]+/).filter(Boolean), o = a.shift();
|
|
12
|
+
if (!o || a.length === 0) return {
|
|
13
|
+
name: n,
|
|
14
|
+
type: r,
|
|
15
|
+
value: i
|
|
16
|
+
};
|
|
17
|
+
let s = JSON.parse(JSON.stringify(t?.[o] || {})), c = s;
|
|
18
|
+
for (let e = 0; e < a.length - 1; e++) {
|
|
19
|
+
let t = a[e];
|
|
20
|
+
c[t] = { ...c[t] || {} }, c = c[t];
|
|
21
|
+
}
|
|
22
|
+
return c[a[a.length - 1]] = i, {
|
|
23
|
+
name: o,
|
|
24
|
+
type: r,
|
|
25
|
+
value: s
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { e as handleHookChange, t as handleObjChange };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './components/form';
|
|
2
|
+
export * from './components/echarts';
|
|
3
|
+
export * from './components/loader';
|
|
4
|
+
export * from './components/meta';
|
|
5
|
+
export * from './components/sidebar';
|
|
6
|
+
export * from './components/single';
|
|
7
|
+
export * from './components/top-navbar';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { C as e, E as t, S as n, T as r, _ as i, a, b as o, c as s, d as c, f as l, g as u, h as d, i as f, l as p, m, n as h, o as g, p as _, r as v, s as y, t as b, u as x, v as S, w as C, x as w, y as T } from "./chunks/form-C8gzkYMW.js";
|
|
2
|
+
import { t as E } from "./chunks/SortableItem-B4-Zsso3.js";
|
|
3
|
+
import { t as D } from "./chunks/UDragFile-CAiSfTsp.js";
|
|
4
|
+
import { a as O, i as k, n as A, r as j, t as M } from "./chunks/echarts-CRmndsxC.js";
|
|
5
|
+
import { t as N } from "./chunks/SpinnerLoader-h8RDIarB.js";
|
|
6
|
+
import { a as P, c as F, i as I, l as L, n as R, o as z, r as B, s as V, t as H } from "./chunks/meta-k8MmuQjS.js";
|
|
7
|
+
import { a as U, d as W, i as G, n as K, r as q, t as J, u as Y } from "./chunks/HeaderUpdate-lrSYWsKp.js";
|
|
8
|
+
import { t as X } from "./chunks/sidebar-Dj4Xr9du.js";
|
|
9
|
+
import { a as Z, i as Q, n as $, o as ee, r as te, s as ne, t as re } from "./chunks/single-DyPwG6ZR.js";
|
|
10
|
+
import { t as ie } from "./chunks/top-navbar-FBw88y_o.js";
|
|
11
|
+
export { t as AdvancedMultiSelect, r as AsxhUImages, O as BarChart, l as BoxAddRow, L as BtnGroup, P as CardTable, i as CheckBox, c as CheckTreeBox, W as CusTooltip, x as DateInput, p as DateTimeInput, _ as Editor, s as EfFile, m as EfImage, y as EfImages, I as ElfinderModal, S as Email, U as Error403, G as Error404, B as Head, q as HeaderDetail, K as HeaderIndex, J as HeaderUpdate, k as LineChart, F as ModalForm, j as MultiBarChart, A as MultiLineChart, R as NavTabs, T as NumberText, H as PDFEmbed, g as PImage, Y as Pagination, o as Password, w as PhoneVn, M as PieChart, n as RatioKeyVal, V as ScrollTable, z as SearchBox, a as SelectAddRowBox, f as SelectAddRowBoxAdvanced, d as SelectBox, u as SelectMBox, X as Sidebar, ne as SingleDetail, ee as SingleFields, Z as SingleImport, Q as SingleIndex, te as SingleUpdate, $ as SingleUpdateDetail, re as SingleUpdateTableDetail, E as SortableItem, N as SpinnerLoader, e as Text, C as Textarea, ie as TopNavbar, D as UDragFile, v as UFile, h as UFiles, b as UImages };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { default as Decimal } from 'decimal.js';
|
|
2
|
+
export declare const loadScript: (src: string) => Promise<void>;
|
|
3
|
+
export declare const loadScripts: (scripts: string[]) => Promise<void>;
|
|
4
|
+
export declare const spinnerLoader: (box: string | Element, action?: boolean) => void;
|
|
5
|
+
export declare const buildFormData: (data: Record<string, any>) => FormData;
|
|
6
|
+
export declare const callFetchApi: (url: string, data?: any, type?: string, ctype?: string) => Promise<any>;
|
|
7
|
+
export declare const callFetchApiToken: (url: string, data?: any, type?: string, ctype?: string, isTry?: boolean) => Promise<any>;
|
|
8
|
+
export declare const showSweetAlert: (text?: string, confirmText?: string) => Promise<import('sweetalert2').SweetAlertResult<any>>;
|
|
9
|
+
export declare const showSweetAlertOk: (title: string, pos?: any, toast?: boolean) => void;
|
|
10
|
+
export declare const showSweetAlertWarning: (title: string) => void;
|
|
11
|
+
export declare const showSweetAlertError: (title: string) => void;
|
|
12
|
+
export declare const getName: (id: number, items: any[], keyName?: string) => any;
|
|
13
|
+
export declare const getNames: (ids: number[], items: any, keyName?: string) => string;
|
|
14
|
+
export declare const getLinkFiles: (files: string[]) => string;
|
|
15
|
+
export declare const getActiveStatus: (id: string | boolean | number, color?: boolean) => any;
|
|
16
|
+
export declare const getPublishStatus: (id: string | boolean | number, color?: boolean) => any;
|
|
17
|
+
export declare const getTrueFlaseStatus: (id: string | boolean | number, color?: boolean) => any;
|
|
18
|
+
export declare function parseDate(date: string | Date): Date;
|
|
19
|
+
export declare function strToDate(input?: string | Date): Date;
|
|
20
|
+
export declare const formatDateTime: (date: any) => string;
|
|
21
|
+
export declare const formatDate: (date: any) => string;
|
|
22
|
+
export declare const formatYear: (date: any) => string;
|
|
23
|
+
export declare const formatDateSql: (date: any) => string;
|
|
24
|
+
export declare const getParams: (name?: string | null) => string | Record<string, string | null> | null;
|
|
25
|
+
export declare const setParams: (newParams: Record<string, string | null>) => string;
|
|
26
|
+
export declare const createQueryString: (params: Record<string, any>) => string;
|
|
27
|
+
export declare const getIdParams: () => number | null;
|
|
28
|
+
export declare const getImage: (image: string, df?: string) => string;
|
|
29
|
+
export declare const getFile: (file: string) => string;
|
|
30
|
+
export declare const getPubImage: (image: string, df?: string) => string;
|
|
31
|
+
export declare const getUploadImage: (image: string, df?: string) => string;
|
|
32
|
+
export declare const getUploadFile: (file: string, df?: string) => string;
|
|
33
|
+
export declare function randomString(length: number): string;
|
|
34
|
+
export declare function htmlToText(html: string): string;
|
|
35
|
+
export declare const checkUploadFile: (files: any, size?: number, type?: any) => Promise<unknown>;
|
|
36
|
+
export declare const showMessage: (errors?: {
|
|
37
|
+
[key: string]: string;
|
|
38
|
+
} | string, type?: string) => string;
|
|
39
|
+
export declare const resetForm: (form: HTMLFormElement) => HTMLFormElement;
|
|
40
|
+
export declare const mapDataForm: (form: HTMLFormElement, data: Record<string, any>, hidden?: boolean) => Promise<Record<string, any>>;
|
|
41
|
+
export declare const elFinderPopup: (el: string, options?: Record<string, any>) => Promise<unknown>;
|
|
42
|
+
export declare const createModal: (modalCls: string | HTMLElement) => Promise<unknown>;
|
|
43
|
+
export declare const showFinderModal: (btnEl: HTMLDivElement, modalCls: string, fnShow?: ((item: {
|
|
44
|
+
data: any;
|
|
45
|
+
modalEl?: HTMLElement;
|
|
46
|
+
btnEl?: any;
|
|
47
|
+
md?: any;
|
|
48
|
+
}) => void) | false, fnHide?: (() => void) | false) => void;
|
|
49
|
+
export declare const showFinderFileModal: (btnEl: HTMLDivElement, modalCls: string, fnShow?: ((item: {
|
|
50
|
+
data: any;
|
|
51
|
+
modalEl?: HTMLElement;
|
|
52
|
+
btnEl?: any;
|
|
53
|
+
md?: any;
|
|
54
|
+
}) => void) | false, fnHide?: (() => void) | false) => void;
|
|
55
|
+
export declare const filterIds: (input: any[] | string) => number[];
|
|
56
|
+
export declare function stringToJson(input: any, df?: {}, type?: string): any;
|
|
57
|
+
export declare const formatNumber: (number: number, options?: {}, type?: string) => string | 0;
|
|
58
|
+
export declare const decimalNumber: (value: string | number) => Decimal;
|
|
59
|
+
/**
|
|
60
|
+
* Lấy ra một mảng giá trị của cùng một field từ mảng object
|
|
61
|
+
*
|
|
62
|
+
* @param data Mảng dữ liệu (array of objects)
|
|
63
|
+
* @param field Tên field cần lấy giá trị
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* const data = [
|
|
67
|
+
* { id: 1, name: 'An', age: 20 },
|
|
68
|
+
* { id: 2, name: 'Bình', age: 22 },
|
|
69
|
+
* { id: 3, name: 'Chi', age: 21 }
|
|
70
|
+
* ];
|
|
71
|
+
*
|
|
72
|
+
* const names = mapArrFields(data, 'name');
|
|
73
|
+
* // Kết quả: ['An', 'Bình', 'Chi']
|
|
74
|
+
*
|
|
75
|
+
* const ids = mapArrFields(data, 'id');
|
|
76
|
+
* // Kết quả: [1, 2, 3]
|
|
77
|
+
*/
|
|
78
|
+
export declare const mapArrFields: (data: any[], field: any) => any[];
|
|
79
|
+
/**
|
|
80
|
+
* Gộp (merge) các object trong mảng thành một object duy nhất
|
|
81
|
+
* Các key trùng nhau sẽ bị ghi đè bởi object xuất hiện sau
|
|
82
|
+
*
|
|
83
|
+
* @param data Mảng các object cần merge
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* const data = [
|
|
87
|
+
* { a: 1, b: 2 },
|
|
88
|
+
* { b: 3, c: 4 },
|
|
89
|
+
* { d: 5 }
|
|
90
|
+
* ];
|
|
91
|
+
*
|
|
92
|
+
* const result = mergeArrObject(data);
|
|
93
|
+
* // Kết quả: { a: 1, b: 3, c: 4, d: 5 }
|
|
94
|
+
*/
|
|
95
|
+
export declare const mergeArrObject: (array1: any[], array2: any[], field1: string, field2: string, field2S: string) => {
|
|
96
|
+
id: number;
|
|
97
|
+
name: string;
|
|
98
|
+
}[];
|
|
99
|
+
/**
|
|
100
|
+
* Map lại dữ liệu của mảng object theo rule chỉ định
|
|
101
|
+
*
|
|
102
|
+
* @param arr Mảng dữ liệu đầu vào (array of objects)
|
|
103
|
+
* @param rule Quy tắc map:
|
|
104
|
+
* - key: tên field mới
|
|
105
|
+
* - value:
|
|
106
|
+
* + string → lấy giá trị từ field tương ứng của item
|
|
107
|
+
* + function → custom logic, nhận item làm tham số
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* const data = [
|
|
111
|
+
* { id: 1, name: 'An', age: 20 },
|
|
112
|
+
* { id: 2, name: 'Bình', age: 22 }
|
|
113
|
+
* ];
|
|
114
|
+
*
|
|
115
|
+
* const rule = {
|
|
116
|
+
* userId: 'id',
|
|
117
|
+
* fullName: 'name',
|
|
118
|
+
* isAdult: (item) => item.age >= 18
|
|
119
|
+
* };
|
|
120
|
+
*
|
|
121
|
+
* const result = mapArrData(data, rule);
|
|
122
|
+
*
|
|
123
|
+
* // Kết quả:
|
|
124
|
+
* // [
|
|
125
|
+
* // { userId: 1, fullName: 'An', isAdult: true },
|
|
126
|
+
* // { userId: 2, fullName: 'Bình', isAdult: true }
|
|
127
|
+
* // ]
|
|
128
|
+
*/
|
|
129
|
+
export declare const mapArrData: (arr: any[], rule: any) => any[];
|
|
130
|
+
export declare const isStsNum: (status: number, type: string, tryThrow?: boolean) => boolean;
|
|
131
|
+
export declare function sumArrCol<T extends Record<string, number>>(items: T[], col: keyof T): number;
|
|
132
|
+
export declare const getFilterType: (type: number) => string;
|
|
133
|
+
export declare const getLangs: (key?: any) => string | {
|
|
134
|
+
id: number;
|
|
135
|
+
name: string;
|
|
136
|
+
}[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RouteObject } from 'react-router-dom';
|
|
2
|
+
export declare class CusRoute {
|
|
3
|
+
private routes;
|
|
4
|
+
addGS(link: string, layout: any, Index: any, Update?: any, Detail?: any, Import?: any, Fields?: any): Promise<void>;
|
|
5
|
+
addRoute(routeList?: RouteObject[]): void;
|
|
6
|
+
getRouter(): RouteObject[];
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const checkPermission: (menuData: any[], moduleText: string, controller: string, action: string, code: number, groupId: number) => any;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export declare class Validator {
|
|
2
|
+
options: any;
|
|
3
|
+
validators: any;
|
|
4
|
+
$element: any;
|
|
5
|
+
$btn: any;
|
|
6
|
+
$inputs: any;
|
|
7
|
+
static VERSION: string;
|
|
8
|
+
static INPUT_SELECTOR: string;
|
|
9
|
+
static FOCUS_OFFSET: number;
|
|
10
|
+
static DEFAULTS: {
|
|
11
|
+
delay: number;
|
|
12
|
+
html: boolean;
|
|
13
|
+
disable: boolean;
|
|
14
|
+
focus: boolean;
|
|
15
|
+
custom: {};
|
|
16
|
+
errors: {
|
|
17
|
+
match: string;
|
|
18
|
+
minlength: string;
|
|
19
|
+
maxlength: string;
|
|
20
|
+
};
|
|
21
|
+
feedback: {
|
|
22
|
+
success: string;
|
|
23
|
+
error: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
static VALIDATORS: {
|
|
27
|
+
native: ($el: any) => any;
|
|
28
|
+
match: ($el: JQuery) => string | false | undefined;
|
|
29
|
+
minlength: ($el: JQuery) => string | false;
|
|
30
|
+
maxlength: ($el: JQuery) => string | false;
|
|
31
|
+
filesize: ($el: JQuery<HTMLInputElement>) => boolean;
|
|
32
|
+
accept: ($el: JQuery<HTMLInputElement>) => boolean;
|
|
33
|
+
pattern: ($el: JQuery) => boolean;
|
|
34
|
+
};
|
|
35
|
+
constructor(element: any, options?: any);
|
|
36
|
+
static getValue($el: JQuery): boolean | number | string | string[];
|
|
37
|
+
update: () => this;
|
|
38
|
+
onInput: (e: any) => void;
|
|
39
|
+
validateInput: ($el: JQuery, deferErrors: any) => JQuery.Promise<any, any, any> | undefined;
|
|
40
|
+
runValidators: ($el: JQuery) => JQuery.Promise<any, any, any>;
|
|
41
|
+
validate: () => this;
|
|
42
|
+
focusError: () => void;
|
|
43
|
+
showErrors: ($el: JQuery) => void;
|
|
44
|
+
clearErrors: ($el: JQuery) => void;
|
|
45
|
+
hasErrors: () => boolean;
|
|
46
|
+
isIncomplete: () => boolean;
|
|
47
|
+
onSubmit: (e: any) => void;
|
|
48
|
+
toggleSubmit: () => void;
|
|
49
|
+
defer: ($el: JQuery, callback: any) => any;
|
|
50
|
+
reset: () => this;
|
|
51
|
+
destroy: () => this;
|
|
52
|
+
run: () => void;
|
|
53
|
+
}
|