react-live-data-table 1.0.4 → 1.0.6
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/package.json +1 -1
- package/readme.md +0 -22
- package/src/ReactDataTable.jsx +37 -11
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -42,25 +42,3 @@ A flexible React data grid component with support for pagination, row selection,
|
|
|
42
42
|
| `headerProps` | `object` | `{}` | Custom header properties |
|
|
43
43
|
|
|
44
44
|
## Basic Usage
|
|
45
|
-
jsx
|
|
46
|
-
import { ReactDataTable } from 'react-data-grid';
|
|
47
|
-
|
|
48
|
-
const App = () => {
|
|
49
|
-
const columns = [
|
|
50
|
-
{ field: 'id', headerName: 'ID' },
|
|
51
|
-
{ field: 'name', headerName: 'Name' }
|
|
52
|
-
];
|
|
53
|
-
|
|
54
|
-
const data = [
|
|
55
|
-
{ id: 1, name: 'John' },
|
|
56
|
-
{ id: 2, name: 'Jane' }
|
|
57
|
-
];
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<ReactDataTable
|
|
61
|
-
columns={columns}
|
|
62
|
-
dataSource={data}
|
|
63
|
-
/>
|
|
64
|
-
);
|
|
65
|
-
};
|
|
66
|
-
|
package/src/ReactDataTable.jsx
CHANGED
|
@@ -190,17 +190,43 @@ function ReactDataTable({
|
|
|
190
190
|
<div className="bg-white relative w-full">
|
|
191
191
|
{loading && (
|
|
192
192
|
<div className="absolute inset-0 bg-white/50 z-20 flex items-center justify-center">
|
|
193
|
-
<
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
193
|
+
<svg
|
|
194
|
+
style={{
|
|
195
|
+
animation: 'spin 1s linear infinite',
|
|
196
|
+
width: '24px',
|
|
197
|
+
height: '24px'
|
|
198
|
+
}}
|
|
199
|
+
viewBox="0 0 24 24"
|
|
200
|
+
fill="none"
|
|
201
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
202
|
+
>
|
|
203
|
+
<style>
|
|
204
|
+
{`
|
|
205
|
+
@keyframes spin {
|
|
206
|
+
from {
|
|
207
|
+
transform: rotate(0deg);
|
|
208
|
+
}
|
|
209
|
+
to {
|
|
210
|
+
transform: rotate(360deg);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
`}
|
|
214
|
+
</style>
|
|
215
|
+
<circle
|
|
216
|
+
style={{ opacity: 0.25 }}
|
|
217
|
+
cx="12"
|
|
218
|
+
cy="12"
|
|
219
|
+
r="10"
|
|
220
|
+
stroke="currentColor"
|
|
221
|
+
strokeWidth="4"
|
|
222
|
+
/>
|
|
223
|
+
<path
|
|
224
|
+
style={{ opacity: 0.75 }}
|
|
225
|
+
fill="currentColor"
|
|
226
|
+
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"
|
|
227
|
+
/>
|
|
228
|
+
</svg>
|
|
229
|
+
|
|
204
230
|
</div>
|
|
205
231
|
)}
|
|
206
232
|
|