@materialui-reactjs/admin 1.0.6 → 2.0.1
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/CHANGELOG.md +322 -0
- package/LICENSE +21 -0
- package/README.md +587 -453
- package/dist/Common-DFahMuQE.cjs +11 -0
- package/dist/Common-_PK8HLKN.js +267 -0
- package/dist/Env-DoS-iQjs.cjs +1 -0
- package/dist/Env-SHztUA3s.js +16 -0
- package/dist/HeaderUpdate-Dirxjmxs.cjs +1 -0
- package/dist/{chunks/HeaderUpdate-DuS-gHNR.js → HeaderUpdate-drlnuHI8.js} +28 -25
- package/dist/SortableItem-C3KzO8Xh.cjs +1 -0
- package/dist/SpinnerLoader-BujLjvC3.cjs +1 -0
- package/dist/{chunks/SpinnerLoader-h8RDIarB.js → SpinnerLoader-CyhOQC6d.js} +2 -2
- package/dist/UDragFile-D8wOZ1Ut.js +96 -0
- package/dist/UDragFile-Db0sK4M7.cjs +1 -0
- package/dist/{chunks/Validator-CXYkI7vJ.js → Validator-D2zwZeov.js} +83 -52
- package/dist/Validator-DBxl8wtE.cjs +1 -0
- package/dist/assets/css/form.css +1 -1
- package/dist/assets/css/index.css +1 -1
- package/dist/ckeditor/ckeditor.d.ts +3 -0
- package/dist/ckeditor/plugins/elfinder.d.ts +11 -0
- package/dist/ckeditor/plugins/fullscreen.d.ts +15 -0
- package/dist/ckeditor/plugins/pdffinder.d.ts +18 -0
- package/dist/ckeditor/types.d.ts +37 -0
- package/dist/common-CEZp8xpQ.js +30 -0
- package/dist/common-ivDX6gGq.cjs +1 -0
- package/dist/components/echarts/index.cjs +1 -0
- package/dist/components/echarts/index.js +1 -1
- package/dist/components/form/AdvancedMultiSelect.d.ts +6 -3
- package/dist/components/form/AsxhUImages.d.ts +2 -1
- package/dist/components/form/BoxAddRow.d.ts +13 -2
- package/dist/components/form/CheckTreeBox.d.ts +12 -3
- package/dist/components/form/CusForm.d.ts +19 -6
- package/dist/components/form/DateInput.d.ts +2 -1
- package/dist/components/form/Editor.d.ts +2 -1
- package/dist/components/form/EfFile.d.ts +2 -1
- package/dist/components/form/EfImage.d.ts +2 -1
- package/dist/components/form/EfImages.d.ts +2 -1
- package/dist/components/form/PImage.d.ts +2 -1
- package/dist/components/form/SelectAddRowBox.d.ts +9 -5
- package/dist/components/form/SelectAddRowBoxAdvanced.d.ts +13 -4
- package/dist/components/form/SelectBox.d.ts +20 -7
- package/dist/components/form/UDragFile.d.ts +2 -1
- package/dist/components/form/UFile.d.ts +2 -1
- package/dist/components/form/UFiles.d.ts +9 -2
- package/dist/components/form/UImages.d.ts +2 -1
- package/dist/components/form/index.cjs +1 -0
- package/dist/components/form/index.js +2 -2
- package/dist/components/loader/SpinnerLoader.d.ts +5 -1
- package/dist/components/loader/index.cjs +1 -0
- package/dist/components/loader/index.js +1 -2
- package/dist/components/meta/CardTable.d.ts +11 -5
- package/dist/components/meta/CardTable.types.d.ts +57 -0
- package/dist/components/meta/CusTooltip.d.ts +8 -2
- package/dist/components/meta/Head.d.ts +10 -1
- package/dist/components/meta/HeaderDetail.d.ts +2 -1
- package/dist/components/meta/HeaderUpdate.d.ts +5 -1
- package/dist/components/meta/ModalForm.d.ts +41 -11
- package/dist/components/meta/Navtabs.d.ts +1 -1
- package/dist/components/meta/ScrollTable.d.ts +7 -3
- package/dist/components/meta/SearchBox.d.ts +8 -5
- package/dist/components/meta/SortableItem.d.ts +11 -1
- package/dist/components/meta/index.cjs +1 -0
- package/dist/components/meta/index.d.ts +1 -0
- package/dist/components/meta/index.js +3 -3
- package/dist/components/sidebar/Sidebar.types.d.ts +9 -7
- package/dist/components/sidebar/index.cjs +1 -0
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/single/Detail.d.ts +8 -3
- package/dist/components/single/Fields.d.ts +10 -4
- package/dist/components/single/Import.d.ts +8 -3
- package/dist/components/single/List.d.ts +33 -7
- package/dist/components/single/Update.d.ts +10 -4
- package/dist/components/single/UpdateDetail.d.ts +3 -2
- package/dist/components/single/UpdateTableDetail.d.ts +4 -3
- package/dist/components/single/index.cjs +1 -0
- package/dist/components/single/index.js +1 -1
- package/dist/components/top-navbar/index.cjs +1 -0
- package/dist/components/top-navbar/index.js +78 -2
- package/dist/echarts-Bi3uwLbg.cjs +1 -0
- package/dist/{chunks/echarts-CRmndsxC.js → echarts-CTzMqeR5.js} +4 -4
- package/dist/form-heyswTRq.js +3897 -0
- package/dist/form-sgtop6li.cjs +49 -0
- package/dist/hook/common.d.ts +87 -0
- package/dist/hook/detail.cjs +1 -0
- package/dist/hook/detail.d.ts +9 -15
- package/dist/hook/detail.js +1 -11
- package/dist/hook/fields.cjs +1 -0
- package/dist/hook/fields.d.ts +6 -14
- package/dist/hook/fields.js +1 -11
- package/dist/hook/import.d.ts +6 -11
- package/dist/hook/index.cjs +1 -0
- package/dist/hook/index.d.ts +29 -20
- package/dist/hook/index.js +14 -11
- package/dist/hook/update.cjs +1 -0
- package/dist/hook/update.d.ts +11 -19
- package/dist/hook/update.js +12 -9
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +14 -11
- package/dist/meta-BANk9kHW.cjs +1 -0
- package/dist/meta-CheDAmMh.js +745 -0
- package/dist/rolldown-runtime-BocRIvOZ.cjs +1 -0
- package/dist/sidebar-CfQAYWi-.cjs +1 -0
- package/dist/{chunks/sidebar-Dj4Xr9du.js → sidebar-CzRmfvhi.js} +10 -13
- package/dist/{chunks/single-CRF61o_U.js → single-BsJ7TYJi.js} +364 -282
- package/dist/single-C2WPEjhk.cjs +1 -0
- package/dist/style.cjs +0 -0
- package/dist/style.d.ts +0 -0
- package/dist/style.js +0 -0
- package/dist/types/Menu.d.ts +25 -0
- package/dist/utils/Common.d.ts +224 -43
- package/dist/utils/CusRoute.d.ts +21 -1
- package/dist/utils/Env.d.ts +23 -2
- package/dist/utils/Group.d.ts +12 -1
- package/dist/utils/Validator.d.ts +34 -12
- package/dist/utils/index.cjs +11 -0
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +212 -171
- package/package.json +190 -163
- package/dist/chunks/Common-BURf0rBN.js +0 -222
- package/dist/chunks/Env-DRXhvUcb.js +0 -16
- package/dist/chunks/UDragFile-BnUR3riq.js +0 -92
- package/dist/chunks/form-CPkpL5eA.js +0 -45889
- package/dist/chunks/loader-BUiOnhOH.js +0 -1
- package/dist/chunks/meta-4qPWijBT.js +0 -758
- package/dist/chunks/top-navbar-Bob0gMUh.js +0 -78
- package/scripts/postinstall.cjs +0 -80
- /package/dist/{chunks/SortableItem-B4-Zsso3.js → SortableItem-B4-Zsso3.js} +0 -0
- /package/dist/{components/meta/Pdfviewer.d.ts → hook/import.cjs} +0 -0
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { v as e, y as t } from "./Common-BURf0rBN.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
-
import { Link as i, useNavigate as a } from "react-router-dom";
|
|
5
|
-
//#region src/components/top-navbar/TopNavbar.tsx
|
|
6
|
-
var o = ({ userName: o, role: s }) => {
|
|
7
|
-
let c = a(), l = async () => {
|
|
8
|
-
c("/", { replace: !0 }), localStorage.removeItem("isLogin"), window.dispatchEvent(new Event("storage"));
|
|
9
|
-
};
|
|
10
|
-
return /* @__PURE__ */ n("nav", {
|
|
11
|
-
className: "navbar navbar-main navbar-expand-lg position-sticky z-index-sticky shadow-none bg-gradient-dark py-3 px-0",
|
|
12
|
-
"data-scroll": "true",
|
|
13
|
-
children: /* @__PURE__ */ n("div", {
|
|
14
|
-
className: "container-fluid",
|
|
15
|
-
children: /* @__PURE__ */ n("div", {
|
|
16
|
-
className: "collapse navbar-collapse mt-sm-0 mt-2 me-md-0 me-sm-4",
|
|
17
|
-
children: /* @__PURE__ */ n("ul", {
|
|
18
|
-
className: "navbar-nav justify-content-end ms-auto",
|
|
19
|
-
children: /* @__PURE__ */ r("li", {
|
|
20
|
-
className: "nav-item dropdown py-0",
|
|
21
|
-
children: [/* @__PURE__ */ r("button", {
|
|
22
|
-
className: "btn btn-sm btn-outline-light dropdown-toggle",
|
|
23
|
-
"data-bs-toggle": "dropdown",
|
|
24
|
-
"aria-expanded": "false",
|
|
25
|
-
children: [
|
|
26
|
-
/* @__PURE__ */ n("i", { className: "fa-regular fa-user-circle me-1" }),
|
|
27
|
-
o,
|
|
28
|
-
s && /* @__PURE__ */ n("span", {
|
|
29
|
-
className: "badge bg-warning text-white ms-2",
|
|
30
|
-
children: s
|
|
31
|
-
})
|
|
32
|
-
]
|
|
33
|
-
}), /* @__PURE__ */ r("ul", {
|
|
34
|
-
className: "dropdown-menu dropdown-menu-end dropdown-menu-animation dropdown-md p-2 border border-radius-xl mt-0 mt-lg-3",
|
|
35
|
-
role: "menu",
|
|
36
|
-
children: [
|
|
37
|
-
o && /* @__PURE__ */ n("li", {
|
|
38
|
-
className: "dropdown-item border-radius-md",
|
|
39
|
-
children: /* @__PURE__ */ n(i, {
|
|
40
|
-
className: "d-block w-100 nav-link py-1",
|
|
41
|
-
to: "/profile",
|
|
42
|
-
children: "Thông tin tài khoản"
|
|
43
|
-
})
|
|
44
|
-
}),
|
|
45
|
-
o && /* @__PURE__ */ n("li", {
|
|
46
|
-
className: "dropdown-item border-radius-md",
|
|
47
|
-
children: /* @__PURE__ */ n(i, {
|
|
48
|
-
className: "d-block w-100 nav-link py-1",
|
|
49
|
-
to: "/userlogs",
|
|
50
|
-
children: "Nhật ký hoạt động"
|
|
51
|
-
})
|
|
52
|
-
}),
|
|
53
|
-
/* @__PURE__ */ n("li", {
|
|
54
|
-
className: "dropdown-item border-radius-md",
|
|
55
|
-
children: /* @__PURE__ */ n(i, {
|
|
56
|
-
className: "d-block w-100 nav-link py-1",
|
|
57
|
-
to: "#",
|
|
58
|
-
onClick: async (n) => {
|
|
59
|
-
n.preventDefault();
|
|
60
|
-
try {
|
|
61
|
-
await l(), t("Đăng xuất thành công", "top-end", !0);
|
|
62
|
-
} catch (t) {
|
|
63
|
-
e(t.message);
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
children: "Đăng xuất"
|
|
67
|
-
})
|
|
68
|
-
})
|
|
69
|
-
]
|
|
70
|
-
})]
|
|
71
|
-
})
|
|
72
|
-
})
|
|
73
|
-
})
|
|
74
|
-
})
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
//#endregion
|
|
78
|
-
export { o as t };
|
package/scripts/postinstall.cjs
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const { spawn } = require('child_process');
|
|
4
|
-
|
|
5
|
-
try {
|
|
6
|
-
// 1. Xác định thư mục gốc dự án
|
|
7
|
-
const projectRoot = process.env.INIT_CWD || (() => {
|
|
8
|
-
let currentDir = __dirname;
|
|
9
|
-
while (currentDir !== path.parse(currentDir).root) {
|
|
10
|
-
if (path.basename(currentDir) === 'node_modules') {
|
|
11
|
-
return path.dirname(currentDir);
|
|
12
|
-
}
|
|
13
|
-
currentDir = path.dirname(currentDir);
|
|
14
|
-
}
|
|
15
|
-
return null;
|
|
16
|
-
})();
|
|
17
|
-
|
|
18
|
-
if (projectRoot) {
|
|
19
|
-
const projectPackageJsonPath = path.join(projectRoot, 'package.json');
|
|
20
|
-
|
|
21
|
-
// 🌟 THAY ĐỔI Ở ĐÂY: Nếu file package.json KHÔNG tồn tại, tự động tạo mới một file rỗng hợp lệ
|
|
22
|
-
if (!fs.existsSync(projectPackageJsonPath)) {
|
|
23
|
-
const defaultPkg = {
|
|
24
|
-
name: path.basename(projectRoot) || "my-admin-project",
|
|
25
|
-
version: "1.0.0",
|
|
26
|
-
private: true,
|
|
27
|
-
dependencies: {}
|
|
28
|
-
};
|
|
29
|
-
fs.writeFileSync(projectPackageJsonPath, JSON.stringify(defaultPkg, null, 2), 'utf-8');
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// 2. Đọc peerDependencies của thư viện
|
|
33
|
-
const myPackageJsonPath = path.resolve(__dirname, '../package.json');
|
|
34
|
-
const myPackageJson = JSON.parse(fs.readFileSync(myPackageJsonPath, 'utf-8'));
|
|
35
|
-
const peerDeps = myPackageJson.peerDependencies || {};
|
|
36
|
-
const peerDepsStr = JSON.stringify(peerDeps);
|
|
37
|
-
|
|
38
|
-
// 3. Tách một tiến trình độc lập chạy bằng Node.js ngầm
|
|
39
|
-
const child = spawn('node', ['-e', `
|
|
40
|
-
setTimeout(() => {
|
|
41
|
-
const fs = require('fs');
|
|
42
|
-
try {
|
|
43
|
-
const targetPath = '${projectPackageJsonPath.replace(/\\/g, '\\\\')}';
|
|
44
|
-
|
|
45
|
-
// Đọc file (lúc này chắc chắn đã tồn tại vì ta đã tạo ở tiến trình cha)
|
|
46
|
-
let projectPkg = {};
|
|
47
|
-
if (fs.existsSync(targetPath)) {
|
|
48
|
-
projectPkg = JSON.parse(fs.readFileSync(targetPath, 'utf-8'));
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (!projectPkg.dependencies) projectPkg.dependencies = {};
|
|
52
|
-
|
|
53
|
-
const peerDeps = ${peerDepsStr};
|
|
54
|
-
let hasChanged = false;
|
|
55
|
-
|
|
56
|
-
Object.keys(peerDeps).forEach((dep) => {
|
|
57
|
-
const inDeps = projectPkg.dependencies && projectPkg.dependencies[dep];
|
|
58
|
-
const inDevDeps = projectPkg.devDependencies && projectPkg.devDependencies[dep];
|
|
59
|
-
if (!inDeps && !inDevDeps) {
|
|
60
|
-
projectPkg.dependencies[dep] = peerDeps[dep];
|
|
61
|
-
hasChanged = true;
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
if (hasChanged) {
|
|
66
|
-
fs.writeFileSync(targetPath, JSON.stringify(projectPkg, null, 2), 'utf-8');
|
|
67
|
-
console.log('\\n\\x1b[32m%s\\x1b[0m', '✅ [MaterialUI Admin] Đã tự động tạo và chèn các dependencies thành công!');
|
|
68
|
-
}
|
|
69
|
-
} catch(e) {}
|
|
70
|
-
}, 1500);
|
|
71
|
-
`], {
|
|
72
|
-
detached: true,
|
|
73
|
-
stdio: 'ignore'
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
child.unref();
|
|
77
|
-
}
|
|
78
|
-
} catch (error) {
|
|
79
|
-
// Bỏ qua lỗi dev
|
|
80
|
-
}
|
|
File without changes
|
|
File without changes
|