react-live-data-table 1.0.2 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-live-data-table",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Your React component package with Tailwind",
5
5
  "main": "src/index.js",
6
6
  "module": "dist/index.esm.js",
package/readme.md CHANGED
@@ -8,7 +8,7 @@ A highly customizable and efficient data grid table for React. It supports featu
8
8
 
9
9
  To install the package, run one of the following commands:
10
10
 
11
- ```bash
11
+ bash
12
12
  npm install react-data-grid-table
13
13
 
14
14
  # React Data Grid
@@ -41,23 +41,8 @@ A flexible React data grid component with support for pagination, row selection,
41
41
  | `rowHeights` | `number` | `40` | Height of each row |
42
42
  | `headerProps` | `object` | `{}` | Custom header properties |
43
43
 
44
-
45
-
46
-
47
- ### Column Definition
48
-
49
- ```typescript
50
- interface ColumnDefinition {
51
- field: string; // Key of the data field to display
52
- headerName: string; // Text to show in column header
53
- width?: number; // Column width in pixels
54
- sortable?: boolean; // Enable column sorting
55
- render?: (value: any, rowData: Object) => React.ReactNode; // Custom cell renderer
56
-
57
-
58
44
  ## Basic Usage
59
-
60
- ```jsx
45
+ jsx
61
46
  import { ReactDataTable } from 'react-data-grid';
62
47
 
63
48
  const App = () => {
@@ -77,4 +62,5 @@ const App = () => {
77
62
  dataSource={data}
78
63
  />
79
64
  );
80
- };
65
+ };
66
+
@@ -188,16 +188,21 @@ function ReactDataTable({
188
188
 
189
189
  return (
190
190
  <div className="bg-white relative w-full">
191
- {loading && <div className="absolute inset-0 bg-white/50 z-20 flex items-center justify-center">
192
- <div data-testid="loading-spinner" role="status" className={'p-2'}>
193
- <svg aria-hidden="true" className="inline w-8 h-8 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-green-500" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
194
- <path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor" />
195
- <path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill" />
196
- </svg>
197
- <span className="sr-only">Loading...</span>
191
+ {loading && (
192
+ <div className="absolute inset-0 bg-white/50 z-20 flex items-center justify-center">
193
+ <div data-testid="loading-spinner" role="status" className="p-2">
194
+ <svg className="h-10 w-10 animate-spin text-blue-500" viewBox="0 0 50 50" fill="none">
195
+ <circle className="opacity-25" cx="25" cy="25" r="20" stroke="currentColor" strokeWidth="4"></circle>
196
+ <path
197
+ className="opacity-75"
198
+ fill="currentColor"
199
+ d="M25 5a20 20 0 0119.39 15h-4.02a16 16 0 00-30.74 0H5.61A20 20 0 0125 5z"
200
+ ></path>
201
+ </svg>
202
+ <span className="sr-only">Loading...</span>
203
+ </div>
198
204
  </div>
199
- </div>
200
- }
205
+ )}
201
206
 
202
207
  {
203
208
  flatData.length === 0 && !loading ? (