react-live-data-table 1.0.6 → 1.0.8

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.6",
3
+ "version": "1.0.8",
4
4
  "description": "Your React component package with Tailwind",
5
5
  "main": "src/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -167,21 +167,26 @@ function ReactDataTable({
167
167
  header: ({ data }) => (
168
168
  <div className="flex items-center justify-center h-[40px]">
169
169
  <input
170
+ id={data.id}
170
171
  type="checkbox"
171
172
  checked={Object.keys(selectedRows).length > 0 && data.every(row => selectedRows[row.id])}
172
173
  onChange={(e) => handleSelectAll(e.target.checked, flatData)}
173
174
  />
174
175
  </div>
175
176
  ),
176
- cell: ({ row }) => (
177
- <div className="flex items-center justify-center h-[40px]">
178
- <input
179
- type="checkbox"
180
- checked={!!selectedRows[row.id]}
181
- onChange={(e) => handleSelectRow(e.target.checked, row, flatData)}
182
- />
183
- </div>
184
- ),
177
+ cell: ({ row }) => {
178
+ return (
179
+ <div className="flex items-center justify-center h-[40px]" onClick={(e) => e.stopPropagation()}>
180
+ <input
181
+ type="checkbox"
182
+ className='bg-gray-700 rounded-4 border-gray-200 text-blue-400 focus:ring-0 focus:ring-white'
183
+ checked={!!selectedRows[row.id]}
184
+ onClick={(e) => e.stopPropagation()}
185
+ onChange={(e) => { e.stopPropagation(); handleSelectRow(e.target.checked, row, flatData) }}
186
+ />
187
+ </div>
188
+ )
189
+ }
185
190
  };
186
191
 
187
192
  const enhancedColumns = showCheckbox ? [checkboxColumn, ...columns] : columns;
@@ -201,16 +206,7 @@ function ReactDataTable({
201
206
  xmlns="http://www.w3.org/2000/svg"
202
207
  >
203
208
  <style>
204
- {`
205
- @keyframes spin {
206
- from {
207
- transform: rotate(0deg);
208
- }
209
- to {
210
- transform: rotate(360deg);
211
- }
212
- }
213
- `}
209
+ {`@keyframes spin {from {transform: rotate(0deg)} to {transform: rotate(360deg)}}`}
214
210
  </style>
215
211
  <circle
216
212
  style={{ opacity: 0.25 }}
@@ -276,6 +272,7 @@ function ReactDataTable({
276
272
  >
277
273
  {enhancedColumns.map(column => (
278
274
  <td
275
+
279
276
  key={column.accessorKey || column.id}
280
277
  className={`text-left font-normal border-r ${column?.cellProps?.className || ''}`}
281
278
  style={{