Skip to content

Commit

Permalink
React Data Grid V5 (#1266)
Browse files Browse the repository at this point in the history
* Allow for optional SimpleCellFormatter.value prop (#948)

* Improve Cell navigation Performance (#1123)

* Move cell selection responsibilty to SelectionMask component

* Selection Mask working at 60fps

* Tests for InteractionMask navigation

* Editor Container in interaction Layer

* commit package-lock.json

* Editing Working

* smooth scrolling with keyboard navigation

* Adjust visible start/end calculations after scroll

* Vertical cell Scrolling with keyboard working

* generic move command

* Vertical scrolling navigation with keyboard working

* Code cleanup
- Remove extra ref
- Format JSX

* Update react to the stable version
Delete/Ignore package-lock.json

* Remove deprecated babel plugins

* Export individual constants instead of exporting a default object

* Remove react dependency from react-data-grid
Delete package.json for now

* Remove ReactDOM reference and use refs instead

* More code cleanup
- Fix formatting
- Remove extra spread operator

* Add innerRef to fix scrolling
Remove unused methods

* Remove GridWrapper and GridContainer as it breaks instance methods

* Remove unused CellExpander component

* - Remove singleton store
- Add basic implementation for store/reducer/dispatch
- Remove CellContainer to prevent rerendering of each cell on selection change

* Delete unused files
Cleanup event handlers

* Move copy paste functionality to the Interaction mask component
Check if cell is editable

* Remove flow types

* Remove flow types

* Remove unused variables

* Move copy/paste logic to the interaction layer

* Horizontal scroll using keyboard
Temporarily disable animation

* Rename folder to containers

* Fix cell navigation mode

* Do not prevent event bubling to show context menu

* Add pointer events to fix cell actions

* Fix Filter Row focus

* Dynamically connect cell to support custom renderers

* Fox committing changes
Disable cell container component as it degraded performance

* Migrate cell drag down to Interaction Layer

* Remove react-motion

* Add CellMask to highlight copied cell

* Add drag mask to highlight dragged cells

* Cleanup render method

* Add eventbus to communicate with InteractionMask component
Delete state and containers

* Move EventTypes to contants folder

* Fix clicking on a cell scrolls the canvas to the top

* Fix  cell double click to edit

* Fix tests InteractionMasks

* Fix issue with press enter not committing

* Keep InteractionMask focus logic in central place

* Fix canvas tests

* Fix Canvas tests

* Remove redundant Cell tests

* Fix Cell tests and remove redundant ones

* Fix clicking on a cell scrolls the canvas to the left
Remove componentWillMount

* Add a new DragEnter method
Some code cleanup

* Delete redundant displayStart and displayEnd states

* Prevent navigation in FF on drag

* Fix Grid.js and remove redundant tests

* Move tab behaviour from ReactDataGrid to InteractionMask

* Clean up initial tests for tab behavior in InteractionMasks

* Fix typo and event name

* Use CellNavigationMode constant

* Ignore invalid drag items

* Use a single div instead of multiple divs for drag mask

* Fix SelectionMask zIndex for locked columns

* Delete OverflowCell and OverflowRow components

* Remove unused props and methods

* Clean up props

* Fix scrolling when scrollToRowIndex is set

* Reorder props for clarity

* Commented unused props and methods

* Fix ESLint errors

* Dispatch SCROLL_TO_COLUMN event to scroll Canvas from ReactDataGrid

* Trigger onCellSelected, onCellDeSelected events when cell selection is changed
Fix openCellEditor instance method

* Fix openCellEditor instance method

* Specify required PropTypes

* Fix closing tags

* Enable auto focus on grid

* Fix last row check

* Implement tab behavior for InteractionMasks

* Fix PropTypes warnings
Remove unused state

* Fix Cell PropTypes

* Fix rowData in EditorContainer

* Fix null reference error for drag copy

* Check onCheckCellIsEditable for editing

* Fix some broken unit tests

* Removed redundant and fixed remaining tests

* Fix context menu

* Fix RowsContainer unit tests

* Disable duplicate tests

* Fix example home page fonts

* Install latest node version

* Simplify appveyor script after node upgrade

* Fix lint errors

* Fix failing IE 11 test

* IE compatible version of Array.keys

* packages/rdg-test-utils/index.js

* Delete unused test-utils project

* install gulp gloablly in order to post to coveralls

* Use node 6 on appveyor

* Delete obsolete scroll utils

* Add unit tests for CellMask

* Add unit tests for CopyMask

* Add unit tests for DragMask

* Remove fdescribe

* Add unit tests for DragHandle

* Add unit tests for EventBus

* Format code and object initialization cleanup

* Add unit test for copy operation

* Use conditional rendering instead of returning null

* Add unit tests for Drag functionaity

* Add unit tests for the SelectionMask component

* Add unit tests for CanvasUtils

* Add unit tests for context menu

* Add test to check if Canvas renders the InteractionMasks component

* Delete commented code

* Handle scrolling when selected cell hits the top/bottom boundary when the cellNavigationMode is changeRow

* Fix tab behavior

* Fix cell selection mask for grouped rows

* Add back IE support

* Add polyfills for Set and Map to make the examples work in IE10

* Remove unused variable

* Fix zIndex for filters

* Fix scrolling when editor is closed

* Deleted commented code

* Fix eslint errors

* Delete obsolete tests
Remove commented code

* Fix Typo

* Move the drag enter logic to Row component

* Uncomment code

* Fix event bus prop type

* Define ref callback as a bound method on the class

* Remove private getSelectedValue method

* Fix Cell component export and columns count (#1227)

* Fix cell export

* Fix columns count

* update file names (#1245)

* Rectangular selection range support (on top of 'next') (#1210)

* Allow selection of ranges (with mouse & keyboard)

Parent components of ReactDataGrid can subscribe to (start, update, end) events about
selection ranges. An example page demonstrates this.

* Minor InteractionMasks refactoring based on comments on PR #1210

* Update ReactDataGrid API to group cell range event handlers under cellRangeSelection prop

* Refactor single and multi-cell range selection masks into components

* Revert "Refactor single and multi-cell range selection masks into components"

This reverts commit 8ea34d7.

* Scrolling improvements (#1254)

* Effiecient windowing example

* Remove use of refs to setScrollLeft. Renamed row/col visible boundary property names

* Calculate overscan columns based on scroll direction

* Render overscan columns and rows based on scroll direction

* Set height of grid

* Improved overscan row/col calcualtion

* Send isScrolling prop to formatters to improve perf of complex formatters

* Pass isScrolling prop to HeaderCell and Formatter

* Pass isScrolling prop to HeaderCell and Formatter 2

* Set pointer-events to none when scrolling

* reset setScrollLeft functionality to enable frozen columns

* Ensure set scroll left on frozen columns when scrolling in vertical direction

* Fix context menu

* zindex styles for locked cells

* Render overscan columns when row scrolling has complete

* Show correct SelectionMask position for locked cells

* is scrolling example

* Do not deep compare dependentValues check

* Ensure rowOverscanEndIdx within bounds

* Ensure frozen cells are mounted in correct fixed position if canvas has been scrolled

* Move InteractionMasks styles to a separate file

* Cherry pick set cell ref commit

* Base SelectionMask top and left off rendered cells to handle dynamic row heights

* Take scroll left into account when open editor container

* Catchup with next branch

* Re-add lost canvas.js file

* Fix lint errors

* Fix some build errors

* Remove references to deleted RowsContainer file

* Fix typo

* Fix InteractionMaks test

* Fix some tests

* Fix failing tests

* Handle dynamic row heights in SelectionMask

* Remove unnecessary packages

* Viewport scroll calculations

* Address pull request comments

* use let instead of const in checkScroll function

* Remove unneeded  id from Row component

* Chang logic around getRenderedColumns

* Address more PR comments

* Tests for Viewport Utils

* Fix lint errors and remove console rule from lintrc

* Tests for getScrollDirection

* Tests for getRowOverscanStartIdx

* getRowOverscanEndIdx tests

* Tests for getColOverscanEndIdx

* Tidy up syntax in example31-isScrolling

* Ensure locked columns are shifted to start of column metrics array

* Test for rendering the correct cells

* Fix lint errors

* Rename all fixed/locked/frozen columns to frozen

* Fix tests after npm update

* Fix IE test

* Fixed new warnings in tests

* Fix failing test

* Update version to 5.0.0-alpha1

* Ensure render all visible columns if scrolled to the right and using frozen columns

* Version bump

* Change test expectation

* Fix test

* Ensure last column is rendered when grid scrolled and using frozen columns

* Minor version bump

* Handle viewport scroll state when no columns present

* 5.0.0-alpha8

* Fallback for getSelectedRowTop if no access to row ref

* Fix some bugs around cell selection for RowGroups

* Fix failing test

* Pass row prop to formatters

* Fix failing test and version bump

* Fix lint error

* Re-add deprecated onRowUpdatedMethod - to be removed in v6

* Address some more PR comments

* Air BNB browser shims for Enzyme testing

* Remove unused functions

* prop deprecation warnings

* onDragHandleDoubleClick deprecation warning

* Publish next branch on commit to next

* Get selected row columns if applicable

* Fix failing tests

* Update npmrc token

* Fix some zIndex issues around frozen cells and editors

*  Remove ReactDataGrid dependency from addons bundle (#1272)

* Fix some zIndex issues around frozen cells and editors

* Remove rdg dependency from addons package

* Fix object assign

* Adress PR comments

* Fix tests

* Fix lint error

* add ref to draggable header cell

* Adress PR comments

* Pass renderBase row and correct ref to custom row renderer

* Change editor container to be fixed position

* Add missing rdg-editor-container class on EditorContainer (#1275)

* Ensure row refs reference an RDG Row component

* Show all columns unless scrolling vertically

* isFrozen column check

* Render edtior container without taking scrollLeft into account if column is frozen

* Set CellMask position to be fixed when scrolling horizontally and frozen column is selected

* Unit tests and refactoring (#1279)

Added unit tests for editor position relating to frozen columns. And refactored spec file, updating legacy code

* Upgrade to RDG 5
  • Loading branch information
malonecj authored Sep 19, 2018
1 parent 426801f commit f5ffea6
Show file tree
Hide file tree
Showing 170 changed files with 10,492 additions and 7,652 deletions.
16 changes: 10 additions & 6 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"presets": ["react", "es2015-loose"],
"plugins": [
'transform-class-properties',
'transform-es3-member-expression-literals',
'transform-es3-property-literals'
]
"presets": [
"es2015",
"react",
"stage-2"
],
"plugins": [
"transform-class-properties",
"transform-es3-member-expression-literals",
"transform-es3-property-literals"
]
}
1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
*/
"comma-dangle": [2, "never"], // http://eslint.org/docs/rules/comma-dangle
"no-cond-assign": [2, "always"], // http://eslint.org/docs/rules/no-cond-assign
"no-console": 1, // http://eslint.org/docs/rules/no-console
"no-debugger": 1, // http://eslint.org/docs/rules/no-debugger
"no-alert": 1, // http://eslint.org/docs/rules/no-alert
"no-constant-condition": 1, // http://eslint.org/docs/rules/no-constant-condition
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ dist
npm-debug.log
lerna-debug.log
**.orig
.vscode
.vscode
package-lock.json
Binary file modified .npmrc.enc
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Features
- [Rich cell editors like autocomplete, checkbox and dropdown editors, complete with keyboard navigation](http://adazzle.github.io/react-data-grid/#/examples/built-in-editors)
- Custom cell Editors - Easily create your own
- [Custom cell Formatters](http://adazzle.github.io/react-data-grid/#/examples/custom-formatters)
- [Frozen columns](http://adazzle.github.io/react-data-grid/#/examples/fixed-cols)
- [Frozen columns](http://adazzle.github.io/react-data-grid/#/examples/frozen-cols)
- [Resizable columns](http://adazzle.github.io/react-data-grid/#/examples/resizable-cols)
- [Sorting](http://adazzle.github.io/react-data-grid/#/examples/sortable-cols)
- [Filtering](http://adazzle.github.io/react-data-grid/#/examples/filterable-sortable-grid)
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ environment:
access_token:
secure: dHfUgllfTEAqpcoz3iQj8TO0DGh8n90Coqf0+IXT0bIRNSIxGTDu991X+FStY613
npmrc_token:
secure: vqGk4eUIvg1ngzdW4WE2hlq1U7YupunkayeCh7bXy8M=
secure: +0xEbrDGXwT78XtVnyF0CQcqiKZCgQSVq9DZaIH2YhI=


# Install scripts. (runs after repo cloning)
Expand Down Expand Up @@ -48,5 +48,5 @@ on_success:
- npm run beforepublish
- ps: >-
if(!$env:APPVEYOR_SCHEDULED_BUILD -and !$env:appveyor_pull_request_number -and $env:APPVEYOR_REPO_BRANCH -eq 'next') {
./ci/publish/publishBranch.ps1
./ci/publish/publishNext.ps1
}
28 changes: 14 additions & 14 deletions ci/publish/publishBranch.ps1 → ci/publish/publishNext.ps1
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
$nextVersion = node ./ci/publish/getNextVersion
git config --global credential.helper store
git config --global push.default simple
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:access_token):[email protected]`n"
git config --global user.name $env:APPVEYOR_REPO_COMMIT_AUTHOR
git config --global user.email $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL
git checkout $env:APPVEYOR_REPO_BRANCH
Write-Host "Publishing $($nextVersion) to npm"
if($?)
{
./node_modules/.bin/lerna publish --repo-version $nextVersion --npm-tag=$env:APPVEYOR_REPO_BRANCH --yes --skip-git
}

exit $lastexitcode
$nextVersion = node ./ci/publish/getNextVersion prerelease
git config --global credential.helper store
git config --global push.default simple
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:access_token):[email protected]`n"
git config --global user.name $env:APPVEYOR_REPO_COMMIT_AUTHOR
git config --global user.email $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL
git checkout $env:APPVEYOR_REPO_BRANCH
Write-Host "Publishing $($nextVersion) to npm"
if($?)
{
./node_modules/.bin/lerna publish --repo-version $nextVersion --npm-tag=$env:APPVEYOR_REPO_BRANCH --yes --skip-git
}

exit $lastexitcode
8 changes: 6 additions & 2 deletions config/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* In local config, only run tests using phantom js. No code coverage reports applied
*/
var webpack = require('webpack');
require('airbnb-browser-shims');
var webpackConfig = require('./webpack.common.config.js');
var RewirePlugin = require("rewire-webpack");
var path = require('path');
Expand All @@ -27,7 +28,7 @@ module.exports = function (config) {
return BROWSERS.split(',');
}
if(RELEASE){
browsers = ['Chrome','Firefox','IE']
browsers = ['Chrome','Firefox', 'IE']
}else if(DEBUG){
browsers = ['ChromeDebugging'];
}
Expand Down Expand Up @@ -86,7 +87,10 @@ module.exports = function (config) {
loaders: webpackConfig.module.loaders
},
resolve: {
extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx']
extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx'],
alias: {
common: path.resolve('packages/common/')
}
},
plugins: [
new RewirePlugin()
Expand Down
9 changes: 8 additions & 1 deletion config/webpack.common.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const webpack = require('webpack');
const argv = require('minimist')(process.argv.slice(2));
const RELEASE = argv.release;
const path = require('path');

function getPlugins() {
const nodeEnv = RELEASE ? '"production"' : '"development"';
Expand Down Expand Up @@ -36,7 +37,8 @@ const config = {
amd: 'react-dom'
},
'react/addons': 'React',
moment: 'moment'
moment: 'moment',
immutable: 'immutable'
},
module: {
loaders: [
Expand All @@ -45,6 +47,11 @@ const config = {
]
},
plugins: getPlugins(),
resolve: {
alias: {
common: path.resolve('packages/common/')
}
},
postLoaders: [
{
test: /\.js$/,
Expand Down
30 changes: 15 additions & 15 deletions docs/api/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"type": null
},
{
"name": "displayEnd",
"name": "rowOverscanEndIdx",
"type": null
},
{
Expand All @@ -69,13 +69,13 @@
"modifiers": [],
"params": [
{
"name": "displayStart",
"name": "rowOverscanStartIdx",
"type": {
"name": "number"
}
},
{
"name": "displayEnd",
"name": "rowOverscanEndIdx",
"type": {
"name": "number"
}
Expand Down Expand Up @@ -287,56 +287,56 @@
"required": false,
"description": ""
},
"displayStart": {
"rowOverscanStartIdx": {
"type": {
"name": "number"
},
"required": true,
"description": ""
},
"displayEnd": {
"rowOverscanEndIdx": {
"type": {
"name": "number"
},
"required": true,
"description": ""
},
"visibleStart": {
"rowVisibleStartIdx": {
"type": {
"name": "number"
},
"required": true,
"description": ""
},
"visibleEnd": {
"rowVisibleEndIdx": {
"type": {
"name": "number"
},
"required": true,
"description": ""
},
"colVisibleStart": {
"colVisibleStartIdx": {
"type": {
"name": "number"
},
"required": true,
"description": ""
},
"colVisibleEnd": {
"colVisibleEndIdx": {
"type": {
"name": "number"
},
"required": true,
"description": ""
},
"colDisplayStart": {
"colOverscanStartIdx": {
"type": {
"name": "number"
},
"required": true,
"description": ""
},
"colDisplayEnd": {
"colOverscanEndIdx": {
"type": {
"name": "number"
},
Expand Down Expand Up @@ -4178,28 +4178,28 @@
"required": false,
"description": ""
},
"colVisibleStart": {
"colVisibleStartIdx": {
"type": {
"name": "number"
},
"required": true,
"description": ""
},
"colVisibleEnd": {
"colVisibleEndIdx": {
"type": {
"name": "number"
},
"required": true,
"description": ""
},
"colDisplayStart": {
"colOverscanStartIdx": {
"type": {
"name": "number"
},
"required": true,
"description": ""
},
"colDisplayEnd": {
"colOverscanEndIdx": {
"type": {
"name": "number"
},
Expand Down
16 changes: 8 additions & 8 deletions docs/markdowns/Canvas.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ type: `shaperequire('./PropTypeShapes/CellMetaDataShape')`
type: `string`


### `colDisplayEnd` (required)
### `colOverscanEndIdx` (required)

type: `number`


### `colDisplayStart` (required)
### `colOverscanStartIdx` (required)

type: `number`


### `colVisibleEnd` (required)
### `colVisibleEndIdx` (required)

type: `number`


### `colVisibleStart` (required)
### `colVisibleStartIdx` (required)

type: `number`

Expand All @@ -46,12 +46,12 @@ type: `union(object|array)`
type: `element`


### `displayEnd` (required)
### `rowOverscanEndIdx` (required)

type: `number`


### `displayStart` (required)
### `rowOverscanStartIdx` (required)

type: `number`

Expand Down Expand Up @@ -145,12 +145,12 @@ type: `string`
type: `union(number|string)`


### `visibleEnd` (required)
### `rowVisibleEndIdx` (required)

type: `number`


### `visibleStart` (required)
### `rowVisibleStartIdx` (required)

type: `number`

Expand Down
8 changes: 4 additions & 4 deletions docs/markdowns/Row.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ type: `func`
defaultValue: `require('./Cell')`


### `colDisplayEnd` (required)
### `colOverscanEndIdx` (required)

type: `number`


### `colDisplayStart` (required)
### `colOverscanStartIdx` (required)

type: `number`


### `colVisibleEnd` (required)
### `colVisibleEndIdx` (required)

type: `number`


### `colVisibleStart` (required)
### `colVisibleStartIdx` (required)

type: `number`

Expand Down
7 changes: 5 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"lerna": "2.0.0-beta.34",
"version": "4.0.8"
"lerna": "2.8.0",
"version": "5.0.0",
"packages": [
"packages/*"
]
}
Loading

0 comments on commit f5ffea6

Please sign in to comment.