@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
package/package.json
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@materialui-reactjs/admin",
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"description": "Reusable React admin components",
|
|
8
|
+
"type": "module",
|
|
9
|
+
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"module": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
"./hook": {
|
|
21
|
+
"types": "./dist/hook/index.d.ts",
|
|
22
|
+
"import": "./dist/hook/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./hook/detail": {
|
|
25
|
+
"types": "./dist/hook/detail.d.ts",
|
|
26
|
+
"import": "./dist/hook/detail.js"
|
|
27
|
+
},
|
|
28
|
+
"./hook/fields": {
|
|
29
|
+
"types": "./dist/hook/fields.d.ts",
|
|
30
|
+
"import": "./dist/hook/fields.js"
|
|
31
|
+
},
|
|
32
|
+
"./hook/import": {
|
|
33
|
+
"types": "./dist/hook/import.d.ts",
|
|
34
|
+
"import": "./dist/hook/import.js"
|
|
35
|
+
},
|
|
36
|
+
"./hook/update": {
|
|
37
|
+
"types": "./dist/hook/update.d.ts",
|
|
38
|
+
"import": "./dist/hook/update.js"
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
"./utils": {
|
|
42
|
+
"types": "./dist/utils/index.d.ts",
|
|
43
|
+
"import": "./dist/utils/index.js"
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
"./form": {
|
|
47
|
+
"types": "./dist/components/form/index.d.ts",
|
|
48
|
+
"import": "./dist/components/form/index.js"
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
"./echarts": {
|
|
52
|
+
"types": "./dist/components/echarts/index.d.ts",
|
|
53
|
+
"import": "./dist/components/echarts/index.js"
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
"./loader": {
|
|
57
|
+
"types": "./dist/components/loader/index.d.ts",
|
|
58
|
+
"import": "./dist/components/loader/index.js"
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
"./meta": {
|
|
62
|
+
"types": "./dist/components/meta/index.d.ts",
|
|
63
|
+
"import": "./dist/components/meta/index.js"
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
"./sidebar": {
|
|
67
|
+
"types": "./dist/components/sidebar/index.d.ts",
|
|
68
|
+
"import": "./dist/components/sidebar/index.js"
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
"./single": {
|
|
72
|
+
"types": "./dist/components/single/index.d.ts",
|
|
73
|
+
"import": "./dist/components/single/index.js"
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
"./top-navbar": {
|
|
77
|
+
"types": "./dist/components/top-navbar/index.d.ts",
|
|
78
|
+
"import": "./dist/components/top-navbar/index.js"
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
"./fontawesome.css": "./dist/fontawesome/css/all.min.css",
|
|
82
|
+
|
|
83
|
+
"./style.css": "./dist/assets/css/index.css"
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
"files": [
|
|
87
|
+
"dist",
|
|
88
|
+
"scripts/postinstall.cjs",
|
|
89
|
+
"README.md"
|
|
90
|
+
],
|
|
91
|
+
|
|
92
|
+
"sideEffects": [
|
|
93
|
+
"**/*.css"
|
|
94
|
+
],
|
|
95
|
+
|
|
96
|
+
"scripts": {
|
|
97
|
+
"dev": "vite",
|
|
98
|
+
"test": "tsc --noEmit",
|
|
99
|
+
"build": "tsc --noEmit && vite build",
|
|
100
|
+
"pack": "npm run build && npm pack",
|
|
101
|
+
"prepublishOnly": "npm run build",
|
|
102
|
+
"postinstall": "node scripts/postinstall.cjs"
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
"peerDependencies": {
|
|
106
|
+
"@ckeditor/ckeditor5-react": "^11.2.0",
|
|
107
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
108
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
109
|
+
"@emotion/react": "^11.14.0",
|
|
110
|
+
"@emotion/styled": "^11.14.1",
|
|
111
|
+
"@hello-pangea/dnd": "^18.0.1",
|
|
112
|
+
"@mui/material": "^9.2.0",
|
|
113
|
+
"@mui/x-date-pickers": "^9.10.0",
|
|
114
|
+
"@reduxjs/toolkit": "^2.12.0",
|
|
115
|
+
"bootstrap": "^5.3.8",
|
|
116
|
+
"date-fns": "^4.4.0",
|
|
117
|
+
"decimal.js": "^10.6.0",
|
|
118
|
+
"echarts": "^6.1.0",
|
|
119
|
+
"echarts-for-react": "^3.0.6",
|
|
120
|
+
"react": "^19.2.7",
|
|
121
|
+
"react-dom": "^19.2.7",
|
|
122
|
+
"react-helmet-async": "^3.0.0",
|
|
123
|
+
"react-redux": "^9.3.0",
|
|
124
|
+
"react-router-dom": "^7.18.1",
|
|
125
|
+
"react-select": "^5.10.2",
|
|
126
|
+
"react-sortablejs": "^6.1.4",
|
|
127
|
+
"sortablejs": "^1.15.7",
|
|
128
|
+
"sweetalert2": "^11.26.25",
|
|
129
|
+
"sweetalert2-react-content": "^5.1.2"
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
"devDependencies": {
|
|
133
|
+
"@ckeditor/ckeditor5-react": "^11.2.0",
|
|
134
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
135
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
136
|
+
"@emotion/react": "^11.14.0",
|
|
137
|
+
"@emotion/styled": "^11.14.1",
|
|
138
|
+
"@hello-pangea/dnd": "^18.0.1",
|
|
139
|
+
"@mui/material": "^9.2.0",
|
|
140
|
+
"@mui/x-date-pickers": "^9.10.0",
|
|
141
|
+
"@reduxjs/toolkit": "^2.12.0",
|
|
142
|
+
"@types/bootstrap": "^5.2.11",
|
|
143
|
+
"@types/jquery": "^4.0.1",
|
|
144
|
+
"@types/node": "^26.2.0",
|
|
145
|
+
"@vitejs/plugin-react": "^6.0.3",
|
|
146
|
+
"bootstrap": "^5.3.8",
|
|
147
|
+
"date-fns": "^4.4.0",
|
|
148
|
+
"decimal.js": "^10.6.0",
|
|
149
|
+
"echarts": "^6.1.0",
|
|
150
|
+
"echarts-for-react": "^3.0.6",
|
|
151
|
+
"react": "^19.2.7",
|
|
152
|
+
"react-dom": "^19.2.7",
|
|
153
|
+
"react-helmet-async": "^3.0.0",
|
|
154
|
+
"react-redux": "^9.3.0",
|
|
155
|
+
"react-router-dom": "^7.18.1",
|
|
156
|
+
"react-select": "^5.10.2",
|
|
157
|
+
"react-sortablejs": "^6.1.4",
|
|
158
|
+
"sortablejs": "^1.15.7",
|
|
159
|
+
"sweetalert2": "^11.26.25",
|
|
160
|
+
"sweetalert2-react-content": "^5.1.2",
|
|
161
|
+
"typescript": "^6.0.3",
|
|
162
|
+
"vite": "^8.1.5",
|
|
163
|
+
"vite-plugin-dts": "^5.0.3"
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
"engines": {
|
|
167
|
+
"node": ">=24"
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
"license": "MIT"
|
|
171
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
}
|