mirror of
https://github.com/gosticks/react-table.git
synced 2025-10-16 11:55:36 +00:00
Add prettier format
This commit is contained in:
parent
9b262676be
commit
6b70309f42
21
.eslintrc
21
.eslintrc
@ -1,22 +1,3 @@
|
|||||||
{
|
{
|
||||||
"parser": "babel-eslint",
|
"extends": ["react-app", "prettier"]
|
||||||
"extends": ["react-app", "prettier"],
|
|
||||||
"plugins": [
|
|
||||||
"react-hooks"
|
|
||||||
],
|
|
||||||
"env": {
|
|
||||||
"es6": true
|
|
||||||
},
|
|
||||||
"parserOptions": {
|
|
||||||
"sourceType": "module"
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"space-before-function-paren": 0,
|
|
||||||
"react/jsx-boolean-value": 0
|
|
||||||
},
|
|
||||||
"settings": {
|
|
||||||
"react": {
|
|
||||||
"version": "latest"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
146
CHANGELOG.md
146
CHANGELOG.md
@ -2,58 +2,58 @@
|
|||||||
|
|
||||||
#### Fixes & Optimizations
|
#### Fixes & Optimizations
|
||||||
|
|
||||||
* Since `resolveData` is now capable of materializing data on it's own, the `data` prop is no longer required as a prop-type.
|
- Since `resolveData` is now capable of materializing data on it's own, the `data` prop is no longer required as a prop-type.
|
||||||
|
|
||||||
## 6.8.4
|
## 6.8.4
|
||||||
|
|
||||||
#### Fixes & Optimizations
|
#### Fixes & Optimizations
|
||||||
|
|
||||||
* Only run `resolveData` prop when `data` prop has changed, not any others.
|
- Only run `resolveData` prop when `data` prop has changed, not any others.
|
||||||
|
|
||||||
## 6.8.3
|
## 6.8.3
|
||||||
|
|
||||||
#### Fixes & Optimizations
|
#### Fixes & Optimizations
|
||||||
|
|
||||||
* Allow the `resolveData` prop to alter or materialize new data when the `data` prop changes.
|
- Allow the `resolveData` prop to alter or materialize new data when the `data` prop changes.
|
||||||
|
|
||||||
## 6.8.1
|
## 6.8.1
|
||||||
|
|
||||||
#### Fixes & Optimizations
|
#### Fixes & Optimizations
|
||||||
|
|
||||||
* Updated eslint and code formatting
|
- Updated eslint and code formatting
|
||||||
|
|
||||||
## 6.7.5
|
## 6.7.5
|
||||||
|
|
||||||
#### Fixes & Optimizations
|
#### Fixes & Optimizations
|
||||||
|
|
||||||
* Now passes `column` to `getResizerProps` (#667)
|
- Now passes `column` to `getResizerProps` (#667)
|
||||||
* NOTE: `getResizerProps` is now only called if the column is resizable
|
- NOTE: `getResizerProps` is now only called if the column is resizable
|
||||||
* Fixes the `className` ordering in defaultProps for ThComponent (#673)
|
- Fixes the `className` ordering in defaultProps for ThComponent (#673)
|
||||||
* NOTE: user supplied classNames now come at the end so they can extend the defaults
|
- NOTE: user supplied classNames now come at the end so they can extend the defaults
|
||||||
|
|
||||||
## 6.7.4
|
## 6.7.4
|
||||||
|
|
||||||
#### Fixes & Optimizations
|
#### Fixes & Optimizations
|
||||||
|
|
||||||
* Fix Prop types for columns
|
- Fix Prop types for columns
|
||||||
|
|
||||||
## 6.7.3
|
## 6.7.3
|
||||||
|
|
||||||
#### Fixes & Optimizations
|
#### Fixes & Optimizations
|
||||||
|
|
||||||
* Fix the rest of the proptypes
|
- Fix the rest of the proptypes
|
||||||
|
|
||||||
## 6.7.2
|
## 6.7.2
|
||||||
|
|
||||||
#### Fixes & Optimizations
|
#### Fixes & Optimizations
|
||||||
|
|
||||||
* `getPropTypes` proptype check
|
- `getPropTypes` proptype check
|
||||||
|
|
||||||
## 6.7.1
|
## 6.7.1
|
||||||
|
|
||||||
#### Fixes & Optimizations
|
#### Fixes & Optimizations
|
||||||
|
|
||||||
* `eslint-config` moved to dev deps
|
- `eslint-config` moved to dev deps
|
||||||
|
|
||||||
## 6.7.0
|
## 6.7.0
|
||||||
|
|
||||||
@ -61,113 +61,113 @@
|
|||||||
|
|
||||||
#### New Features
|
#### New Features
|
||||||
|
|
||||||
* Expose page/pageSize to rows/cells
|
- Expose page/pageSize to rows/cells
|
||||||
* Supply sort direction to custom sort methods
|
- Supply sort direction to custom sort methods
|
||||||
|
|
||||||
#### Fixes & Optimizations
|
#### Fixes & Optimizations
|
||||||
|
|
||||||
* README updates
|
- README updates
|
||||||
* Linter cleanup
|
- Linter cleanup
|
||||||
* Added PropTypes node module
|
- Added PropTypes node module
|
||||||
* Deps, linting and style upgrades
|
- Deps, linting and style upgrades
|
||||||
|
|
||||||
## 6.6.0
|
## 6.6.0
|
||||||
|
|
||||||
#### Fixes & Optimizations
|
#### Fixes & Optimizations
|
||||||
|
|
||||||
* moved repo to react-tools
|
- moved repo to react-tools
|
||||||
* Doc examples moved to codesandbox.io
|
- Doc examples moved to codesandbox.io
|
||||||
* README updates
|
- README updates
|
||||||
* CSS refacting for rt-tfoot to match rt-thead
|
- CSS refacting for rt-tfoot to match rt-thead
|
||||||
* CSS more specific for input and select
|
- CSS more specific for input and select
|
||||||
|
|
||||||
## 6.5.3
|
## 6.5.3
|
||||||
|
|
||||||
#### Fixes & Optimizations
|
#### Fixes & Optimizations
|
||||||
|
|
||||||
* `onClick` proxying and eslint
|
- `onClick` proxying and eslint
|
||||||
|
|
||||||
## 6.5.2
|
## 6.5.2
|
||||||
|
|
||||||
#### New Features
|
#### New Features
|
||||||
|
|
||||||
* Provide onClick handleOriginal function - #406
|
- Provide onClick handleOriginal function - #406
|
||||||
|
|
||||||
#### Fixes & Optimizations
|
#### Fixes & Optimizations
|
||||||
|
|
||||||
* README updates
|
- README updates
|
||||||
* `makePathArray` in utils - #326
|
- `makePathArray` in utils - #326
|
||||||
* Various fixes: #294, #376, #398, #415,
|
- Various fixes: #294, #376, #398, #415,
|
||||||
|
|
||||||
## 6.5.1
|
## 6.5.1
|
||||||
|
|
||||||
#### Fixes & Optimizations
|
#### Fixes & Optimizations
|
||||||
|
|
||||||
* `defaultExpanded` now works correctly - #372
|
- `defaultExpanded` now works correctly - #372
|
||||||
* `column.getProps().rest` props are now applied correctly
|
- `column.getProps().rest` props are now applied correctly
|
||||||
* `makeTemplateComponent` now supports `displayName` - #289
|
- `makeTemplateComponent` now supports `displayName` - #289
|
||||||
|
|
||||||
## 6.5.0
|
## 6.5.0
|
||||||
|
|
||||||
##### New Features
|
##### New Features
|
||||||
|
|
||||||
* `column.filterAll` - defaults to `false`, but when set to `true` will provide the entire array of rows to `filterMethod` as opposed to one row at a time. This allows for more fine-grained filtering using any method you can dream up. See the [Custom Filtering example](https://react-table.js.org/#/story/custom-filtering) for more info.
|
- `column.filterAll` - defaults to `false`, but when set to `true` will provide the entire array of rows to `filterMethod` as opposed to one row at a time. This allows for more fine-grained filtering using any method you can dream up. See the [Custom Filtering example](https://react-table.js.org/#/story/custom-filtering) for more info.
|
||||||
|
|
||||||
## 6.4.0
|
## 6.4.0
|
||||||
|
|
||||||
##### New Features
|
##### New Features
|
||||||
|
|
||||||
* `PadRowComponent` - the content rendered inside of a padding row. Defaults to a react component that renders ` `
|
- `PadRowComponent` - the content rendered inside of a padding row. Defaults to a react component that renders ` `
|
||||||
|
|
||||||
## 6.3.0
|
## 6.3.0
|
||||||
|
|
||||||
##### New Features
|
##### New Features
|
||||||
|
|
||||||
* `defaultSortDesc` - allows you to set the default sorting direction for all columns to descending.
|
- `defaultSortDesc` - allows you to set the default sorting direction for all columns to descending.
|
||||||
* `column.defaultSortDesc` - allows you to set the default sorting direction for a specific column. Falls back to the global `defaultSortDesc` when not set at all.
|
- `column.defaultSortDesc` - allows you to set the default sorting direction for a specific column. Falls back to the global `defaultSortDesc` when not set at all.
|
||||||
|
|
||||||
## 6.0.0
|
## 6.0.0
|
||||||
|
|
||||||
##### New Features
|
##### New Features
|
||||||
|
|
||||||
* New Renderers:
|
- New Renderers:
|
||||||
* `Aggregated` - Custom renderer for aggregated cells
|
- `Aggregated` - Custom renderer for aggregated cells
|
||||||
* `Pivot` - Custom renderer for Pivoted Cells (utilizes `Expander` and `PivotValue`)
|
- `Pivot` - Custom renderer for Pivoted Cells (utilizes `Expander` and `PivotValue`)
|
||||||
* `PivotValue` - Custom renderer for Pivot cell values (deprecates the undocumented `pivotRender` option)
|
- `PivotValue` - Custom renderer for Pivot cell values (deprecates the undocumented `pivotRender` option)
|
||||||
* `Expander` - Custom renderer for Pivot cell Expander
|
- `Expander` - Custom renderer for Pivot cell Expander
|
||||||
* Added custom sorting methods per table via `defaultSortMethod` and per column via `column.sortMethod`
|
- Added custom sorting methods per table via `defaultSortMethod` and per column via `column.sortMethod`
|
||||||
* Pivot columns are now visibly separate and sorted/filtered independently.
|
- Pivot columns are now visibly separate and sorted/filtered independently.
|
||||||
* Added `column.resizable` to override global table `resizable` option for specific columns.
|
- Added `column.resizable` to override global table `resizable` option for specific columns.
|
||||||
* Added `column.sortable` to override global table `sortable` option for specific columns.
|
- Added `column.sortable` to override global table `sortable` option for specific columns.
|
||||||
* Added `column.filterable` to override global table `filterable` option for specific columns.
|
- Added `column.filterable` to override global table `filterable` option for specific columns.
|
||||||
* Added `defaultExpanded` table option.
|
- Added `defaultExpanded` table option.
|
||||||
* All callbacks can now be utilized without needing to hoist and manage the piece of state they export. That is what their prop counterparts are for, so now the corresponding prop is used instead of the callback to detect a "fully controlled" state.
|
- All callbacks can now be utilized without needing to hoist and manage the piece of state they export. That is what their prop counterparts are for, so now the corresponding prop is used instead of the callback to detect a "fully controlled" state.
|
||||||
* Prevent transitions while column resizing for a smoother resize effect.
|
- Prevent transitions while column resizing for a smoother resize effect.
|
||||||
* Disable text selection while resizing columns.
|
- Disable text selection while resizing columns.
|
||||||
|
|
||||||
##### Breaking API Changes
|
##### Breaking API Changes
|
||||||
|
|
||||||
* New Renderers:
|
- New Renderers:
|
||||||
* `Cell` - deprecates and replaces `render`
|
- `Cell` - deprecates and replaces `render`
|
||||||
* `Header` - deprecates and replaces `header`
|
- `Header` - deprecates and replaces `header`
|
||||||
* `Footer` - deprecates and replaces `footer`
|
- `Footer` - deprecates and replaces `footer`
|
||||||
* `Filter`- deprecates and replaces `filterRender`
|
- `Filter`- deprecates and replaces `filterRender`
|
||||||
* Callbacks now provide the destination state as the primary parameter(s). This makes hoisting and controlling the state in redux or component state much easier. eg.
|
- Callbacks now provide the destination state as the primary parameter(s). This makes hoisting and controlling the state in redux or component state much easier. eg.
|
||||||
* `onSorting` no longer requires you to build your own toggle logic
|
- `onSorting` no longer requires you to build your own toggle logic
|
||||||
* `onResize` no longer requires you to build your own resize logic
|
- `onResize` no longer requires you to build your own resize logic
|
||||||
* Renamed `onChange` callback -> `onFetchData` which will always fire when a new data model needs to be fetched (or if not using `manual`, when new data is materialized internally).
|
- Renamed `onChange` callback -> `onFetchData` which will always fire when a new data model needs to be fetched (or if not using `manual`, when new data is materialized internally).
|
||||||
* Renamed `filtering` -> `filtered`
|
- Renamed `filtering` -> `filtered`
|
||||||
* Renamed `sorting` -> `sorted`
|
- Renamed `sorting` -> `sorted`
|
||||||
* Renamed `expandedRows` -> `expanded`
|
- Renamed `expandedRows` -> `expanded`
|
||||||
* Renamed `resizing` -> `resized`
|
- Renamed `resizing` -> `resized`
|
||||||
* Renamed `defaultResizing` -> `defaultResized`
|
- Renamed `defaultResizing` -> `defaultResized`
|
||||||
* Renamed `defaultFiltering` -> `defaultFiltered`
|
- Renamed `defaultFiltering` -> `defaultFiltered`
|
||||||
* Renamed `defaultSorting` -> `defaultSorted`
|
- Renamed `defaultSorting` -> `defaultSorted`
|
||||||
* Renamed `onSortingChange` -> `onSortedChange`
|
- Renamed `onSortingChange` -> `onSortedChange`
|
||||||
* Renamed `onFilteringChange` -> `onFilteredChange`
|
- Renamed `onFilteringChange` -> `onFilteredChange`
|
||||||
* Renamed `onResize` -> `onResizedChange`
|
- Renamed `onResize` -> `onResizedChange`
|
||||||
* Renamed `onExpandRow` -> `onExpandedChange`
|
- Renamed `onExpandRow` -> `onExpandedChange`
|
||||||
* Renamed `showFilters` -> `filterable`
|
- Renamed `showFilters` -> `filterable`
|
||||||
* Renamed `hideFilter` -> `filterable` (Column option. Note the true/false value is now flipped.)
|
- Renamed `hideFilter` -> `filterable` (Column option. Note the true/false value is now flipped.)
|
||||||
* `cellInfo.row` and `rowInfo.row` now reference the materialize data for the table. To reference the original row, use `cellInfo.original` and `rowInfo.original`
|
- `cellInfo.row` and `rowInfo.row` now reference the materialize data for the table. To reference the original row, use `cellInfo.original` and `rowInfo.original`
|
||||||
* Removed `pivotRender` column option. You can now control how the value is displayed by overriding the `PivotValueComponent` or the individual column's `PivotValue` renderer. See [Pivoting Options Story](https://react-table.js.org/?selectedKind=2.%20Demos&selectedStory=Pivoting%20Options&full=0&down=1&left=1&panelRight=0&downPanel=kadirahq%2Fstorybook-addon-actions%2Factions-panel) for a reference on how to customize pivot column rendering.
|
- Removed `pivotRender` column option. You can now control how the value is displayed by overriding the `PivotValueComponent` or the individual column's `PivotValue` renderer. See [Pivoting Options Story](https://react-table.js.org/?selectedKind=2.%20Demos&selectedStory=Pivoting%20Options&full=0&down=1&left=1&panelRight=0&downPanel=kadirahq%2Fstorybook-addon-actions%2Factions-panel) for a reference on how to customize pivot column rendering.
|
||||||
|
|||||||
@ -1086,9 +1086,12 @@ export default function MyTable({ manualPageIndex }) {
|
|||||||
const state = useTableState(initialState, overrides)
|
const state = useTableState(initialState, overrides)
|
||||||
|
|
||||||
// You can use effects to observe changes to the state
|
// You can use effects to observe changes to the state
|
||||||
React.useEffect(() => {
|
React.useEffect(
|
||||||
console.log('Page Size Changed!', initialState.pageSize)
|
() => {
|
||||||
}, [initialState.pageSize])
|
console.log('Page Size Changed!', initialState.pageSize)
|
||||||
|
},
|
||||||
|
[initialState.pageSize]
|
||||||
|
)
|
||||||
|
|
||||||
const { rows } = useTable({
|
const { rows } = useTable({
|
||||||
state,
|
state,
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
const path = require('path');
|
const path = require('path')
|
||||||
|
|
||||||
const lintProject = require('./configs/tests/jest.lint');
|
const lintProject = require('./configs/tests/jest.lint')
|
||||||
const unitProject = require('./configs/tests/jest.unit');
|
const unitProject = require('./configs/tests/jest.unit')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...require('./configs/tests/jest.common'),
|
...require('./configs/tests/jest.common'),
|
||||||
@ -13,4 +13,4 @@ module.exports = {
|
|||||||
'jest-watch-typeahead/testname',
|
'jest-watch-typeahead/testname',
|
||||||
'jest-watch-select-projects',
|
'jest-watch-select-projects',
|
||||||
],
|
],
|
||||||
};
|
}
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
'*.js': ['prettier --write', 'git add'],
|
'*.{md,js,ts,jsx,tsx}': ['prettier --write --no-editorconfig', 'git add'],
|
||||||
}
|
}
|
||||||
|
|||||||
29
package.json
29
package.json
@ -26,7 +26,8 @@
|
|||||||
"start": "rollup -c -w",
|
"start": "rollup -c -w",
|
||||||
"prepare": "yarn build",
|
"prepare": "yarn build",
|
||||||
"release": "yarn publish",
|
"release": "yarn publish",
|
||||||
"releaseNext": "yarn publish --tag next"
|
"releaseNext": "yarn publish --tag next",
|
||||||
|
"format": "prettier ./**{md,js,jsx,tsx} --write"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"src/",
|
"src/",
|
||||||
@ -43,31 +44,31 @@
|
|||||||
"react-dom": "^16.8.3"
|
"react-dom": "^16.8.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/plugin-proposal-class-properties": "^7.2.1",
|
"@babel/plugin-proposal-class-properties": "^7.5.5",
|
||||||
"@babel/preset-env": "^7.2.0",
|
"@babel/preset-env": "^7.5.5",
|
||||||
"@babel/preset-react": "^7.0.0",
|
"@babel/preset-react": "^7.0.0",
|
||||||
"@babel/runtime": "^7.2.0",
|
"@babel/runtime": "^7.5.5",
|
||||||
"@svgr/rollup": "^4.1.0",
|
"@svgr/rollup": "^4.3.2",
|
||||||
"@testing-library/react": "^8.0.4",
|
"@testing-library/react": "^8.0.7",
|
||||||
"babel-core": "7.0.0-bridge.0",
|
"babel-core": "7.0.0-bridge.0",
|
||||||
"babel-eslint": "9.x",
|
"babel-eslint": "9.x",
|
||||||
"commitizen": "^4.0.3",
|
"commitizen": "^4.0.3",
|
||||||
"cross-env": "^5.1.4",
|
"cross-env": "^5.2.0",
|
||||||
"eslint": "5.x",
|
"eslint": "5.x",
|
||||||
"eslint-config-prettier": "^4.3.0",
|
"eslint-config-prettier": "^4.3.0",
|
||||||
"eslint-config-react-app": "^4.0.1",
|
"eslint-config-react-app": "^4.0.1",
|
||||||
"eslint-config-standard": "^12.0.0",
|
"eslint-config-standard": "^12.0.0",
|
||||||
"eslint-config-standard-react": "^7.0.2",
|
"eslint-config-standard-react": "^7.0.2",
|
||||||
"eslint-plugin-flowtype": "2.x",
|
"eslint-plugin-flowtype": "2.x",
|
||||||
"eslint-plugin-import": "2.x",
|
"eslint-plugin-import": "2.18.2",
|
||||||
"eslint-plugin-jsx-a11y": "6.x",
|
"eslint-plugin-jsx-a11y": "6.2.3",
|
||||||
"eslint-plugin-node": "^8.0.0",
|
"eslint-plugin-node": "^8.0.0",
|
||||||
"eslint-plugin-prettier": "^3.1.0",
|
"eslint-plugin-prettier": "^3.1.0",
|
||||||
"eslint-plugin-promise": "^4.0.0",
|
"eslint-plugin-promise": "^4.2.1",
|
||||||
"eslint-plugin-react": "7.x",
|
"eslint-plugin-react": "7.14.3",
|
||||||
"eslint-plugin-react-hooks": "1.5.0",
|
"eslint-plugin-react-hooks": "1.6.1",
|
||||||
"eslint-plugin-standard": "^4.0.0",
|
"eslint-plugin-standard": "^4.0.0",
|
||||||
"husky": "^3.0.1",
|
"husky": "^3.0.2",
|
||||||
"is-ci-cli": "^1.1.1",
|
"is-ci-cli": "^1.1.1",
|
||||||
"jest": "^24.8.0",
|
"jest": "^24.8.0",
|
||||||
"jest-cli": "^24.8.0",
|
"jest-cli": "^24.8.0",
|
||||||
@ -76,7 +77,7 @@
|
|||||||
"jest-watch-typeahead": "^0.3.1",
|
"jest-watch-typeahead": "^0.3.1",
|
||||||
"lint-staged": "^9.2.1",
|
"lint-staged": "^9.2.1",
|
||||||
"rollup": "^0.68.0",
|
"rollup": "^0.68.0",
|
||||||
"rollup-plugin-babel": "^4.1.0",
|
"rollup-plugin-babel": "^4.3.3",
|
||||||
"rollup-plugin-commonjs": "^9.1.3",
|
"rollup-plugin-commonjs": "^9.1.3",
|
||||||
"rollup-plugin-node-resolve": "^4.0.0",
|
"rollup-plugin-node-resolve": "^4.0.0",
|
||||||
"rollup-plugin-peer-deps-external": "^2.2.0",
|
"rollup-plugin-peer-deps-external": "^2.2.0",
|
||||||
|
|||||||
@ -12,17 +12,17 @@ export default [
|
|||||||
output: {
|
output: {
|
||||||
file: pkg.main,
|
file: pkg.main,
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
sourcemap: true
|
sourcemap: true,
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
external(),
|
external(),
|
||||||
babel({
|
babel({
|
||||||
exclude: 'node_modules/**'
|
exclude: 'node_modules/**',
|
||||||
}),
|
}),
|
||||||
resolve(),
|
resolve(),
|
||||||
commonjs(),
|
commonjs(),
|
||||||
uglify()
|
uglify(),
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: 'src/index.js',
|
input: 'src/index.js',
|
||||||
@ -30,12 +30,12 @@ export default [
|
|||||||
output: {
|
output: {
|
||||||
file: pkg.module,
|
file: pkg.module,
|
||||||
format: 'es',
|
format: 'es',
|
||||||
sourcemap: true
|
sourcemap: true,
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
babel({
|
babel({
|
||||||
exclude: ['/**/node_modules/**']
|
exclude: ['/**/node_modules/**'],
|
||||||
})
|
}),
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user