mirror of
https://github.com/gosticks/react-table.git
synced 2026-08-19 16:30:21 +00:00
Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42b78d52ca | ||
|
|
68fd89af3c | ||
|
|
0c43e19091 | ||
|
|
08bb50ae48 | ||
|
|
0fcc9e608c | ||
|
|
15125f9326 | ||
|
|
b8701f260a | ||
|
|
70bdd272e5 | ||
|
|
5ad648d9da | ||
|
|
117dc54439 |
+6
-6
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"dist/index.js": {
|
||||
"bundled": 108216,
|
||||
"minified": 51347,
|
||||
"gzipped": 13498
|
||||
"bundled": 108184,
|
||||
"minified": 51333,
|
||||
"gzipped": 13486
|
||||
},
|
||||
"dist/index.es.js": {
|
||||
"bundled": 107373,
|
||||
"minified": 50597,
|
||||
"gzipped": 13345,
|
||||
"bundled": 107341,
|
||||
"minified": 50583,
|
||||
"gzipped": 13333,
|
||||
"treeshaked": {
|
||||
"rollup": {
|
||||
"code": 80,
|
||||
|
||||
+8
-3
@@ -1,3 +1,8 @@
|
||||
## 7.0.0-rc.8
|
||||
|
||||
- Fix an issue where `useResizeColumns` would crash when using the resizer prop getter
|
||||
- Fix an issue where `useBlockLayout` was clobbering props sent to headers
|
||||
|
||||
## 7.0.0-rc.7
|
||||
|
||||
Removed:
|
||||
@@ -23,9 +28,9 @@ Modified:
|
||||
- Converted almost all usages of `instanceRef.current` to use `useGetLatest(instanceRef.current)` to help with avoiding memory leaks and to be more terse.
|
||||
- Converted all previous prop-getter definitions to use the new `makePropGetter`
|
||||
- Reorganized plugin hooks to declare as many hooks in the main plugin function as opposed to in the `useInstance` hook.
|
||||
- Changed the `useInstanceBeforeDimensions` hook to be a `loopHooks` call instead of a reducer. An error will be thrown now if any of these hook functions returns a value (to discourage mutation of the instance)
|
||||
- Changed the `useInstance` hook to be a `loopHooks` call instead of a reducer. An error will be thrown now if any of these hook functions returns a value (to discourage mutation of the instance)
|
||||
- Change the `prepareRow` hook to be a `loopHooks` call instead of a reducer. An error will be thrown now if any of these hook functions returns a value (to discourage mutation of the row)
|
||||
- Changed the `useInstanceBeforeDimensions` hook to be a `loopHooks` call instead of a reducer. An error will be thrown now if any of these hook functions returns a value (to encourage mutation of the instance)
|
||||
- Changed the `useInstance` hook to be a `loopHooks` call instead of a reducer. An error will be thrown now if any of these hook functions returns a value (to encourage mutation of the instance)
|
||||
- Change the `prepareRow` hook to be a `loopHooks` call instead of a reducer. An error will be thrown now if any of these hook functions returns a value (to encourage mutation of the row)
|
||||
|
||||
## 7.0.0-rc.6
|
||||
|
||||
|
||||
@@ -92,19 +92,18 @@ function Table({ columns, data }) {
|
||||
</div>
|
||||
|
||||
<div className="rows" {...getTableBodyProps()}>
|
||||
{rows.map(
|
||||
(row, i) => {
|
||||
prepareRow(row);
|
||||
return (
|
||||
<div {...row.getRowProps()} className="row body">
|
||||
{row.cells.map((cell,index) => (
|
||||
<div {...cell.getCellProps()} key={index} className="cell">
|
||||
{cell.render('Cell')}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
)}
|
||||
{rows.map((row, i) => {
|
||||
prepareRow(row)
|
||||
return (
|
||||
<div {...row.getRowProps()} className="row body">
|
||||
{row.cells.map((cell, index) => (
|
||||
<div {...cell.getCellProps()} key={index} className="cell">
|
||||
{cell.render('Cell')}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -8087,10 +8087,10 @@ react-scripts@3.0.1:
|
||||
optionalDependencies:
|
||||
fsevents "2.0.6"
|
||||
|
||||
react-table@next:
|
||||
version "7.0.0-alpha.7"
|
||||
resolved "https://registry.yarnpkg.com/react-table/-/react-table-7.0.0-alpha.7.tgz#0cb6da6f32adb397e68505b7cdd4880d15d73017"
|
||||
integrity sha512-oXE9RRkE2CFk1OloNCSTPQ9qxOdujgkCoW5b/srbJsBog/ySkWuozBTQkxH1wGNmnSxGyTrTxJqXdXPQam7VAw==
|
||||
react-table@latest:
|
||||
version "7.0.0-rc.7"
|
||||
resolved "https://registry.yarnpkg.com/react-table/-/react-table-7.0.0-rc.7.tgz#1bf3e248cdef22213821c021236e895bdc3cb5d2"
|
||||
integrity sha512-24Yofwkh822NyCmnpsrChV8SNOCENQWpV4A5f/MzapTi6iwje644Q11/wbLIgJdPnUJJ0/JbhjsDjxlB6yFV7Q==
|
||||
|
||||
react@^16.8.6:
|
||||
version "16.8.6"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-table",
|
||||
"version": "7.0.0-rc.7",
|
||||
"version": "7.0.0-rc.8",
|
||||
"description": "Hooks for building lightweight, fast and extendable datagrids for React",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/tannerlinsley/react-table#readme",
|
||||
|
||||
@@ -1,4 +1,24 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1576007021431,
|
||||
"files": [
|
||||
{
|
||||
"filename": "index.js",
|
||||
"size": 22643,
|
||||
"delta": -7
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1576004320856,
|
||||
"files": [
|
||||
{
|
||||
"filename": "index.js",
|
||||
"size": 22650,
|
||||
"delta": 30
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1576003432935,
|
||||
"files": [
|
||||
|
||||
@@ -1,4 +1,24 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1576007027792,
|
||||
"files": [
|
||||
{
|
||||
"filename": "index.es.js",
|
||||
"size": 22461,
|
||||
"delta": -7
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1576004327554,
|
||||
"files": [
|
||||
{
|
||||
"filename": "index.es.js",
|
||||
"size": 22468,
|
||||
"delta": 30
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1576003439933,
|
||||
"files": [
|
||||
|
||||
@@ -14,8 +14,8 @@ actions.setHiddenColumns = 'setHiddenColumns'
|
||||
actions.toggleHideAllColumns = 'toggleHideAllColumns'
|
||||
|
||||
export const useColumnVisibility = hooks => {
|
||||
hooks.getToggleHiddenProps = [defualtGetToggleHiddenProps]
|
||||
hooks.getToggleHideAllColumnsProps = [defualtGetToggleHideAllColumnsProps]
|
||||
hooks.getToggleHiddenProps = [defaultGetToggleHiddenProps]
|
||||
hooks.getToggleHideAllColumnsProps = [defaultGetToggleHideAllColumnsProps]
|
||||
|
||||
hooks.stateReducers.push(reducer)
|
||||
hooks.useInstanceBeforeDimensions.push(useInstanceBeforeDimensions)
|
||||
@@ -28,7 +28,7 @@ export const useColumnVisibility = hooks => {
|
||||
|
||||
useColumnVisibility.pluginName = 'useColumnVisibility'
|
||||
|
||||
const defualtGetToggleHiddenProps = (props, instance, column) => [
|
||||
const defaultGetToggleHiddenProps = (props, instance, column) => [
|
||||
props,
|
||||
{
|
||||
onChange: e => {
|
||||
@@ -42,7 +42,7 @@ const defualtGetToggleHiddenProps = (props, instance, column) => [
|
||||
},
|
||||
]
|
||||
|
||||
const defualtGetToggleHideAllColumnsProps = (props, instance) => [
|
||||
const defaultGetToggleHideAllColumnsProps = (props, instance) => [
|
||||
props,
|
||||
{
|
||||
onChange: e => {
|
||||
|
||||
@@ -192,18 +192,16 @@ const useInstanceBeforeDimensions = instance => {
|
||||
state: { columnResizing },
|
||||
} = instance
|
||||
|
||||
getHeaderProps.push(() => {
|
||||
return {
|
||||
style: {
|
||||
position: 'relative',
|
||||
},
|
||||
}
|
||||
getHeaderProps.push({
|
||||
style: {
|
||||
position: 'relative',
|
||||
},
|
||||
})
|
||||
|
||||
const getInstance = useGetLatest(instance)
|
||||
|
||||
const getResizerPropsHooks = useConsumeHookGetter(
|
||||
getInstance(),
|
||||
getInstance().hooks,
|
||||
'getResizerProps'
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user