gbs-add-block 0.0.63 → 0.0.64
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 +2 -2
- package/package.json +1 -1
- package/source/components/datagrid/context/GridContext.tsx +1 -1
- package/source/components/datagrid/index.tsx +1 -1
- package/source/components/datagrid/layout/GridBody.tsx +8 -1
- package/source/components/datagrid/layout/GridPagination.tsx +1 -1
- package/source/components/datagrid/layout/GridToolbar.tsx +28 -28
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# GBS Building Blocks 2.0 (v0.0.
|
|
1
|
+
# GBS Building Blocks 2.0 (v0.0.64)
|
|
2
2
|
|
|
3
3
|
Latest and upgraded version of GBS building blocks with headless UI and removed dependencies.
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ Latest and upgraded version of GBS building blocks with headless UI and removed
|
|
|
6
6
|
|
|
7
7
|
For detailed documentation on usage and props, Please visit: [Building Block Documentation v2.0](https://blackmax-designs.gitbook.io/building-block-v2.0)
|
|
8
8
|
|
|
9
|
-
## What's New 🎉 (Ver 0.0.
|
|
9
|
+
## What's New 🎉 (Ver 0.0.64)
|
|
10
10
|
|
|
11
11
|
- Updated for bug fixes.
|
|
12
12
|
- New component "Skeleton" & "Navbar" Added.
|
package/package.json
CHANGED
|
@@ -87,7 +87,7 @@ export const GridProvider: React.FC<{
|
|
|
87
87
|
onSelectRow,
|
|
88
88
|
isFetching,
|
|
89
89
|
tableHeaderStyle = "text-left px-2 py-4 bg-zinc-200 dark:bg-zinc-800",
|
|
90
|
-
gridContainerClass = "flex flex-col
|
|
90
|
+
gridContainerClass = "flex flex-col rounded-md overflow-hidden",
|
|
91
91
|
gridColumnStyleSelectAll = "px-4 text-xs",
|
|
92
92
|
gridColumnStyle = "p-2 text-xs",
|
|
93
93
|
rowChange = () => {},
|
|
@@ -148,7 +148,14 @@ const GridBody = () => {
|
|
|
148
148
|
</td>
|
|
149
149
|
)}
|
|
150
150
|
{workingColumns.map((column, colIndex) => (
|
|
151
|
-
<td
|
|
151
|
+
<td
|
|
152
|
+
key={colIndex}
|
|
153
|
+
className={gridColumnStyle}
|
|
154
|
+
style={{
|
|
155
|
+
width: column.width ? `${column.width}px` : "auto",
|
|
156
|
+
maxWidth: column.width ? `${column.width}px` : "auto",
|
|
157
|
+
}}
|
|
158
|
+
>
|
|
152
159
|
{renderCell(rowData, column, rowIndex)}
|
|
153
160
|
</td>
|
|
154
161
|
))}
|
|
@@ -23,7 +23,7 @@ const Pagination = () => {
|
|
|
23
23
|
} = useGridPagination();
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
|
-
<div className="flex flex-wrap justify-between items-center text-xs px-2 py-4 bg-
|
|
26
|
+
<div className="flex flex-wrap justify-between items-center text-xs px-2 py-4 bg-zinc-100 dark:bg-zinc-900 gap-2 md:gap-4">
|
|
27
27
|
<div className="flex flex-1 space-x-1">
|
|
28
28
|
<button onClick={goToFirstPage} disabled={currentPage === 0}>
|
|
29
29
|
<Icon
|
|
@@ -27,7 +27,34 @@ const GridToolbar = () => {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
|
-
<div className="flex bg-
|
|
30
|
+
<div className="flex bg-zinc-100 dark:bg-zinc-900 justify-end space-x-2 px-2 py-4">
|
|
31
|
+
{/* Search input */}
|
|
32
|
+
{enableSearch && (
|
|
33
|
+
<div className="flex">
|
|
34
|
+
<input
|
|
35
|
+
type="search"
|
|
36
|
+
value={searchParam}
|
|
37
|
+
onChange={handleSearchInput}
|
|
38
|
+
placeholder="Search..."
|
|
39
|
+
className="outline-none p-2 text-xs rounded-lg max-sm:hidden dark:bg-zinc-800 bg-zinc-200"
|
|
40
|
+
onKeyDown={(event: React.KeyboardEvent<HTMLInputElement>) => {
|
|
41
|
+
if (event.key === "Enter") {
|
|
42
|
+
handleSearch(searchParam);
|
|
43
|
+
}
|
|
44
|
+
}}
|
|
45
|
+
/>
|
|
46
|
+
<button
|
|
47
|
+
className="rounded-lg w-10 flex items-center justify-center cursor-pointer"
|
|
48
|
+
onClick={() => handleSearch(searchParam)}
|
|
49
|
+
>
|
|
50
|
+
<Icon
|
|
51
|
+
elements={search}
|
|
52
|
+
svgClass={"stroke-gray-500 fill-none dark:stroke-white"}
|
|
53
|
+
/>{" "}
|
|
54
|
+
</button>
|
|
55
|
+
</div>
|
|
56
|
+
)}
|
|
57
|
+
|
|
31
58
|
{/* Export buttons */}
|
|
32
59
|
{(enableExcelExport || enablePdfExport) && (
|
|
33
60
|
<div className="flex space-x-2">
|
|
@@ -59,33 +86,6 @@ const GridToolbar = () => {
|
|
|
59
86
|
)}
|
|
60
87
|
</div>
|
|
61
88
|
)}
|
|
62
|
-
|
|
63
|
-
{/* Search input */}
|
|
64
|
-
{enableSearch && (
|
|
65
|
-
<div className="flex">
|
|
66
|
-
<input
|
|
67
|
-
type="search"
|
|
68
|
-
value={searchParam}
|
|
69
|
-
onChange={handleSearchInput}
|
|
70
|
-
placeholder="Search..."
|
|
71
|
-
className="outline-none p-2 text-xs font-normal rounded-lg max-sm:hidden dark:bg-zinc-800 bg-zinc-100"
|
|
72
|
-
onKeyDown={(event: React.KeyboardEvent<HTMLInputElement>) => {
|
|
73
|
-
if (event.key === "Enter") {
|
|
74
|
-
handleSearch(searchParam);
|
|
75
|
-
}
|
|
76
|
-
}}
|
|
77
|
-
/>
|
|
78
|
-
<button
|
|
79
|
-
className="rounded-lg w-10 flex items-center justify-center "
|
|
80
|
-
onClick={() => handleSearch(searchParam)}
|
|
81
|
-
>
|
|
82
|
-
<Icon
|
|
83
|
-
elements={search}
|
|
84
|
-
svgClass={"stroke-gray-500 fill-none dark:stroke-white"}
|
|
85
|
-
/>{" "}
|
|
86
|
-
</button>
|
|
87
|
-
</div>
|
|
88
|
-
)}
|
|
89
89
|
</div>
|
|
90
90
|
);
|
|
91
91
|
};
|