react-live-data-table 1.0.6 → 1.0.8
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/src/ReactDataTable.jsx +16 -19
package/package.json
CHANGED
package/src/ReactDataTable.jsx
CHANGED
@@ -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
|
-
|
178
|
-
<
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
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={{
|