vasuzex 2.3.13 → 2.3.14
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 +88 -0
- package/framework/Database/Model.js +18 -5
- package/framework/Services/Media/MediaManager.js +213 -118
- package/frontend/react-ui/components/DataTable/ActionDefaults.jsx +116 -2
- package/frontend/react-ui/components/DataTable/DataTable.jsx +113 -19
- package/frontend/react-ui/components/DataTable/Filters.jsx +99 -56
- package/frontend/react-ui/components/DataTable/TableBody.jsx +85 -24
- package/frontend/react-ui/components/DataTable/TableState.jsx +42 -13
- package/package.json +1 -1
|
@@ -1,23 +1,52 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Skeleton pulse block – light-grey bar that animates.
|
|
5
|
+
* Width can be "full", "3/4", "1/2", "1/3" or a fixed px value.
|
|
6
|
+
*/
|
|
7
|
+
const SkeletonCell = ({ width = "3/4", height = "h-4" }) => {
|
|
8
|
+
const widthClass =
|
|
9
|
+
width === "full" ? "w-full" :
|
|
10
|
+
width === "3/4" ? "w-3/4" :
|
|
11
|
+
width === "1/2" ? "w-1/2" :
|
|
12
|
+
width === "1/3" ? "w-1/3" :
|
|
13
|
+
width === "1/4" ? "w-1/4" : width;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<div
|
|
17
|
+
className={`${height} ${widthClass} rounded bg-gray-200 dark:bg-gray-700 animate-pulse`}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* A single skeleton row matching the number of visible columns + optional action column.
|
|
24
|
+
* Alternates bar widths so the shimmer does not look monotonous.
|
|
25
|
+
*/
|
|
26
|
+
const WIDTHS = ["3/4", "1/2", "full", "1/3", "3/4", "1/2"];
|
|
27
|
+
|
|
28
|
+
const SkeletonRow = ({ colSpan }) => (
|
|
29
|
+
<tr className="border-b border-gray-200 dark:border-gray-700">
|
|
30
|
+
{Array.from({ length: colSpan }).map((_, i) => (
|
|
31
|
+
<td key={i} className="px-6 py-4">
|
|
32
|
+
<SkeletonCell width={WIDTHS[i % WIDTHS.length]} />
|
|
33
|
+
</td>
|
|
34
|
+
))}
|
|
35
|
+
</tr>
|
|
36
|
+
);
|
|
37
|
+
|
|
3
38
|
/**
|
|
4
39
|
* TableState Component
|
|
5
|
-
* Handles loading and empty states for DataTable
|
|
40
|
+
* Handles loading (skeleton rows) and empty states for DataTable
|
|
6
41
|
*/
|
|
7
|
-
export const TableState = ({ loading, empty, colSpan, emptyText }) => {
|
|
42
|
+
export const TableState = ({ loading, empty, colSpan, emptyText, skeletonRows = 6 }) => {
|
|
8
43
|
if (loading) {
|
|
9
44
|
return (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
|
16
|
-
</svg>
|
|
17
|
-
<span>Loading data...</span>
|
|
18
|
-
</div>
|
|
19
|
-
</td>
|
|
20
|
-
</tr>
|
|
45
|
+
<>
|
|
46
|
+
{Array.from({ length: skeletonRows }).map((_, i) => (
|
|
47
|
+
<SkeletonRow key={i} colSpan={colSpan} />
|
|
48
|
+
))}
|
|
49
|
+
</>
|
|
21
50
|
);
|
|
22
51
|
}
|
|
23
52
|
if (empty) {
|