Skip to content

Commit e363112

Browse files
committed
feat: add paddingStart and paddingEnd
1 parent 84f4d8e commit e363112

File tree

16 files changed

+10925
-13
lines changed

16 files changed

+10925
-13
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,12 @@ const {
272272
- Optional
273273
- This function, if passed, is responsible for implementing the scrollTo log for the parentRef which is used when methods like `scrolllToOffset` and `scrollToIndex` are called.
274274
- Eg. You can use this function implement smooth scrolling by using the supplied offset and the `defaultScrollToFn` as seen in the sandbox's **Smooth Scroll** example.
275+
- `paddingStart: Integer`
276+
- Defaults to `0`
277+
- The amount of padding in pixels to add to the start of the virtual list
278+
- `paddingEnd: Integer`
279+
- Defaults to `0`
280+
- The amount of padding in pixels to add to the end of the virtual list
275281

276282
### Returns
277283

examples/padding/.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["react-app"]
3+
}

examples/padding/.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["react-app", "prettier"]
3+
}

examples/padding/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*

examples/padding/.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

examples/padding/.rescriptsrc.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
const path = require('path')
2+
const resolveFrom = require('resolve-from')
3+
4+
const fixLinkedDependencies = config => {
5+
config.resolve = {
6+
...config.resolve,
7+
alias: {
8+
...config.resolve.alias,
9+
react$: resolveFrom(path.resolve('node_modules'), 'react'),
10+
'react-dom$': resolveFrom(path.resolve('node_modules'), 'react-dom'),
11+
},
12+
}
13+
return config
14+
}
15+
16+
const includeSrcDirectory = config => {
17+
config.resolve = {
18+
...config.resolve,
19+
modules: [path.resolve('src'), ...config.resolve.modules],
20+
}
21+
return config
22+
}
23+
24+
module.exports = [
25+
['use-babel-config', '.babelrc'],
26+
['use-eslint-config', '.eslintrc'],
27+
fixLinkedDependencies,
28+
// includeSrcDirectory,
29+
]

examples/padding/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Example
2+
3+
To run this example:
4+
5+
- `npm install` or `yarn`
6+
- `npm run start` or `yarn start`

examples/padding/package.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"private": true,
3+
"scripts": {
4+
"start": "rescripts start",
5+
"build": "rescripts build",
6+
"test": "rescripts test",
7+
"eject": "rescripts eject",
8+
"serve": "serve -s build"
9+
},
10+
"dependencies": {
11+
"react": "^16.8.6",
12+
"react-dom": "^16.8.6",
13+
"react-scripts": "3.0.1",
14+
"react-virtual": "^2.1.8"
15+
},
16+
"devDependencies": {
17+
"@rescripts/cli": "^0.0.11",
18+
"@rescripts/rescript-use-babel-config": "^0.0.8",
19+
"@rescripts/rescript-use-eslint-config": "^0.0.9",
20+
"babel-eslint": "10.0.1",
21+
"serve": "^11.3.0"
22+
},
23+
"browserslist": {
24+
"production": [
25+
">0.2%",
26+
"not dead",
27+
"not op_mini all"
28+
],
29+
"development": [
30+
"last 1 chrome version",
31+
"last 1 firefox version",
32+
"last 1 safari version"
33+
]
34+
}
35+
}
3.78 KB
Binary file not shown.

examples/padding/public/index.html

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<!--
9+
manifest.json provides metadata used when your web app is installed on a
10+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
11+
-->
12+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
13+
<!--
14+
Notice the use of %PUBLIC_URL% in the tags above.
15+
It will be replaced with the URL of the `public` folder during the build.
16+
Only files inside the `public` folder can be referenced from the HTML.
17+
18+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
19+
work correctly both with client-side routing and a non-root public URL.
20+
Learn how to configure a non-root public URL by running `npm run build`.
21+
-->
22+
<title>React App</title>
23+
</head>
24+
<body>
25+
<noscript>You need to enable JavaScript to run this app.</noscript>
26+
<div id="root"></div>
27+
<!--
28+
This HTML file is a template.
29+
If you open it directly in the browser, you will see an empty page.
30+
31+
You can add webfonts, meta tags, or analytics to this file.
32+
The build step will place the bundled scripts into the <body> tag.
33+
34+
To begin the development, run `npm start` or `yarn start`.
35+
To create a production bundle, use `npm run build` or `yarn build`.
36+
-->
37+
</body>
38+
</html>

0 commit comments

Comments
 (0)