react-window 1.8.4 → 1.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,10 +1,8 @@
1
1
  {
2
2
  "name": "react-window",
3
- "version": "1.8.4",
4
- "description":
5
- "React components for efficiently rendering large, scrollable lists and tabular data",
6
- "author":
7
- "Brian Vaughn <brian.david.vaughn@gmail.com> (https://github.com/bvaughn/)",
3
+ "version": "1.8.7",
4
+ "description": "React components for efficiently rendering large, scrollable lists and tabular data",
5
+ "author": "Brian Vaughn <brian.david.vaughn@gmail.com> (https://github.com/bvaughn/)",
8
6
  "contributors": [
9
7
  "Brian Vaughn <brian.david.vaughn@gmail.com> (https://github.com/bvaughn/)"
10
8
  ],
@@ -36,7 +34,11 @@
36
34
  ],
37
35
  "main": "dist/index.cjs.js",
38
36
  "module": "dist/index.esm.js",
39
- "files": ["dist", "src/*.js"],
37
+ "files": [
38
+ "dist",
39
+ "src/*.js"
40
+ ],
41
+ "sideEffects": false,
40
42
  "scripts": {
41
43
  "flow": "flow check --max-warnings=0 src && flow check website",
42
44
  "precommit": "lint-staged",
@@ -45,8 +47,7 @@
45
47
  "lint": "eslint '**/*.js'",
46
48
  "test": "cross-env CI=1 react-scripts test --env=jsdom",
47
49
  "test:watch": "react-scripts test --env=jsdom",
48
- "build:flow":
49
- "cp flow-template dist/index.cjs.js.flow && cp flow-template dist/index.esm.js.flow",
50
+ "build:flow": "cp flow-template dist/index.cjs.js.flow && cp flow-template dist/index.esm.js.flow",
50
51
  "build:source": "rollup -c",
51
52
  "build": "del dist && mkdir dist && yarn build:flow && yarn build:source",
52
53
  "start": "rollup -c -w",
@@ -56,7 +57,10 @@
56
57
  "website:run": "cd website && yarn start"
57
58
  },
58
59
  "lint-staged": {
59
- "{website,src}/**/*.{js,json,css}": ["prettier --write", "git add"],
60
+ "{website,src}/**/*.{js,json,css}": [
61
+ "prettier --write",
62
+ "git add"
63
+ ],
60
64
  "**/*.js": "eslint --max-warnings 0"
61
65
  },
62
66
  "dependencies": {
@@ -64,8 +68,8 @@
64
68
  "memoize-one": ">=3.1.1 <6"
65
69
  },
66
70
  "peerDependencies": {
67
- "react": "^15.0.0 || ^16.0.0",
68
- "react-dom": "^15.0.0 || ^16.0.0"
71
+ "react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
72
+ "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
69
73
  },
70
74
  "devDependencies": {
71
75
  "@babel/core": "^7.0.0",
@@ -91,18 +95,20 @@
91
95
  "eslint-plugin-promise": "^3.7.0",
92
96
  "eslint-plugin-react": "^7.7.0",
93
97
  "eslint-plugin-standard": "^3.0.1",
94
- "flow-bin": "^0.101.0",
98
+ "flow-bin": "^0.111.0",
95
99
  "gh-pages": "^1.1.0",
96
100
  "lint-staged": "^7.0.5",
97
101
  "prettier": "^1.12.1",
98
- "react": "^16.8.4",
99
- "react-dom": "^16.8.4",
100
- "react-is": "^16.8.4",
102
+ "react": "^17.0.1",
103
+ "react-dom": "^17.0.1",
104
+ "react-is": "^17.0.1",
101
105
  "react-scripts": "^1.1.1",
102
- "react-test-renderer": "^16.7.0",
106
+ "react-test-renderer": "^17.0.1",
103
107
  "rollup": "^1.4.1",
104
108
  "rollup-plugin-babel": "^4.3.2",
105
109
  "rollup-plugin-commonjs": "^9.2.1",
106
- "rollup-plugin-node-resolve": "^4.0.1"
110
+ "rollup-plugin-node-resolve": "^4.0.1",
111
+ "rollup-plugin-replace": "^2.2.0",
112
+ "rollup-plugin-terser": "^5.1.0"
107
113
  }
108
114
  }
@@ -610,13 +610,16 @@ export default function createGridComponent({
610
610
  if (itemStyleCache.hasOwnProperty(key)) {
611
611
  style = itemStyleCache[key];
612
612
  } else {
613
+ const offset = getColumnOffset(
614
+ this.props,
615
+ columnIndex,
616
+ this._instanceProps
617
+ );
618
+ const isRtl = direction === 'rtl';
613
619
  itemStyleCache[key] = style = {
614
620
  position: 'absolute',
615
- [direction === 'rtl' ? 'right' : 'left']: getColumnOffset(
616
- this.props,
617
- columnIndex,
618
- this._instanceProps
619
- ),
621
+ left: isRtl ? undefined : offset,
622
+ right: isRtl ? offset : undefined,
620
623
  top: getRowOffset(this.props, rowIndex, this._instanceProps),
621
624
  height: getRowHeight(this.props, rowIndex, this._instanceProps),
622
625
  width: getColumnWidth(this.props, columnIndex, this._instanceProps),
@@ -466,9 +466,12 @@ export default function createListComponent({
466
466
  const isHorizontal =
467
467
  direction === 'horizontal' || layout === 'horizontal';
468
468
 
469
+ const isRtl = direction === 'rtl';
470
+ const offsetHorizontal = isHorizontal ? offset : 0;
469
471
  itemStyleCache[index] = style = {
470
472
  position: 'absolute',
471
- [direction === 'rtl' ? 'right' : 'left']: isHorizontal ? offset : 0,
473
+ left: isRtl ? undefined : offsetHorizontal,
474
+ right: isRtl ? offsetHorizontal : undefined,
472
475
  top: !isHorizontal ? offset : 0,
473
476
  height: !isHorizontal ? size : '100%',
474
477
  width: isHorizontal ? size : '100%',
package/CHANGELOG.md DELETED
@@ -1,115 +0,0 @@
1
- Changelog
2
- ------------
3
-
4
- ### 1.8.4
5
- * 🐛 Fixed size list and grid components now accurately report `visibleStopIndex` in `onItemsRendered`. (Previously this value was incorrectly reported as one index higher.) - ([justingrant](https://github.com/justingrant) - [#274](https://github.com/bvaughn/react-window/pull/274))
6
- * 🐛 Fixed size list and grid components `scrollToItem` "center" mode when the item being scrolled to is near the viewport edge. - ([justingrant](https://github.com/justingrant) - [#274](https://github.com/bvaughn/react-window/pull/274))
7
-
8
- ### 1.8.3
9
- * 🐛 Edge case bug-fix for `scrollToItem` when scrollbars are present ([MarkFalconbridge](https://github.com/MarkFalconbridge) - [#267](https://github.com/bvaughn/react-window/pull/267))
10
- * 🐛 Fixed RTL scroll offsets for non-Chromium Edge ([MarkFalconbridge](https://github.com/MarkFalconbridge) - [#268](https://github.com/bvaughn/react-window/pull/268))
11
- * 🐛 Flow types improved ([TrySound](https://github.com/TrySound) - [#260](https://github.com/bvaughn/react-window/pull/260))
12
-
13
-
14
- ### 1.8.2
15
- * ✨ Deprecated grid props `overscanColumnsCount` and `overscanRowsCount` props in favor of more consistently named `overscanColumnCount` and `overscanRowCount`. ([nihgwu](https://github.com/nihgwu) - [#229](https://github.com/bvaughn/react-window/pull/229))
16
- * 🐛 Fixed shaky elastic scroll problems present in iOS Safari. [#244](https://github.com/bvaughn/react-window/issues/244)
17
- * 🐛 Fixed RTL edge case bugs and broken scroll-to-item behavior. [#159](https://github.com/bvaughn/react-window/issues/159)
18
- * 🐛 Fixed broken synchronized scrolling for RTL lists/grids. [#198](https://github.com/bvaughn/react-window/issues/198)
19
-
20
- ### 1.8.1
21
- * 🐛 Replaced an incorrect empty-string value for `pointer-events` with `undefined` ([oliviertassinari](https://github.com/oliviertassinari) - [#210](https://github.com/bvaughn/react-window/pull/210))
22
-
23
- ### 1.8.0
24
- * 🎉 Added new "smart" align option for grid and list scroll-to-item methods ([gaearon](https://github.com/gaearon) - [#209](https://github.com/bvaughn/react-window/pull/209))
25
-
26
- ### 1.7.2
27
- * 🐛 Add guards to avoid invalid scroll offsets when `scrollTo()` is called with a negative offset or when `scrollToItem` is called with invalid indices (negative or too large).
28
-
29
- ### 1.7.1
30
- * 🐛 Fix SSR regression introduced in 1.7.0 - ([Betree](https://github.com/Betree) - [#185](https://github.com/bvaughn/react-window/pull/185))
31
-
32
- ### 1.7.0
33
- * 🎉 Grid `scrollToItem` supports optional `rowIndex` and `columnIndex` params ([jgoz](https://github.com/jgoz) - [#174](https://github.com/bvaughn/react-window/pull/174))
34
- * DEV mode checks for `WeakSet` support before using it to avoid requiring a polyfill for IE11 - ([jgoz](https://github.com/jgoz) - [#167](https://github.com/bvaughn/react-window/pull/167))
35
-
36
- ### 1.6.2
37
- * 🐛 Bugfix for RTL when scrolling back towards the beginning (right) of the list.
38
-
39
- ### 1.6.1
40
- * 🐛 Bugfix to account for differences between Chrome and non-Chrome browsers with regard to RTL and "scroll" events.
41
-
42
- ### 1.6.0
43
- * 🎉 RTL support added for lists and grids. Special thanks to [davidgarsan](https://github.com/davidgarsan) for his support. - [#156](https://github.com/bvaughn/react-window/pull/156)
44
- * 🐛 Grid `scrollToItem` methods take scrollbar size into account when aligning items - [#153](https://github.com/bvaughn/react-window/issues/153)
45
-
46
- ### 1.5.2
47
- * 🐛 Edge case bug fix for `VariableSizeList` and `VariableSizeGrid` when the number of items decreases while a scroll is in progress. - ([iamsolankiamit](https://github.com/iamsolankiamit) - [#138](https://github.com/bvaughn/react-window/pull/138))
48
-
49
- ### 1.5.1
50
- * 🐛 Updated `getDerivedState` Flow annotations to address a warning in a newer version of Flow.
51
-
52
- ### 1.5.0
53
- * 🎉 Added advanced memoization helpers methods `areEqual` and `shouldComponentUpdate` for item renderers. - [#114](https://github.com/bvaughn/react-window/issues/114)
54
-
55
- ### 1.4.0
56
- * 🎉 List and Grid components now "overscan" (pre-render) in both directions when scrolling is not active. When scrolling is in progress, cells are only pre-rendered in the direction being scrolled. This change has been made in an effort to reduce visible flicker when scrolling starts without adding additional overhead during scroll (which is the most performance sensitive time).
57
- * 🎉 Grid components now support separate `overscanColumnsCount` and `overscanRowsCount` props. Legacy `overscanCount` prop will continue to work, but with a deprecation warning in DEV mode.
58
- * 🐛 Replaced `setTimeout` with `requestAnimationFrame` based timer, to avoid starvation issue for `isScrolling` reset. - [#106](https://github.com/bvaughn/react-window/issues/106)
59
- * 🎉 Renamed List and Grid `innerTagName` and `outerTagName` props to `innerElementType` and `outerElementType` to formalize support for attaching arbitrary props (e.g. test ids) to List and Grid inner and outer DOM elements. Legacy `innerTagName` and `outerTagName` props will continue to work, but with a deprecation warning in DEV mode.
60
- * 🐛 List re-renders items if `direction` prop changes. - [#104](https://github.com/bvaughn/react-window/issues/104)
61
-
62
- ### 1.3.1
63
- * 🎉 Pass `itemData` value to custom `itemKey` callbacks when present - [#90](https://github.com/bvaughn/react-window/issues/90))
64
-
65
- ### 1.3.0
66
- * (Skipped)
67
-
68
- ### 1.2.4
69
- * 🐛 Added Flow annotations to memoized methods to avoid a Flow warning for newer versions of Flow
70
-
71
- ### 1.2.3
72
- * 🐛 Relaxed `children` validation checks. They were too strict and didn't support new React APIs like `memo`.
73
-
74
- ### 1.2.2
75
- * 🐛 Improved Flow types for class component item renderers - ([nicholas-l](https://github.com/nicholas-l) - [#77](https://github.com/bvaughn/react-window/pull/77))
76
-
77
- ### 1.2.1
78
- * 🎉 Improved Flow types to include optional `itemData` parameter. ([TrySound](https://github.com/TrySound) - [#66](https://github.com/bvaughn/react-window/pull/66))
79
- * 🐛 `VariableSizeList` and `VariableSizeGrid` no longer call size getter functions with invalid index when item count is zero.
80
-
81
- ### 1.2.0
82
- * 🎉 Flow types added to NPM package. ([TrySound](https://github.com/TrySound) - [#40](https://github.com/bvaughn/react-window/pull/40))
83
- * 🎉 Relaxed grid `scrollTo` method to make `scrollLeft` and `scrollTop` params _optional_ (so you can only update one axis if desired). - [#63](https://github.com/bvaughn/react-window/pull/63))
84
- * 🐛 Fixed invalid `this` pointer in `VariableSizeGrid` that broke the `resetAfter*` methods - [#58](https://github.com/bvaughn/react-window/pull/58))
85
- * Upgraded to babel 7 and used shared runtime helpers to reduce package size slightly. ([TrySound](https://github.com/TrySound) - [#48](https://github.com/bvaughn/react-window/pull/48))
86
- * Remove `overflow:hidden` from inner container ([souporserious](https://github.com/souporserious) - [#56](https://github.com/bvaughn/react-window/pull/56))
87
-
88
- ### 1.1.2
89
- * 🐛 Fixed edge case `scrollToItem` bug that caused lists/grids with very few items to have negative scroll offsets.
90
-
91
- ### 1.1.1
92
- * 🐛 `FixedSizeGrid` and `FixedSizeList` automatically clear style cache when item size props change.
93
-
94
- ### 1.1.0
95
- * 🎉 Use explicit `constructor` and `super` to generate cleaner component code. ([Andarist](https://github.com/Andarist) - [#26](https://github.com/bvaughn/react-window/pull/26))
96
- * 🎉 Add optional `shouldForceUpdate` param reset-index methods to specify `forceUpdate` behavior. ([nihgwu](https://github.com/nihgwu) - [#32](https://github.com/bvaughn/react-window/pull/32))
97
-
98
- ### 1.0.3
99
- * 🐛 Avoid unnecessary scrollbars for lists (e.g. no horizontal scrollbar for a vertical list) unless content requires them.
100
-
101
- ### 1.0.2
102
-
103
- * 🎉 Enable Babel `annotate-pure-calls` option so that classes compiled by "transform-es2015-classes" are annotated with `#__PURE__`. This enables [UglifyJS to remove them if they are not referenced](https://github.com/mishoo/UglifyJS2/pull/1448), improving dead code elimination in application code. ([Andarist](https://github.com/Andarist) - [#20](https://github.com/bvaughn/react-window/pull/20))
104
- * 🎉 Update "rollup-plugin-peer-deps-external" and use new `includeDependencies` flag so that the "memoize-one" dependency does not get inlined into the Rollup bundle. ([Andarist](https://github.com/Andarist) - [#19](https://github.com/bvaughn/react-window/pull/19))
105
- * 🎉 Enable [Babel "loose" mode](https://babeljs.io/docs/en/babel-preset-env#loose) to reduce package size (-8%). ([Andarist](https://github.com/Andarist) - [#18](https://github.com/bvaughn/react-window/pull/18))
106
-
107
- ### 1.0.1
108
- Updated `README.md` file to remove `@alpha` tag from NPM installation instructions.
109
-
110
- # 1.0.0
111
- Initial release of library. Includes the following components:
112
- * `FixedSizeGrid`
113
- * `FixedSizeList`
114
- * `VariableSizeGrid`
115
- * `VariableSizeList`