mirror of
https://github.com/gosticks/react-table.git
synced 2026-08-19 08:20:30 +00:00
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
727f4157c1 | ||
|
|
3f9ba8daba | ||
|
|
3de1bbc3a7 | ||
|
|
7d84f86612 | ||
|
|
40477c1c83 | ||
|
|
906988c35a | ||
|
|
07d879f5bb | ||
|
|
e18f371623 |
@@ -43,6 +43,7 @@ Hooks for building **lightweight, fast and extendable datagrids** for React
|
||||
- Row Expansion
|
||||
- Column Ordering
|
||||
- Animatable
|
||||
- Virtualizable
|
||||
- Server-side/controlled data/state
|
||||
- Extensible via hook-based plugin system
|
||||
- <a href="https://medium.com/@tannerlinsley/why-i-wrote-react-table-and-the-problems-it-has-solved-for-nozzle-others-445c4e93d4a8#.axza4ixba" target="\_parent">"Why I wrote React Table and the problems it has solved for Nozzle.io"</a> by Tanner Linsley
|
||||
|
||||
+29
-773
@@ -317,82 +317,8 @@ The following additional properties are available on every `Cell` object returne
|
||||
|
||||
### Example
|
||||
|
||||
```js
|
||||
function App() {
|
||||
const columns = React.useMemo(
|
||||
() => [
|
||||
{
|
||||
Header: 'Name',
|
||||
columns: [
|
||||
{
|
||||
Header: 'First Name',
|
||||
accessor: 'firstName',
|
||||
},
|
||||
{
|
||||
Header: 'Last Name',
|
||||
accessor: 'lastName',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
[]
|
||||
)
|
||||
|
||||
const data = [
|
||||
{
|
||||
firstName: 'Tanner',
|
||||
lastName: 'Linsley',
|
||||
},
|
||||
{
|
||||
firstName: 'Shawn',
|
||||
lastName: 'Wang',
|
||||
},
|
||||
{
|
||||
firstName: 'Kent C.',
|
||||
lastName: 'Dodds',
|
||||
},
|
||||
{
|
||||
firstName: 'Ryan',
|
||||
lastName: 'Florence',
|
||||
},
|
||||
]
|
||||
|
||||
return <MyTable columns={columns} data={data} />
|
||||
}
|
||||
|
||||
function MyTable({ columns, data }) {
|
||||
const { getTableProps, headerGroups, rows, prepareRow } = useTable({
|
||||
columns,
|
||||
data,
|
||||
})
|
||||
|
||||
return (
|
||||
<table {...getTableProps()}>
|
||||
<thead>
|
||||
{headerGroups.map(headerGroup => (
|
||||
<tr {...headerGroup.getHeaderGroupProps()}>
|
||||
{headerGroup.headers.map(column => (
|
||||
<th {...column.getHeaderProps()}>{column.render('Header')}</th>
|
||||
))}
|
||||
</tr>
|
||||
))}
|
||||
</thead>
|
||||
<tbody {...getTableBodyProps()}>
|
||||
{rows.map(
|
||||
(row, i) =>
|
||||
prepareRow(row) || (
|
||||
<tr {...row.getRowProps()}>
|
||||
{row.cells.map(cell => {
|
||||
return <td {...cell.getCellProps()}>{cell.render('Cell')}</td>
|
||||
})}
|
||||
</tr>
|
||||
)
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
)
|
||||
}
|
||||
```
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/basic)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/basic)
|
||||
|
||||
# `useSortBy`
|
||||
|
||||
@@ -503,63 +429,8 @@ The following properties are available on every `Column` object returned by the
|
||||
|
||||
### Example
|
||||
|
||||
```js
|
||||
function Table({ columns, data }) {
|
||||
// Set some default sorting state. For this an additional import of useTableState is needed
|
||||
const state = useTableState({ sortBy: [{ id: 'firstName', desc: true }] })
|
||||
|
||||
const { getTableProps, headerGroups, rows, prepareRow } = useTable(
|
||||
{
|
||||
columns,
|
||||
data,
|
||||
state,
|
||||
},
|
||||
useSortBy // Use the sortBy hook
|
||||
)
|
||||
|
||||
return (
|
||||
<table {...getTableProps()}>
|
||||
<thead>
|
||||
{headerGroups.map(headerGroup => (
|
||||
<tr {...headerGroup.getHeaderGroupProps()}>
|
||||
{headerGroup.headers.map(column => (
|
||||
// Add the sorting props to control sorting. For this example
|
||||
// we can add them into the header props
|
||||
<th {...column.getHeaderProps(column.getSortByToggleProps())}>
|
||||
{column.render('Header')}
|
||||
<span>
|
||||
{/* Add a sort direction indicator */}
|
||||
<span>
|
||||
{column.isSorted
|
||||
? column.isSortedDesc
|
||||
? ' 🔽'
|
||||
: ' 🔼'
|
||||
: ''}
|
||||
</span>
|
||||
{/* Add a sort index indicator */}
|
||||
<span>({column.isSorted ? column.sortedIndex + 1 : ''})</span>
|
||||
</span>
|
||||
</th>
|
||||
))}
|
||||
</tr>
|
||||
))}
|
||||
</thead>
|
||||
<tbody {...getTableBodyProps()}>
|
||||
{rows.map(
|
||||
(row, i) =>
|
||||
prepareRow(row) || (
|
||||
<tr {...row.getRowProps()}>
|
||||
{row.cells.map(cell => {
|
||||
return <td {...cell.getCellProps()}>{cell.render('Cell')}</td>
|
||||
})}
|
||||
</tr>
|
||||
)
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
)
|
||||
}
|
||||
```
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/sorting)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/sorting)
|
||||
|
||||
# `useFilters`
|
||||
|
||||
@@ -643,49 +514,8 @@ The following properties are available on every `Column` object returned by the
|
||||
|
||||
### Example
|
||||
|
||||
```js
|
||||
// A great library for fuzzy filtering/sorting items
|
||||
import matchSorter from 'match-sorter'
|
||||
|
||||
const state = useTableState({ filters: { firstName: 'tanner' } })
|
||||
|
||||
const filterTypes = React.useMemo(() => ({
|
||||
// Add a new fuzzyText filter type.
|
||||
fuzzyText: (rows, id, filterValue) => {
|
||||
return matchSorter(rows, filterValue, { keys: [row => row[id] })
|
||||
},
|
||||
// Or, override the default text filter to use
|
||||
// "startWith"
|
||||
text: (rows, id, filterValue) => {
|
||||
return rows.filter(row => {
|
||||
const rowValue = row.values[id]
|
||||
return rowValue !== undefined
|
||||
? String(rowValue)
|
||||
.toLowerCase()
|
||||
.startsWith(String(filterValue).toLowerCase())
|
||||
: true
|
||||
})
|
||||
}
|
||||
}), [matchSorter])
|
||||
|
||||
// Override the default column filter to be our new `fuzzyText` filter type
|
||||
const defaultColumn = React.useMemo(() => ({
|
||||
filter: 'fuzzyText'
|
||||
}))
|
||||
|
||||
const { rows } = useTable(
|
||||
{
|
||||
// state[0].groupBy === ['firstName']
|
||||
state,
|
||||
manualFilters: false,
|
||||
disableFilters: false,
|
||||
// Pass our custom filter types
|
||||
filterTypes,
|
||||
defaultColumn
|
||||
},
|
||||
useFilters
|
||||
)
|
||||
```
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/filtering)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/filtering)
|
||||
|
||||
# `useGroupBy`
|
||||
|
||||
@@ -797,168 +627,8 @@ The following additional properties are available on every `Cell` object returne
|
||||
|
||||
### Example
|
||||
|
||||
```js
|
||||
function Table({ columns, data }) {
|
||||
const {
|
||||
getTableProps,
|
||||
headerGroups,
|
||||
rows,
|
||||
prepareRow,
|
||||
state: [{ groupBy, expanded }],
|
||||
} = useTable(
|
||||
{
|
||||
columns,
|
||||
data,
|
||||
},
|
||||
useGroupBy,
|
||||
useExpanded // useGroupBy would be pretty useless without useExpanded ;)
|
||||
)
|
||||
|
||||
// We don't want to render all 2000 rows for this example, so cap
|
||||
// it at 20 for this use case
|
||||
const firstPageRows = rows.slice()
|
||||
|
||||
return (
|
||||
<table {...getTableProps()}>
|
||||
<thead>
|
||||
{headerGroups.map(headerGroup => (
|
||||
<tr {...headerGroup.getHeaderGroupProps()}>
|
||||
{headerGroup.headers.map(column => (
|
||||
<th {...column.getHeaderProps()}>
|
||||
{column.canGroupBy ? (
|
||||
// If the column can be grouped, let's add a toggle
|
||||
<span {...column.getGroupByToggleProps()}>
|
||||
{column.grouped ? '🛑' : '👊'}
|
||||
</span>
|
||||
) : null}
|
||||
{column.render('Header')}
|
||||
</th>
|
||||
))}
|
||||
</tr>
|
||||
))}
|
||||
</thead>
|
||||
<tbody {...getTableBodyProps()}>
|
||||
{firstPageRows.map(
|
||||
(row, i) =>
|
||||
prepareRow(row) || (
|
||||
<tr {...row.getRowProps()}>
|
||||
{row.cells.map(cell => {
|
||||
return (
|
||||
<td {...cell.getCellProps()}>
|
||||
{cell.grouped ? (
|
||||
// If it's a grouped cell, add an expander and row count
|
||||
<>
|
||||
<span
|
||||
style={{
|
||||
cursor: 'pointer',
|
||||
}}
|
||||
onClick={() => row.toggleExpanded()}
|
||||
>
|
||||
{row.isExpanded ? '👇' : '👉'}
|
||||
</span>
|
||||
{cell.render('Cell')} ({row.subRows.length})
|
||||
</>
|
||||
) : cell.aggregated ? (
|
||||
// If the cell is aggregated, use the Aggregated
|
||||
// renderer for cell
|
||||
cell.render('Aggregated')
|
||||
) : cell.repeatedValue ? null : ( // For cells with repeated values, render null
|
||||
// Otherwise, just render the regular cell
|
||||
cell.render('Cell')
|
||||
)}
|
||||
</td>
|
||||
)
|
||||
})}
|
||||
</tr>
|
||||
)
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
)
|
||||
}
|
||||
|
||||
// This is a custom aggregator that
|
||||
// takes in an array of values and
|
||||
// returns the rounded median
|
||||
function roundedMedian(values) {
|
||||
let min = values[0] || ''
|
||||
let max = values[0] || ''
|
||||
|
||||
values.forEach(value => {
|
||||
min = Math.min(min, value)
|
||||
max = Math.max(max, value)
|
||||
})
|
||||
|
||||
return Math.round((min + max) / 2)
|
||||
}
|
||||
|
||||
function App() {
|
||||
const columns = React.useMemo(
|
||||
() => [
|
||||
{
|
||||
Header: 'Name',
|
||||
columns: [
|
||||
{
|
||||
Header: 'First Name',
|
||||
accessor: 'firstName',
|
||||
// Use a two-stage aggregator here to first
|
||||
// count the total rows being aggregated,
|
||||
// then sum any of those counts if they are
|
||||
// aggregated further
|
||||
aggregate: ['sum', 'count'],
|
||||
Aggregated: ({ cell: { value } }) => `${value} Names`,
|
||||
},
|
||||
{
|
||||
Header: 'Last Name',
|
||||
accessor: 'lastName',
|
||||
// Use another two-stage aggregator here to
|
||||
// first count the UNIQUE values from the rows
|
||||
// being aggregated, then sum those counts if
|
||||
// they are aggregated further
|
||||
aggregate: ['sum', 'uniqueCount'],
|
||||
Aggregated: ({ cell: { value } }) => `${value} Unique Names`,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
Header: 'Info',
|
||||
columns: [
|
||||
{
|
||||
Header: 'Age',
|
||||
accessor: 'age',
|
||||
// Aggregate the average age of visitors
|
||||
aggregate: 'average',
|
||||
Aggregated: ({ cell: { value } }) => `${value} (avg)`,
|
||||
},
|
||||
{
|
||||
Header: 'Visits',
|
||||
accessor: 'visits',
|
||||
// Aggregate the sum of all visits
|
||||
aggregate: 'sum',
|
||||
Aggregated: ({ cell: { value } }) => `${value} (total)`,
|
||||
},
|
||||
{
|
||||
Header: 'Status',
|
||||
accessor: 'status',
|
||||
},
|
||||
{
|
||||
Header: 'Profile Progress',
|
||||
accessor: 'progress',
|
||||
// Use our custom roundedMedian aggregator
|
||||
aggregate: roundedMedian,
|
||||
Aggregated: ({ cell: { value } }) => `${value} (med)`,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
[]
|
||||
)
|
||||
|
||||
const data = React.useMemo(() => makeData(10000), [])
|
||||
|
||||
return <Table columns={columns} data={data} />
|
||||
}
|
||||
```
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/grouping)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/grouping)
|
||||
|
||||
# `useExpanded`
|
||||
|
||||
@@ -1005,126 +675,8 @@ The following additional properties are available on every `row` object returned
|
||||
|
||||
### Example
|
||||
|
||||
```js
|
||||
function Table({ columns: userColumns, data }) {
|
||||
const {
|
||||
getTableProps,
|
||||
headerGroups,
|
||||
rows,
|
||||
prepareRow,
|
||||
state: [{ expanded }],
|
||||
} = useTable(
|
||||
{
|
||||
columns: userColumns,
|
||||
data,
|
||||
},
|
||||
useExpanded // Use the useExpanded plugin hook
|
||||
)
|
||||
|
||||
return (
|
||||
<>
|
||||
<pre>
|
||||
<code>{JSON.stringify({ expanded }, null, 2)}</code>
|
||||
</pre>
|
||||
<table {...getTableProps()}>
|
||||
<thead>
|
||||
{headerGroups.map(headerGroup => (
|
||||
<tr {...headerGroup.getHeaderGroupProps()}>
|
||||
{headerGroup.headers.map(column => (
|
||||
<th {...column.getHeaderProps()}>{column.render('Header')}</th>
|
||||
))}
|
||||
</tr>
|
||||
))}
|
||||
</thead>
|
||||
<tbody {...getTableBodyProps()}>
|
||||
{rows.map(
|
||||
(row, i) =>
|
||||
prepareRow(row) || (
|
||||
<tr {...row.getRowProps()}>
|
||||
{row.cells.map(cell => {
|
||||
return (
|
||||
<td {...cell.getCellProps()}>{cell.render('Cell')}</td>
|
||||
)
|
||||
})}
|
||||
</tr>
|
||||
)
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<br />
|
||||
<div>Showing the first 20 results of {rows.length} rows</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
function App() {
|
||||
const columns = React.useMemo(
|
||||
() => [
|
||||
{
|
||||
// Build our expander column
|
||||
Header: () => null, // No header, please
|
||||
id: 'expander', // Make sure it has an ID
|
||||
Cell: ({ row }) =>
|
||||
// Use the row.canExpand and row.getExpandedToggleProps prop getter
|
||||
// to build the toggle for expanding a row
|
||||
row.canExpand ? (
|
||||
<span
|
||||
{...row.getExpandedToggleProps({
|
||||
style: {
|
||||
// We can even use the row.depth property
|
||||
// and paddingLeft to indicate the depth
|
||||
// of the row
|
||||
paddingLeft: `${row.depth * 2}rem`,
|
||||
},
|
||||
})}
|
||||
>
|
||||
{row.isExpanded ? '👇' : '👉'}
|
||||
</span>
|
||||
) : null,
|
||||
},
|
||||
{
|
||||
Header: 'Name',
|
||||
columns: [
|
||||
{
|
||||
Header: 'First Name',
|
||||
accessor: 'firstName',
|
||||
},
|
||||
{
|
||||
Header: 'Last Name',
|
||||
accessor: 'lastName',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
Header: 'Info',
|
||||
columns: [
|
||||
{
|
||||
Header: 'Age',
|
||||
accessor: 'age',
|
||||
},
|
||||
{
|
||||
Header: 'Visits',
|
||||
accessor: 'visits',
|
||||
},
|
||||
{
|
||||
Header: 'Status',
|
||||
accessor: 'status',
|
||||
},
|
||||
{
|
||||
Header: 'Profile Progress',
|
||||
accessor: 'progress',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
[]
|
||||
)
|
||||
|
||||
const data = React.useMemo(() => makeData(5, 5, 5), [])
|
||||
|
||||
return <Table columns={columns} data={data} />
|
||||
}
|
||||
```
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/expanding)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/expanding)
|
||||
|
||||
# `usePagination`
|
||||
|
||||
@@ -1199,178 +751,12 @@ The following values are provided to the table `instance`:
|
||||
|
||||
### Example
|
||||
|
||||
```js
|
||||
function Table({ columns, data }) {
|
||||
// Use the state and functions returned from useTable to build your UI
|
||||
const {
|
||||
getTableProps,
|
||||
headerGroups,
|
||||
prepareRow,
|
||||
page, // Instead of using 'rows', we'll use page,
|
||||
// which has only the rows for the active page
|
||||
|
||||
// The rest of these things are super handy, too ;)
|
||||
canPreviousPage,
|
||||
canNextPage,
|
||||
pageOptions,
|
||||
pageCount,
|
||||
gotoPage,
|
||||
nextPage,
|
||||
previousPage,
|
||||
setPageSize,
|
||||
state: [{ pageIndex, pageSize }],
|
||||
} = useTable(
|
||||
{
|
||||
columns,
|
||||
data,
|
||||
},
|
||||
usePagination
|
||||
)
|
||||
|
||||
// Render the UI for your table
|
||||
return (
|
||||
<>
|
||||
<pre>
|
||||
<code>
|
||||
{JSON.stringify(
|
||||
{
|
||||
pageIndex,
|
||||
pageSize,
|
||||
pageCount,
|
||||
canNextPage,
|
||||
canPreviousPage,
|
||||
},
|
||||
null,
|
||||
2
|
||||
)}
|
||||
</code>
|
||||
</pre>
|
||||
<table {...getTableProps()}>
|
||||
<thead>
|
||||
{headerGroups.map(headerGroup => (
|
||||
<tr {...headerGroup.getHeaderGroupProps()}>
|
||||
{headerGroup.headers.map(column => (
|
||||
<th {...column.getHeaderProps()}>{column.render('Header')}</th>
|
||||
))}
|
||||
</tr>
|
||||
))}
|
||||
</thead>
|
||||
<tbody {...getTableBodyProps()}>
|
||||
{page.map(
|
||||
(row, i) =>
|
||||
prepareRow(row) || (
|
||||
<tr {...row.getRowProps()}>
|
||||
{row.cells.map(cell => {
|
||||
return (
|
||||
<td {...cell.getCellProps()}>{cell.render('Cell')}</td>
|
||||
)
|
||||
})}
|
||||
</tr>
|
||||
)
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
{/*
|
||||
Pagination can be built however you'd like.
|
||||
This is just a very basic UI implementation:
|
||||
*/}
|
||||
<div className="pagination">
|
||||
<button onClick={() => gotoPage(0)} disabled={!canPreviousPage}>
|
||||
{'<<'}
|
||||
</button>{' '}
|
||||
<button onClick={() => previousPage()} disabled={!canPreviousPage}>
|
||||
{'<'}
|
||||
</button>{' '}
|
||||
<button onClick={() => nextPage()} disabled={!canNextPage}>
|
||||
{'>'}
|
||||
</button>{' '}
|
||||
<button onClick={() => gotoPage(pageCount - 1)} disabled={!canNextPage}>
|
||||
{'>>'}
|
||||
</button>{' '}
|
||||
<span>
|
||||
Page{' '}
|
||||
<strong>
|
||||
{pageIndex + 1} of {pageOptions.length}
|
||||
</strong>{' '}
|
||||
</span>
|
||||
<span>
|
||||
| Go to page:{' '}
|
||||
<input
|
||||
type="number"
|
||||
defaultValue={pageIndex + 1}
|
||||
onChange={e => {
|
||||
const page = e.target.value ? Number(e.target.value) - 1 : 0
|
||||
gotoPage(page)
|
||||
}}
|
||||
style={{ width: '100px' }}
|
||||
/>
|
||||
</span> <select
|
||||
value={pageSize}
|
||||
onChange={e => {
|
||||
setPageSize(Number(e.target.value))
|
||||
}}
|
||||
>
|
||||
{[10, 20, 30, 40, 50].map(pageSize => (
|
||||
<option key={pageSize} value={pageSize}>
|
||||
Show {pageSize}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
function App() {
|
||||
const columns = React.useMemo(
|
||||
() => [
|
||||
{
|
||||
Header: 'Name',
|
||||
columns: [
|
||||
{
|
||||
Header: 'First Name',
|
||||
accessor: 'firstName',
|
||||
},
|
||||
{
|
||||
Header: 'Last Name',
|
||||
accessor: 'lastName',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
Header: 'Info',
|
||||
columns: [
|
||||
{
|
||||
Header: 'Age',
|
||||
accessor: 'age',
|
||||
},
|
||||
{
|
||||
Header: 'Visits',
|
||||
accessor: 'visits',
|
||||
},
|
||||
{
|
||||
Header: 'Status',
|
||||
accessor: 'status',
|
||||
},
|
||||
{
|
||||
Header: 'Profile Progress',
|
||||
accessor: 'progress',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
[]
|
||||
)
|
||||
|
||||
const data = React.useMemo(() => makeData(100000), [])
|
||||
|
||||
return (
|
||||
<Styles>
|
||||
<Table columns={columns} data={data} />
|
||||
</Styles>
|
||||
)
|
||||
}
|
||||
```
|
||||
- Basic Pagination
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/pagination)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/pagination)
|
||||
- Controlled Pagination
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/pagination)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/pagination)
|
||||
|
||||
# `useTokenPagination (Coming Soon)`
|
||||
|
||||
@@ -1434,123 +820,8 @@ The following additional properties are available on every **prepared** `row` ob
|
||||
|
||||
### Example
|
||||
|
||||
```js
|
||||
function Table({ columns, data }) {
|
||||
// Use the state and functions returned from useTable to build your UI
|
||||
const {
|
||||
getTableProps,
|
||||
headerGroups,
|
||||
rows,
|
||||
prepareRow,
|
||||
state: [{ selectedRows }],
|
||||
} = useTable(
|
||||
{
|
||||
columns,
|
||||
data,
|
||||
},
|
||||
useRowSelect
|
||||
)
|
||||
|
||||
// Render the UI for your table
|
||||
return (
|
||||
<>
|
||||
<table {...getTableProps()}>
|
||||
<thead>
|
||||
{headerGroups.map(headerGroup => (
|
||||
<tr {...headerGroup.getHeaderGroupProps()}>
|
||||
{headerGroup.headers.map(column => (
|
||||
<th {...column.getHeaderProps()}>{column.render('Header')}</th>
|
||||
))}
|
||||
</tr>
|
||||
))}
|
||||
</thead>
|
||||
<tbody {...getTableBodyProps()}>
|
||||
{rows.map(
|
||||
(row, i) =>
|
||||
prepareRow(row) || (
|
||||
<tr {...row.getRowProps()}>
|
||||
{row.cells.map(cell => {
|
||||
return (
|
||||
<td {...cell.getCellProps()}>{cell.render('Cell')}</td>
|
||||
)
|
||||
})}
|
||||
</tr>
|
||||
)
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Selected Rows: {selectedRows.length}</p>
|
||||
<pre>
|
||||
<code>{JSON.stringify({ selectedRows }, null, 2)}</code>
|
||||
</pre>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
function App() {
|
||||
const columns = React.useMemo(
|
||||
() => [
|
||||
// Let's make a column for selection
|
||||
{
|
||||
id: 'selection',
|
||||
// The header can use the table's getToggleAllRowsSelectedProps method
|
||||
// to render a checkbox
|
||||
Header: ({ getToggleAllRowsSelectedProps }) => (
|
||||
<div>
|
||||
<input type="checkbox" {...getToggleAllRowsSelectedProps()} />
|
||||
</div>
|
||||
),
|
||||
// The cell can use the individual row's getToggleRowSelectedProps method
|
||||
// to the render a checkbox
|
||||
Cell: ({ row }) => (
|
||||
<div>
|
||||
<input type="checkbox" {...row.getToggleRowSelectedProps()} />
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
Header: 'Name',
|
||||
columns: [
|
||||
{
|
||||
Header: 'First Name',
|
||||
accessor: 'firstName',
|
||||
},
|
||||
{
|
||||
Header: 'Last Name',
|
||||
accessor: 'lastName',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
Header: 'Info',
|
||||
columns: [
|
||||
{
|
||||
Header: 'Age',
|
||||
accessor: 'age',
|
||||
},
|
||||
{
|
||||
Header: 'Visits',
|
||||
accessor: 'visits',
|
||||
},
|
||||
{
|
||||
Header: 'Status',
|
||||
accessor: 'status',
|
||||
},
|
||||
{
|
||||
Header: 'Profile Progress',
|
||||
accessor: 'progress',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
[]
|
||||
)
|
||||
|
||||
const data = React.useMemo(() => makeData(10), [])
|
||||
|
||||
return <Table columns={columns} data={data} />
|
||||
}
|
||||
```
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/row-selection)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/row-selection)
|
||||
|
||||
# `useRowState`
|
||||
|
||||
@@ -1635,7 +906,7 @@ The following additional properties are available on every `Cell` object returne
|
||||
|
||||
### Example
|
||||
|
||||
- [Source + Guide](https://github.com/tannerlinsley/react-table/tree/master/examples/block-layout)
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/block-layout)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/block-layout)
|
||||
|
||||
# `useAbsoluteLayout`
|
||||
@@ -1673,7 +944,7 @@ The following additional properties are available on every `Cell` object returne
|
||||
|
||||
### Example
|
||||
|
||||
- [Source + Guide](https://github.com/tannerlinsley/react-table/tree/master/examples/absolute-layout)
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/absolute-layout)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/absolute-layout)
|
||||
|
||||
# `useColumnOrder`
|
||||
@@ -1697,9 +968,13 @@ The following options are supported via the main options object passed to `useTa
|
||||
The following values are provided to the table `instance`:
|
||||
|
||||
- `setColumnOrder: Function(updater: Function | Array<ColumnID>) => void`
|
||||
|
||||
- Use this function to programmatically update the columnOrder.
|
||||
- `updater` can be a function or value. If a `function` is passed, it will receive the current value and expect a new one to be returned.
|
||||
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/column-ordering)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/column-ordering)
|
||||
|
||||
# `useTableState`
|
||||
|
||||
- Optional
|
||||
@@ -1733,7 +1008,7 @@ The following options are supported via the main options object passed to `useTa
|
||||
- Optional
|
||||
- Inspired by Kent C. Dodd's [State Reducer Pattern](https://kentcdodds.com/blog/the-state-reducer-pattern-with-react-hooks)
|
||||
- With every `setState` call to a table state (even internally), this reducer is called and is allowed to modify the final state object for updating.
|
||||
- It is passed the `oldState`, the `newState`, and an action `type`.
|
||||
- It is passed the `oldState`, the `newState`, and an optional action `type`.
|
||||
- `useState`
|
||||
- Optional
|
||||
- Defaults to `React.useState`
|
||||
@@ -1754,30 +1029,11 @@ The following options are supported via the main options object passed to `useTa
|
||||
- This function signature is **almost** (see next point) identical to the functional API exposed by `React.setState`. It is passed the previous state and is expected to return a new version of the state.
|
||||
- **NOTE: `updater` must be a function. Passing a replacement object is not supported as it is with React.useState**
|
||||
- `type: String`
|
||||
- Optional
|
||||
- The [action type](TODO) corresponding to what action being taken against the state.
|
||||
|
||||
### Example
|
||||
|
||||
```js
|
||||
export default function MyTable({ manualPageIndex }) {
|
||||
// This is the initial state for our table
|
||||
const initialState = { pageSize: 10, pageIndex: 0 }
|
||||
|
||||
// Here, we can override the pageIndex
|
||||
// regardless of the internal table state
|
||||
const overrides = React.useMemo(() => ({
|
||||
pageIndex: manualPageIndex,
|
||||
}))
|
||||
|
||||
const state = useTableState(initialState, overrides)
|
||||
|
||||
// You can use effects to observe changes to the state
|
||||
React.useEffect(() => {
|
||||
console.log('Page Size Changed!', initialState.pageSize)
|
||||
}, [initialState.pageSize])
|
||||
|
||||
const { rows } = useTable({
|
||||
state,
|
||||
})
|
||||
}
|
||||
```
|
||||
- As used in Controlled Pagination
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/pagination-controlled)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/pagination-controlled)
|
||||
|
||||
+15
-15
@@ -2,52 +2,52 @@
|
||||
|
||||
- **Simple** - All of these examples use automatic state management, meaning, they don't hoist any state out of the table or manually control anything. Start here for understanding the basics about how to build your table UI.
|
||||
- Basic
|
||||
- [Source + Guide](https://github.com/tannerlinsley/react-table/tree/master/examples/basic)
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/basic)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/basic)
|
||||
- Sorting
|
||||
- [Source + Guide](https://github.com/tannerlinsley/react-table/tree/master/examples/sorting)
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/sorting)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/sorting)
|
||||
- Filtering
|
||||
- [Source + Guide](https://github.com/tannerlinsley/react-table/tree/master/examples/filtering)
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/filtering)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/filtering)
|
||||
- Grouping
|
||||
- [Source + Guide](https://github.com/tannerlinsley/react-table/tree/master/examples/grouping)
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/grouping)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/grouping)
|
||||
- Pagination
|
||||
- [Source + Guide](https://github.com/tannerlinsley/react-table/tree/master/examples/pagination)
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/pagination)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/pagination)
|
||||
- Row Selection
|
||||
- [Source + Guide](https://github.com/tannerlinsley/react-table/tree/master/examples/row-selection)
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/row-selection)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/row-selection)
|
||||
- Expanding
|
||||
- [Source + Guide](https://github.com/tannerlinsley/react-table/tree/master/examples/expanding)
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/expanding)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/expanding)
|
||||
- Sub Components
|
||||
- [Source + Guide](https://github.com/tannerlinsley/react-table/tree/master/examples/sub-components)
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/sub-components)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/sub-components)
|
||||
- Editable Data
|
||||
- [Source + Guide](https://github.com/tannerlinsley/react-table/tree/master/examples/editable-data)
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/editable-data)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/editable-data)
|
||||
- Column Ordering
|
||||
- [Source + Guide](https://github.com/tannerlinsley/react-table/tree/master/examples/column-ordering)
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/column-ordering)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/column-ordering)
|
||||
- **Complex**
|
||||
- The "Kitchen Sink"
|
||||
- [Source + Guide](https://github.com/tannerlinsley/react-table/tree/master/examples/kitchen-sink)
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/kitchen-sink)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/kitchen-sink)
|
||||
- **Controlled via `useTableState`** - These examples are more advanced because they demonstrate how to manually control and respond to the state of the table using the `useTableState` hook.
|
||||
- Pagination (Controlled)
|
||||
- [Source + Guide](https://github.com/tannerlinsley/react-table/tree/master/examples/pagination-controlled)
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/pagination-controlled)
|
||||
- [Open in CodeSandobx](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/pagination-controlled)
|
||||
- **UI & Rendering** - These examples demonstrate how to use React Table with your favorite UI libraries or tools!
|
||||
- Virtualized Rows (React-Window)
|
||||
- [Source + Guide](https://github.com/tannerlinsley/react-table/tree/master/examples/virtualized-rows)
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/virtualized-rows)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/virtualized-rows)
|
||||
- Animated (Framer-Motion)
|
||||
- [Source + Guide](https://github.com/tannerlinsley/react-table/tree/master/examples/animated-framer-motion)
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/animated-framer-motion)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/animated-framer-motion)
|
||||
- Material-UI
|
||||
- [Source + Guide](https://github.com/tannerlinsley/react-table/tree/master/examples/material-UI-components)
|
||||
- [Source](https://github.com/tannerlinsley/react-table/tree/master/examples/material-UI-components)
|
||||
- [Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/material-UI-components)
|
||||
- [ ] Styled-Components
|
||||
- [ ] CSS
|
||||
|
||||
+3
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-table",
|
||||
"version": "7.0.0-beta.3",
|
||||
"version": "7.0.0-beta.5",
|
||||
"description": "A fast, lightweight, opinionated table and datagrid built on React",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/tannerlinsley/react-table#readme",
|
||||
@@ -17,6 +17,7 @@
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.es.js",
|
||||
"jsnext:main": "dist/index.es.js",
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"commit": "git add . && git-cz",
|
||||
"test": "is-ci 'test:ci' 'test:dev'",
|
||||
@@ -90,7 +91,7 @@
|
||||
"rollup-plugin-commonjs": "^9.1.3",
|
||||
"rollup-plugin-node-resolve": "^4.0.0",
|
||||
"rollup-plugin-peer-deps-external": "^2.2.0",
|
||||
"rollup-plugin-uglify": "^6.0.2",
|
||||
"rollup-plugin-terser": "^5.1.2",
|
||||
"snapshot-diff": "^0.5.2"
|
||||
},
|
||||
"config": {
|
||||
|
||||
+3
-16
@@ -2,7 +2,7 @@ import babel from 'rollup-plugin-babel'
|
||||
import commonjs from 'rollup-plugin-commonjs'
|
||||
import external from 'rollup-plugin-peer-deps-external'
|
||||
import resolve from 'rollup-plugin-node-resolve'
|
||||
import { uglify } from 'rollup-plugin-uglify'
|
||||
import { terser } from 'rollup-plugin-terser'
|
||||
|
||||
import pkg from './package.json'
|
||||
|
||||
@@ -14,28 +14,15 @@ export default [
|
||||
format: 'cjs',
|
||||
sourcemap: true,
|
||||
},
|
||||
plugins: [
|
||||
external(),
|
||||
babel({
|
||||
exclude: 'node_modules/**',
|
||||
}),
|
||||
resolve(),
|
||||
commonjs(),
|
||||
uglify(),
|
||||
],
|
||||
plugins: [external(), babel(), resolve(), commonjs(), terser()],
|
||||
},
|
||||
{
|
||||
input: 'src/index.js',
|
||||
external: Object.keys(pkg.peerDependencies),
|
||||
output: {
|
||||
file: pkg.module,
|
||||
format: 'es',
|
||||
sourcemap: true,
|
||||
},
|
||||
plugins: [
|
||||
babel({
|
||||
exclude: ['/**/node_modules/**'],
|
||||
}),
|
||||
],
|
||||
plugins: [external(), babel()],
|
||||
},
|
||||
]
|
||||
|
||||
@@ -5,11 +5,6 @@ export { actions, types }
|
||||
|
||||
export const addActions = (...acts) => {
|
||||
acts.forEach(action => {
|
||||
if (actions[action]) {
|
||||
throw new Error(
|
||||
`An React Table action type called ${action} has already been registered!`
|
||||
)
|
||||
}
|
||||
// Action values are formatted this way to discourage
|
||||
// you (the dev) from interacting with them in any way
|
||||
// other than importing `{ actions } from 'react-table'`
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import React from 'react'
|
||||
//
|
||||
import { types } from '../actions'
|
||||
|
||||
export const defaultState = {}
|
||||
|
||||
const defaultReducer = (old, newState) => newState
|
||||
@@ -33,14 +31,6 @@ export const useTableState = (
|
||||
|
||||
const reducedSetState = React.useCallback(
|
||||
(updater, type) => {
|
||||
if (!types[type]) {
|
||||
console.info({
|
||||
stateUpdaterFn: updater,
|
||||
actionType: type,
|
||||
currentState: overriddenStateRef.current,
|
||||
})
|
||||
throw new Error('Detected an unknown table action! (Details Above)')
|
||||
}
|
||||
return setState(old => {
|
||||
const newState = updater(old)
|
||||
return reducer(old, newState, type)
|
||||
|
||||
@@ -6878,15 +6878,16 @@ rollup-plugin-peer-deps-external@^2.2.0:
|
||||
resolved "https://registry.yarnpkg.com/rollup-plugin-peer-deps-external/-/rollup-plugin-peer-deps-external-2.2.0.tgz#99ef9231aa01736f3e9605b7c3084a0d627f665b"
|
||||
integrity sha512-BmJMHUWQcvjS2dQMwJ7dzvdbwpRChnq4AYk2sTU/4aySt9Kumk8y8W3HhTHss31wxzKb0AC/wsiX1AqDcOBIEA==
|
||||
|
||||
rollup-plugin-uglify@^6.0.2:
|
||||
version "6.0.2"
|
||||
resolved "https://registry.yarnpkg.com/rollup-plugin-uglify/-/rollup-plugin-uglify-6.0.2.tgz#681042cfdf7ea4e514971946344e1a95bc2772fe"
|
||||
integrity sha512-qwz2Tryspn5QGtPUowq5oumKSxANKdrnfz7C0jm4lKxvRDsNe/hSGsB9FntUul7UeC4TsZEWKErVgE1qWSO0gw==
|
||||
rollup-plugin-terser@^5.1.2:
|
||||
version "5.1.2"
|
||||
resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-5.1.2.tgz#3e41256205cb75f196fc70d4634227d1002c255c"
|
||||
integrity sha512-sWKBCOS+vUkRtHtEiJPAf+WnBqk/C402fBD9AVHxSIXMqjsY7MnYWKYEUqGixtr0c8+1DjzUEPlNgOYQPVrS1g==
|
||||
dependencies:
|
||||
"@babel/code-frame" "^7.0.0"
|
||||
jest-worker "^24.0.0"
|
||||
serialize-javascript "^1.6.1"
|
||||
uglify-js "^3.4.9"
|
||||
jest-worker "^24.6.0"
|
||||
rollup-pluginutils "^2.8.1"
|
||||
serialize-javascript "^1.7.0"
|
||||
terser "^4.1.0"
|
||||
|
||||
rollup-pluginutils@^2.6.0, rollup-pluginutils@^2.8.1:
|
||||
version "2.8.1"
|
||||
@@ -7014,10 +7015,10 @@ semver@^6.0.0, semver@^6.1.1:
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
|
||||
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
|
||||
|
||||
serialize-javascript@^1.6.1:
|
||||
version "1.7.0"
|
||||
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.7.0.tgz#d6e0dfb2a3832a8c94468e6eb1db97e55a192a65"
|
||||
integrity sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA==
|
||||
serialize-javascript@^1.7.0:
|
||||
version "1.9.1"
|
||||
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.9.1.tgz#cfc200aef77b600c47da9bb8149c943e798c2fdb"
|
||||
integrity sha512-0Vb/54WJ6k5v8sSWN09S0ora+Hnr+cX40r9F170nT+mSkaxltoE/7R3OrIdBSUv1OoiobH1QoWQbCnAO+e8J1A==
|
||||
|
||||
set-blocking@^2.0.0, set-blocking@~2.0.0:
|
||||
version "2.0.0"
|
||||
@@ -7187,6 +7188,14 @@ source-map-support@^0.5.6:
|
||||
buffer-from "^1.0.0"
|
||||
source-map "^0.6.0"
|
||||
|
||||
source-map-support@~0.5.12:
|
||||
version "0.5.13"
|
||||
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932"
|
||||
integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==
|
||||
dependencies:
|
||||
buffer-from "^1.0.0"
|
||||
source-map "^0.6.0"
|
||||
|
||||
source-map-url@^0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3"
|
||||
@@ -7503,6 +7512,15 @@ tar@^4:
|
||||
safe-buffer "^5.1.2"
|
||||
yallist "^3.0.3"
|
||||
|
||||
terser@^4.1.0:
|
||||
version "4.3.4"
|
||||
resolved "https://registry.yarnpkg.com/terser/-/terser-4.3.4.tgz#ad91bade95619e3434685d69efa621a5af5f877d"
|
||||
integrity sha512-Kcrn3RiW8NtHBP0ssOAzwa2MsIRQ8lJWiBG/K7JgqPlomA3mtb2DEmp4/hrUA+Jujx+WZ02zqd7GYD+QRBB/2Q==
|
||||
dependencies:
|
||||
commander "^2.20.0"
|
||||
source-map "~0.6.1"
|
||||
source-map-support "~0.5.12"
|
||||
|
||||
test-exclude@^4.2.1:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.3.tgz#a9a5e64474e4398339245a0a769ad7c2f4a97c20"
|
||||
@@ -7678,7 +7696,7 @@ typedarray@^0.0.6:
|
||||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
|
||||
|
||||
uglify-js@^3.1.4, uglify-js@^3.4.9:
|
||||
uglify-js@^3.1.4:
|
||||
version "3.6.0"
|
||||
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.6.0.tgz#704681345c53a8b2079fb6cec294b05ead242ff5"
|
||||
integrity sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==
|
||||
|
||||
Reference in New Issue
Block a user