@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
package/README.md
CHANGED
|
@@ -1,453 +1,587 @@
|
|
|
1
|
-
# @materialui-reactjs/admin
|
|
2
|
-
|
|
3
|
-
A React component and utility library for building modern admin applications, including admin dashboards, CRUD interfaces, data tables, forms, charts, navigation, and reusable layouts.
|
|
4
|
-
|
|
5
|
-
The package provides multiple subpath exports so applications can import only the feature groups they need. It is designed to provide a consistent and reusable architecture for React-based admin systems.
|
|
6
|
-
|
|
7
|
-
## Features
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
## Package Structure
|
|
28
|
-
|
|
29
|
-
The package exposes different feature groups through subpath exports:
|
|
30
|
-
|
|
31
|
-
| Import Path | Description |
|
|
32
|
-
| -------------------------------------- | -------------------------------------------------------------------------- |
|
|
33
|
-
| `@materialui-reactjs/admin` | Main exports for commonly used components |
|
|
34
|
-
| `@materialui-reactjs/admin/form` | Form fields, form builders, and upload components |
|
|
35
|
-
| `@materialui-reactjs/admin/hook` | Hooks and helpers for list, detail, update, and import workflows |
|
|
36
|
-
| `@materialui-reactjs/admin/utils` | API, routing, environment, validation, and utility helpers |
|
|
37
|
-
| `@materialui-reactjs/admin/meta` | Tables, tabs, pagination, modals, headers, search, and other UI components |
|
|
38
|
-
| `@materialui-reactjs/admin/sidebar` | Sidebar navigation |
|
|
39
|
-
| `@materialui-reactjs/admin/single` | Single-resource CRUD components |
|
|
40
|
-
| `@materialui-reactjs/admin/top-navbar` | Top navigation |
|
|
41
|
-
| `@materialui-reactjs/admin/echarts` | ECharts components |
|
|
42
|
-
| `@materialui-reactjs/admin/loader` | Loading and spinner components |
|
|
43
|
-
|
|
44
|
-
## Main Components
|
|
45
|
-
|
|
46
|
-
### Form Components
|
|
47
|
-
|
|
48
|
-
The `form` package provides reusable components for building complex admin forms.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
These components support:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
### Meta UI Components
|
|
83
|
-
|
|
84
|
-
The `meta` package contains reusable UI components for admin pages.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
These components can be used to build:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
### Single-Page CRUD Components
|
|
119
|
-
|
|
120
|
-
The `single` package provides reusable components for building CRUD pages around a single resource.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
A typical resource can be structured as:
|
|
131
|
-
|
|
132
|
-
```text
|
|
133
|
-
Resource
|
|
134
|
-
├── List
|
|
135
|
-
├── Detail
|
|
136
|
-
├── Update
|
|
137
|
-
└── Import
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
This structure is useful for applications that use a consistent CRUD architecture across multiple resources.
|
|
141
|
-
|
|
142
|
-
### Layout Components
|
|
143
|
-
|
|
144
|
-
#### Sidebar
|
|
145
|
-
|
|
146
|
-
The sidebar package provides navigation components for admin dashboards.
|
|
147
|
-
|
|
148
|
-
```ts
|
|
149
|
-
import { Sidebar } from "@materialui-reactjs/admin/sidebar";
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
It also exports:
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
#### Top Navbar
|
|
158
|
-
|
|
159
|
-
The top navigation component provides the main navigation header for an admin application.
|
|
160
|
-
|
|
161
|
-
```ts
|
|
162
|
-
import { TopNavbar } from "@materialui-reactjs/admin/top-navbar";
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
### ECharts Components
|
|
166
|
-
|
|
167
|
-
The `echarts` package provides reusable chart components based on ECharts.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
Example:
|
|
176
|
-
|
|
177
|
-
```tsx
|
|
178
|
-
import { BarChart } from "@materialui-reactjs/admin/echarts";
|
|
179
|
-
|
|
180
|
-
export default function DashboardChart() {
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
### Loader
|
|
186
|
-
|
|
187
|
-
The `loader` package provides loading indicators.
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
Example:
|
|
192
|
-
|
|
193
|
-
```tsx
|
|
194
|
-
import { SpinnerLoader } from "@materialui-reactjs/admin/loader";
|
|
195
|
-
|
|
196
|
-
export default function Loading() {
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
## Hooks
|
|
202
|
-
|
|
203
|
-
The `hook` package provides reusable helpers for common admin data workflows.
|
|
204
|
-
|
|
205
|
-
Available helpers include:
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
These helpers can be used to standardize:
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
Example:
|
|
224
|
-
|
|
225
|
-
```ts
|
|
226
|
-
import {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
} from "@materialui-reactjs/admin/hook";
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
## Utilities
|
|
234
|
-
|
|
235
|
-
The `utils` package provides common utilities for admin applications.
|
|
236
|
-
|
|
237
|
-
Available utilities include:
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
} from "@materialui-reactjs/admin/
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
} from "@materialui-reactjs/admin/
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
|
417
|
-
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
1
|
+
# @materialui-reactjs/admin
|
|
2
|
+
|
|
3
|
+
A React component and utility library for building modern admin applications, including admin dashboards, CRUD interfaces, data tables, forms, charts, navigation, and reusable layouts.
|
|
4
|
+
|
|
5
|
+
The package provides multiple subpath exports so applications can import only the feature groups they need. It is designed to provide a consistent and reusable architecture for React-based admin systems.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Reusable admin dashboard components
|
|
10
|
+
- CRUD components for list, detail, update, and import workflows
|
|
11
|
+
- Form components for common and advanced input scenarios
|
|
12
|
+
- File and image upload components
|
|
13
|
+
- Data tables, pagination, search, tabs, and modal components
|
|
14
|
+
- Sidebar and top navigation components
|
|
15
|
+
- ECharts-based chart components
|
|
16
|
+
- Loading and spinner components
|
|
17
|
+
- API and data-handling helpers
|
|
18
|
+
- Environment configuration utilities
|
|
19
|
+
- Routing and validation helpers
|
|
20
|
+
- Drag-and-drop and sortable components
|
|
21
|
+
- CKEditor integration
|
|
22
|
+
- React Select integration
|
|
23
|
+
- MUI Date and Time Picker integration
|
|
24
|
+
- Redux Toolkit integration
|
|
25
|
+
- Bootstrap and MUI based UI components
|
|
26
|
+
|
|
27
|
+
## Package Structure
|
|
28
|
+
|
|
29
|
+
The package exposes different feature groups through subpath exports:
|
|
30
|
+
|
|
31
|
+
| Import Path | Description |
|
|
32
|
+
| -------------------------------------- | -------------------------------------------------------------------------- |
|
|
33
|
+
| `@materialui-reactjs/admin` | Main exports for commonly used components |
|
|
34
|
+
| `@materialui-reactjs/admin/form` | Form fields, form builders, and upload components |
|
|
35
|
+
| `@materialui-reactjs/admin/hook` | Hooks and helpers for list, detail, update, and import workflows |
|
|
36
|
+
| `@materialui-reactjs/admin/utils` | API, routing, environment, validation, and utility helpers |
|
|
37
|
+
| `@materialui-reactjs/admin/meta` | Tables, tabs, pagination, modals, headers, search, and other UI components |
|
|
38
|
+
| `@materialui-reactjs/admin/sidebar` | Sidebar navigation |
|
|
39
|
+
| `@materialui-reactjs/admin/single` | Single-resource CRUD components |
|
|
40
|
+
| `@materialui-reactjs/admin/top-navbar` | Top navigation |
|
|
41
|
+
| `@materialui-reactjs/admin/echarts` | ECharts components |
|
|
42
|
+
| `@materialui-reactjs/admin/loader` | Loading and spinner components |
|
|
43
|
+
|
|
44
|
+
## Main Components
|
|
45
|
+
|
|
46
|
+
### Form Components
|
|
47
|
+
|
|
48
|
+
The `form` package provides reusable components for building complex admin forms.
|
|
49
|
+
|
|
50
|
+
- `AdvancedMultiSelect`
|
|
51
|
+
- `AsxhUImages`
|
|
52
|
+
- `BoxAddRow`
|
|
53
|
+
- `CheckTreeBox`
|
|
54
|
+
- `CusForm`
|
|
55
|
+
- `DateInput`
|
|
56
|
+
- `DateTimeInput`
|
|
57
|
+
- `Editor`
|
|
58
|
+
- `EfFile`
|
|
59
|
+
- `EfImage`
|
|
60
|
+
- `EfImages`
|
|
61
|
+
- `PImage`
|
|
62
|
+
- `SelectAddRowBox`
|
|
63
|
+
- `SelectAddRowBoxAdvanced`
|
|
64
|
+
- `SelectBox`
|
|
65
|
+
- `UDragFile`
|
|
66
|
+
- `UFile`
|
|
67
|
+
- `UFiles`
|
|
68
|
+
- `UImages`
|
|
69
|
+
|
|
70
|
+
These components support:
|
|
71
|
+
|
|
72
|
+
- Standard form inputs
|
|
73
|
+
- Select and multi-select fields
|
|
74
|
+
- Tree-based selection
|
|
75
|
+
- Date and time inputs
|
|
76
|
+
- Rich text editing
|
|
77
|
+
- File uploads
|
|
78
|
+
- Image uploads
|
|
79
|
+
- Dynamic form rows
|
|
80
|
+
- Drag-and-drop file handling
|
|
81
|
+
|
|
82
|
+
### Meta UI Components
|
|
83
|
+
|
|
84
|
+
The `meta` package contains reusable UI components for admin pages.
|
|
85
|
+
|
|
86
|
+
- `BtnGroup`
|
|
87
|
+
- `CardTable`
|
|
88
|
+
- `CusTooltip`
|
|
89
|
+
- `ElfinderModal`
|
|
90
|
+
- `Error403`
|
|
91
|
+
- `Error404`
|
|
92
|
+
- `Head`
|
|
93
|
+
- `HeaderDetail`
|
|
94
|
+
- `HeaderIndex`
|
|
95
|
+
- `HeaderUpdate`
|
|
96
|
+
- `ModalForm`
|
|
97
|
+
- `Navtabs`
|
|
98
|
+
- `Pagination`
|
|
99
|
+
- `PDFEmbed`
|
|
100
|
+
- `ScrollTable`
|
|
101
|
+
- `SearchBox`
|
|
102
|
+
- `SortableItem`
|
|
103
|
+
|
|
104
|
+
These components can be used to build:
|
|
105
|
+
|
|
106
|
+
- Index pages
|
|
107
|
+
- Detail pages
|
|
108
|
+
- Update pages
|
|
109
|
+
- Data tables
|
|
110
|
+
- Search interfaces
|
|
111
|
+
- Pagination
|
|
112
|
+
- Navigation tabs
|
|
113
|
+
- Modal forms
|
|
114
|
+
- Page headers
|
|
115
|
+
- Error pages
|
|
116
|
+
- Scrollable tables
|
|
117
|
+
|
|
118
|
+
### Single-Page CRUD Components
|
|
119
|
+
|
|
120
|
+
The `single` package provides reusable components for building CRUD pages around a single resource.
|
|
121
|
+
|
|
122
|
+
- `List`
|
|
123
|
+
- `Detail`
|
|
124
|
+
- `Update`
|
|
125
|
+
- `UpdateDetail`
|
|
126
|
+
- `UpdateTableDetail`
|
|
127
|
+
- `Import`
|
|
128
|
+
- `Fields`
|
|
129
|
+
|
|
130
|
+
A typical resource can be structured as:
|
|
131
|
+
|
|
132
|
+
```text
|
|
133
|
+
Resource
|
|
134
|
+
├── List
|
|
135
|
+
├── Detail
|
|
136
|
+
├── Update
|
|
137
|
+
└── Import
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
This structure is useful for applications that use a consistent CRUD architecture across multiple resources.
|
|
141
|
+
|
|
142
|
+
### Layout Components
|
|
143
|
+
|
|
144
|
+
#### Sidebar
|
|
145
|
+
|
|
146
|
+
The sidebar package provides navigation components for admin dashboards.
|
|
147
|
+
|
|
148
|
+
```ts
|
|
149
|
+
import { Sidebar } from "@materialui-reactjs/admin/sidebar";
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
It also exports:
|
|
153
|
+
|
|
154
|
+
- `MenuItem`
|
|
155
|
+
- `SidebarProps`
|
|
156
|
+
|
|
157
|
+
#### Top Navbar
|
|
158
|
+
|
|
159
|
+
The top navigation component provides the main navigation header for an admin application.
|
|
160
|
+
|
|
161
|
+
```ts
|
|
162
|
+
import { TopNavbar } from "@materialui-reactjs/admin/top-navbar";
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### ECharts Components
|
|
166
|
+
|
|
167
|
+
The `echarts` package provides reusable chart components based on ECharts.
|
|
168
|
+
|
|
169
|
+
- `BarChart`
|
|
170
|
+
- `LineChart`
|
|
171
|
+
- `MultiBarChart`
|
|
172
|
+
- `MultiLineChart`
|
|
173
|
+
- `PieChart`
|
|
174
|
+
|
|
175
|
+
Example:
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
import { BarChart } from "@materialui-reactjs/admin/echarts";
|
|
179
|
+
|
|
180
|
+
export default function DashboardChart() {
|
|
181
|
+
return <BarChart />;
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Loader
|
|
186
|
+
|
|
187
|
+
The `loader` package provides loading indicators.
|
|
188
|
+
|
|
189
|
+
- `SpinnerLoader`
|
|
190
|
+
|
|
191
|
+
Example:
|
|
192
|
+
|
|
193
|
+
```tsx
|
|
194
|
+
import { SpinnerLoader } from "@materialui-reactjs/admin/loader";
|
|
195
|
+
|
|
196
|
+
export default function Loading() {
|
|
197
|
+
return <SpinnerLoader />;
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Hooks
|
|
202
|
+
|
|
203
|
+
The `hook` package provides reusable helpers for common admin data workflows.
|
|
204
|
+
|
|
205
|
+
Available helpers include:
|
|
206
|
+
|
|
207
|
+
- `fetchHookData`
|
|
208
|
+
- `handleHookClickPage`
|
|
209
|
+
- `handleHookSeachForm`
|
|
210
|
+
- `handleHookChange`
|
|
211
|
+
- `convertQueryToSort`
|
|
212
|
+
- `convertSortToQuery`
|
|
213
|
+
|
|
214
|
+
These helpers can be used to standardize:
|
|
215
|
+
|
|
216
|
+
- API data loading
|
|
217
|
+
- Pagination
|
|
218
|
+
- Search
|
|
219
|
+
- Sorting
|
|
220
|
+
- Form changes
|
|
221
|
+
- List/detail/update workflows
|
|
222
|
+
|
|
223
|
+
Example:
|
|
224
|
+
|
|
225
|
+
```ts
|
|
226
|
+
import {
|
|
227
|
+
fetchHookData,
|
|
228
|
+
handleHookClickPage,
|
|
229
|
+
handleHookChange,
|
|
230
|
+
} from "@materialui-reactjs/admin/hook";
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## Utilities
|
|
234
|
+
|
|
235
|
+
The `utils` package provides common utilities for admin applications.
|
|
236
|
+
|
|
237
|
+
Available utilities include:
|
|
238
|
+
|
|
239
|
+
- `callFetchApi`
|
|
240
|
+
- `callFetchApiToken`
|
|
241
|
+
- `createQueryString`
|
|
242
|
+
- `loadEnv`
|
|
243
|
+
- `getEnv`
|
|
244
|
+
- `reloadEnv`
|
|
245
|
+
- `escapeHtml`
|
|
246
|
+
- `CusRoute`
|
|
247
|
+
|
|
248
|
+
Example:
|
|
249
|
+
|
|
250
|
+
```ts
|
|
251
|
+
import {
|
|
252
|
+
callFetchApi,
|
|
253
|
+
callFetchApiToken,
|
|
254
|
+
createQueryString,
|
|
255
|
+
} from "@materialui-reactjs/admin/utils";
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## Installation
|
|
259
|
+
|
|
260
|
+
Install the package using npm:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
npm install @materialui-reactjs/admin
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Or using yarn:
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
yarn add @materialui-reactjs/admin
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Or using pnpm:
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
pnpm add @materialui-reactjs/admin
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### Runtime configuration (`/env.json`)
|
|
279
|
+
|
|
280
|
+
The package reads its runtime configuration from `/env.json` served at the app root.
|
|
281
|
+
Recognised keys: `API_URL`, `ADMIN_URI`, `UPLOADS_URL`, `STATIC_URL`, `SECRET_KEY`.
|
|
282
|
+
|
|
283
|
+
```json
|
|
284
|
+
{
|
|
285
|
+
"API_URL": "https://example.com/api",
|
|
286
|
+
"ADMIN_URI": "/admin",
|
|
287
|
+
"UPLOADS_URL": "https://example.com/uploads",
|
|
288
|
+
"STATIC_URL": "https://example.com/static",
|
|
289
|
+
"SECRET_KEY": "..."
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
Notes:
|
|
294
|
+
|
|
295
|
+
- The file is fetched once, in the background — it never blocks the module graph, and a
|
|
296
|
+
missing or invalid `env.json` is **not** fatal. Values simply resolve to `""`.
|
|
297
|
+
- Read values at any time with `getEnv()`, and force a retry with `reloadEnv()`.
|
|
298
|
+
- `SECRET_KEY` is sent as the `Secret-Key` request header. It is visible to the browser —
|
|
299
|
+
never put a real privileged credential here; treat it as a shared public identifier only.
|
|
300
|
+
|
|
301
|
+
### jQuery
|
|
302
|
+
|
|
303
|
+
Form validation (`Validator`) requires jQuery, declared as a peer dependency.
|
|
304
|
+
Load it **before** rendering any form component:
|
|
305
|
+
|
|
306
|
+
```ts
|
|
307
|
+
import "jquery";
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
If jQuery is missing, the error thrown points at this requirement instead of failing
|
|
311
|
+
silently during import.
|
|
312
|
+
|
|
313
|
+
## Basic Usage
|
|
314
|
+
|
|
315
|
+
Components can be imported directly from their corresponding subpath.
|
|
316
|
+
|
|
317
|
+
```tsx
|
|
318
|
+
import { Sidebar } from "@materialui-reactjs/admin/sidebar";
|
|
319
|
+
import { TopNavbar } from "@materialui-reactjs/admin/top-navbar";
|
|
320
|
+
import { CardTable } from "@materialui-reactjs/admin/meta";
|
|
321
|
+
import { CusForm } from "@materialui-reactjs/admin/form";
|
|
322
|
+
|
|
323
|
+
export default function AdminLayout() {
|
|
324
|
+
return (
|
|
325
|
+
<>
|
|
326
|
+
<TopNavbar />
|
|
327
|
+
<Sidebar />
|
|
328
|
+
<CardTable />
|
|
329
|
+
<CusForm />
|
|
330
|
+
</>
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
## Import by Feature Group
|
|
336
|
+
|
|
337
|
+
### Form
|
|
338
|
+
|
|
339
|
+
```tsx
|
|
340
|
+
import { CusForm, DateInput, DateTimeInput, SelectBox } from "@materialui-reactjs/admin/form";
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### Meta
|
|
344
|
+
|
|
345
|
+
```tsx
|
|
346
|
+
import { CardTable, Pagination, SearchBox, ModalForm } from "@materialui-reactjs/admin/meta";
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### Sidebar
|
|
350
|
+
|
|
351
|
+
```tsx
|
|
352
|
+
import { Sidebar } from "@materialui-reactjs/admin/sidebar";
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### Top Navbar
|
|
356
|
+
|
|
357
|
+
```tsx
|
|
358
|
+
import { TopNavbar } from "@materialui-reactjs/admin/top-navbar";
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
### ECharts
|
|
362
|
+
|
|
363
|
+
```tsx
|
|
364
|
+
import { BarChart, LineChart, PieChart } from "@materialui-reactjs/admin/echarts";
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### Loader
|
|
368
|
+
|
|
369
|
+
```tsx
|
|
370
|
+
import { SpinnerLoader } from "@materialui-reactjs/admin/loader";
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Utilities
|
|
374
|
+
|
|
375
|
+
```tsx
|
|
376
|
+
import {
|
|
377
|
+
callFetchApi,
|
|
378
|
+
callFetchApiToken,
|
|
379
|
+
loadEnv,
|
|
380
|
+
getEnv,
|
|
381
|
+
reloadEnv,
|
|
382
|
+
} from "@materialui-reactjs/admin/utils";
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
## Styles and CSS
|
|
386
|
+
|
|
387
|
+
> **Changed in 2.0.0.** The main entry no longer auto-imports the stylesheet. Import it
|
|
388
|
+
> explicitly, as shown below. See [CHANGELOG.md](./CHANGELOG.md) for the migration note.
|
|
389
|
+
|
|
390
|
+
The package provides CSS files for its components.
|
|
391
|
+
|
|
392
|
+
Import the main stylesheet:
|
|
393
|
+
|
|
394
|
+
```ts
|
|
395
|
+
import "@materialui-reactjs/admin/style.css";
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
If you use Font Awesome Pro (shipped with this package), import it too:
|
|
399
|
+
|
|
400
|
+
```ts
|
|
401
|
+
import "@materialui-reactjs/admin/fontawesome.css";
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
Why the explicit import: the main stylesheet is ~1.4 MB (material-dashboard, jQuery UI,
|
|
405
|
+
elFinder, icon fonts). Bundling it into the main entry forced every consumer to download
|
|
406
|
+
all of it even when using a single component.
|
|
407
|
+
|
|
408
|
+
Some component groups import their own small internal CSS automatically — that is fine.
|
|
409
|
+
|
|
410
|
+
Make sure your application's build configuration supports CSS imports from npm packages.
|
|
411
|
+
|
|
412
|
+
## Module formats
|
|
413
|
+
|
|
414
|
+
Both ESM and CommonJS builds are published.
|
|
415
|
+
|
|
416
|
+
| Format | Entry | Resolved by |
|
|
417
|
+
| ------ | --------------- | ----------------------------------------------------------- |
|
|
418
|
+
| ESM | `dist/**/*.js` | `import` (bundlers, Vite, webpack, Node ESM) |
|
|
419
|
+
| CJS | `dist/**/*.cjs` | `require` (Jest's default resolver, webpack 4, legacy Node) |
|
|
420
|
+
|
|
421
|
+
```ts
|
|
422
|
+
// ESM
|
|
423
|
+
import { CardTable } from "@materialui-reactjs/admin";
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
```js
|
|
427
|
+
// CommonJS
|
|
428
|
+
const { CardTable } = require("@materialui-reactjs/admin");
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
> **Note:** this is a browser library. Several components import `bootstrap` at module
|
|
432
|
+
> scope, which touches `document` on load. Under `require()` you therefore still need a
|
|
433
|
+
> DOM environment (e.g. Jest's `jsdom` test environment, or a bundler targeting browsers).
|
|
434
|
+
|
|
435
|
+
## Dependencies
|
|
436
|
+
|
|
437
|
+
This package is built with and integrates with the following libraries.
|
|
438
|
+
|
|
439
|
+
### UI and Styling
|
|
440
|
+
|
|
441
|
+
| Package | Purpose |
|
|
442
|
+
| --------------------- | --------------------------------------------- |
|
|
443
|
+
| `@mui/material` | Material UI components and UI system |
|
|
444
|
+
| `@mui/x-date-pickers` | Date and time picker components for MUI |
|
|
445
|
+
| `@emotion/react` | Emotion styling engine |
|
|
446
|
+
| `@emotion/styled` | Styled components powered by Emotion |
|
|
447
|
+
| `bootstrap` | CSS framework and responsive layout utilities |
|
|
448
|
+
|
|
449
|
+
### React and State Management
|
|
450
|
+
|
|
451
|
+
| Package | Purpose |
|
|
452
|
+
| -------------------- | ------------------------------- |
|
|
453
|
+
| `react` | Core React library |
|
|
454
|
+
| `react-dom` | React DOM rendering |
|
|
455
|
+
| `@reduxjs/toolkit` | Redux state management |
|
|
456
|
+
| `react-redux` | React bindings for Redux |
|
|
457
|
+
| `react-router-dom` | Client-side routing |
|
|
458
|
+
| `react-helmet-async` | Managing document head metadata |
|
|
459
|
+
|
|
460
|
+
### Form and Editor
|
|
461
|
+
|
|
462
|
+
| Package | Purpose |
|
|
463
|
+
| --------------------------- | ---------------------------------- |
|
|
464
|
+
| `@ckeditor/ckeditor5-react` | CKEditor React integration |
|
|
465
|
+
| `react-select` | Select and multi-select components |
|
|
466
|
+
| `date-fns` | Date manipulation and formatting |
|
|
467
|
+
| `decimal.js` | Precise decimal calculations |
|
|
468
|
+
|
|
469
|
+
### Drag and Drop / Sorting
|
|
470
|
+
|
|
471
|
+
| Package | Purpose |
|
|
472
|
+
| -------------------- | ------------------------------------ |
|
|
473
|
+
| `@dnd-kit/sortable` | Sortable drag-and-drop functionality |
|
|
474
|
+
| `@dnd-kit/utilities` | Utilities for dnd-kit |
|
|
475
|
+
| `@hello-pangea/dnd` | Drag-and-drop components for React |
|
|
476
|
+
| `react-sortablejs` | React integration for SortableJS |
|
|
477
|
+
| `sortablejs` | Drag-and-drop sorting engine |
|
|
478
|
+
|
|
479
|
+
### Charts
|
|
480
|
+
|
|
481
|
+
| Package | Purpose |
|
|
482
|
+
| ------------------- | -------------------------------------- |
|
|
483
|
+
| `echarts` | Charting and data visualization engine |
|
|
484
|
+
| `echarts-for-react` | React wrapper for ECharts |
|
|
485
|
+
|
|
486
|
+
### Utilities and Notifications
|
|
487
|
+
|
|
488
|
+
| Package | Purpose |
|
|
489
|
+
| --------------------------- | ---------------------------------------------------- |
|
|
490
|
+
| `jquery` | DOM manipulation and third-party library integration |
|
|
491
|
+
| `sweetalert2` | Alerts, confirmations, and notifications |
|
|
492
|
+
| `sweetalert2-react-content` | React integration for SweetAlert2 |
|
|
493
|
+
|
|
494
|
+
## Testing
|
|
495
|
+
|
|
496
|
+
Unit tests use [Vitest](https://vitest.dev) with [React Testing Library](https://testing-library.com/react/).
|
|
497
|
+
Test sources live in `test/` and are kept out of the published package (`files` only ships `dist`).
|
|
498
|
+
|
|
499
|
+
| Command | Purpose |
|
|
500
|
+
| ----------------------- | ----------------------------------------- |
|
|
501
|
+
| `npm test` | Run the suite once |
|
|
502
|
+
| `npm run test:watch` | Watch mode |
|
|
503
|
+
| `npm run test:coverage` | V8 coverage report |
|
|
504
|
+
| `npm run typecheck` | `tsc` for both `src` and `test` |
|
|
505
|
+
| `npm run lint` | ESLint (flat config) |
|
|
506
|
+
| `npm run format` | Prettier write |
|
|
507
|
+
| `npm run format:check` | Prettier check — **gated** in `verify`/CI |
|
|
508
|
+
| `npm run verify` | `format:check → lint → typecheck → test` |
|
|
509
|
+
|
|
510
|
+
`verify` and CI both run `format:check` first, so code that drifts from the
|
|
511
|
+
Prettier config fails fast instead of accumulating as unreviewed diff noise.
|
|
512
|
+
|
|
513
|
+
`ckeditor5` is declared as an **optional** peer dependency: it is only needed if you use
|
|
514
|
+
the `Editor` component. The editor build (`src/ckeditor/`) is plain TypeScript that
|
|
515
|
+
imports from `ckeditor5`, so CKEditor is **never** bundled into this package — the
|
|
516
|
+
consumer installs it and their bundler tree-shakes it, so an app only ever ships a
|
|
517
|
+
single copy of CKEditor.
|
|
518
|
+
|
|
519
|
+
```bash
|
|
520
|
+
npm test # run once
|
|
521
|
+
npm run test:watch # watch mode
|
|
522
|
+
npm run test:coverage # + coverage report (./coverage)
|
|
523
|
+
npm run typecheck # tsc for src and test
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
Coverage config lives in `vitest.config.ts` (kept separate from `vite.config.ts` so the
|
|
527
|
+
library build is never affected by test settings). The suite focuses on the behaviour
|
|
528
|
+
that is easy to regress silently:
|
|
529
|
+
|
|
530
|
+
| Area | What is locked down |
|
|
531
|
+
| ------------------------------- | ------------------------------------------------------------------------------------------------ |
|
|
532
|
+
| `checkUploadFile` | rejects (never hangs) on bad extension, oversize, empty list; honours a custom `RegExp` |
|
|
533
|
+
| `checkPermission` | fail-closed, recurses into `subs`, respects `status`, `groupId` guards |
|
|
534
|
+
| `escapeHtml` / `showMessage` | escapes all 5 HTML metacharacters, `type` allowlist, `{ raw: true }` opt-in |
|
|
535
|
+
| `getIdParams` | `edit`/`detail` routes, trailing segments, nested routes, custom pattern |
|
|
536
|
+
| `Env` | 404 and network errors resolve to `{}` instead of rejecting; single fetch; `reloadEnv()` |
|
|
537
|
+
| `Validator` | resolves jQuery lazily; clear error when jQuery is missing |
|
|
538
|
+
| Upload components | object URLs are cached, revoked on remove and on unmount, and never recreated on re-render |
|
|
539
|
+
| `CardTable` | raw API data is never injected as HTML (`selecthtml` without `func`) |
|
|
540
|
+
| `SpinnerLoader` | children still render when `loading` is `undefined` |
|
|
541
|
+
| `SingleIndex` | 403 on missing permission, page from the query string, pagination re-fetches, `DELETE` on delete |
|
|
542
|
+
| `SearchBox` | reads `filter[field]` dynamically so inputs reflect the active filter |
|
|
543
|
+
| `RatioKeyVal` | radio `id`s are unique and stable across re-renders (`useId`, not `Math.random`) |
|
|
544
|
+
| File hooks | an empty `FileList` yields `null`, not `undefined`, so the key survives JSON |
|
|
545
|
+
| `deepMerge` / `handleObjChange` | nested `{a}{b}` field names rebuild the object; `deepMerge` does not mutate its inputs |
|
|
546
|
+
| `Sidebar` | menus are filtered by `module`/`status`/`isPer`; active state tracks `currentPath` |
|
|
547
|
+
| ECharts wrappers | each `series` entry becomes its own series; `visible` triggers `resize()` |
|
|
548
|
+
|
|
549
|
+
Test helpers live in `test/helpers/`:
|
|
550
|
+
|
|
551
|
+
- `makeFile(name, { size })` — a `File` with a controllable size
|
|
552
|
+
- `makeFileList(files)` — a `FileList` (jsdom has no constructor for it)
|
|
553
|
+
- `withTimeout(promise)` — fails loudly if a promise never settles
|
|
554
|
+
|
|
555
|
+
## Requirements
|
|
556
|
+
|
|
557
|
+
The package is designed for modern React applications.
|
|
558
|
+
|
|
559
|
+
Current core versions include:
|
|
560
|
+
|
|
561
|
+
- React `19.3.x`
|
|
562
|
+
- React DOM `19.3.x`
|
|
563
|
+
- React Router `7.x`
|
|
564
|
+
- MUI `9.x`
|
|
565
|
+
- MUI X Date Pickers `9.x`
|
|
566
|
+
- Redux Toolkit `2.x`
|
|
567
|
+
- Bootstrap `5.x`
|
|
568
|
+
- ECharts `6.x`
|
|
569
|
+
|
|
570
|
+
For the exact versions used by a particular release, check the package's `package.json`.
|
|
571
|
+
|
|
572
|
+
Node `>=20.19.0` is required (Vite 8's floor for consumers). CI runs on Node 24 because
|
|
573
|
+
the dev-only `jsdom@30` needs a newer runtime.
|
|
574
|
+
|
|
575
|
+
## License
|
|
576
|
+
|
|
577
|
+
MIT — see [LICENSE](./LICENSE).
|
|
578
|
+
|
|
579
|
+
## Changelog
|
|
580
|
+
|
|
581
|
+
See [CHANGELOG.md](./CHANGELOG.md). The `2.4.0` release fixes three packaging bugs
|
|
582
|
+
found by installing the packed tarball into a clean project, and adds a consumer
|
|
583
|
+
smoke test to CI to prevent regressions of that kind. `2.3.0` adds tests for the
|
|
584
|
+
form components; `2.2.0` was a type-safety pass over the public API; `2.1.1` fixed
|
|
585
|
+
a 27.7 MB stylesheet caused by inlined webfonts; `2.1.0` was a test-coverage pass,
|
|
586
|
+
and `2.0.0` contained the breaking change where the main stylesheet is no longer
|
|
587
|
+
auto-imported.
|