mirror of
https://github.com/gosticks/react-table.git
synced 2026-06-29 01:20:02 +00:00
fix(npm/examples): added src back to npm package, fixed grouping example
This commit is contained in:
@@ -49,9 +49,9 @@ function Table({ columns, data }) {
|
||||
useExpanded // useGroupBy would be pretty useless without useExpanded ;)
|
||||
)
|
||||
|
||||
// We don't want to render all 2000 rows for this example, so cap
|
||||
// We don't want to render all of the rows for this example, so cap
|
||||
// it at 20 for this use case
|
||||
const firstPageRows = rows.slice()
|
||||
const firstPageRows = rows.slice(0, 100)
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -68,7 +68,7 @@ function Table({ columns, data }) {
|
||||
{column.canGroupBy ? (
|
||||
// If the column can be grouped, let's add a toggle
|
||||
<span {...column.getGroupByToggleProps()}>
|
||||
{column.grouped ? '🛑' : '👊'}
|
||||
{column.grouped ? '🛑 ' : '👊 '}
|
||||
</span>
|
||||
) : null}
|
||||
{column.render('Header')}
|
||||
@@ -109,7 +109,7 @@ function Table({ columns, data }) {
|
||||
onClick={() => row.toggleExpanded()}
|
||||
>
|
||||
{row.isExpanded ? '👇' : '👉'}
|
||||
</span>
|
||||
</span>{' '}
|
||||
{cell.render('Cell')} ({row.subRows.length})
|
||||
</>
|
||||
) : cell.aggregated ? (
|
||||
@@ -129,7 +129,7 @@ function Table({ columns, data }) {
|
||||
</tbody>
|
||||
</table>
|
||||
<br />
|
||||
<div>Showing the first 20 results of {rows.length} rows</div>
|
||||
<div>Showing the first 100 results of {rows.length} rows</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
},
|
||||
"files": [
|
||||
"CHANGELOG.md",
|
||||
"src/**/*.js",
|
||||
"dist",
|
||||
"LICENCE",
|
||||
"package.json",
|
||||
|
||||
Reference in New Issue
Block a user