Skip to content

Commit a475371

Browse files
committed
checkpoint
1 parent c57eee7 commit a475371

File tree

18 files changed

+1771
-1684
lines changed

18 files changed

+1771
-1684
lines changed

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

babel.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@ const cjs = NODE_ENV === 'test' || BABEL_ENV === 'commonjs'
33
const loose = true
44

55
module.exports = {
6+
targets: 'defaults, not ie 11, not ie_mob 11',
67
presets: [
78
[
89
'@babel/env',
910
{
1011
loose,
1112
modules: false,
12-
// useBuiltIns: false,
1313
// exclude: ['@babel/plugin-transform-regenerator'],
1414
},
1515
],
1616
'@babel/react',
1717
'@babel/preset-typescript',
1818
],
1919
plugins: [
20-
'babel-plugin-transform-async-to-promises',
20+
// 'babel-plugin-transform-async-to-promises',
2121
cjs && ['@babel/transform-modules-commonjs', { loose }],
2222
// [
2323
// '@babel/transform-runtime',
2424
// {
2525
// useESModules: !cjs,
26-
// version: require('./package.json').devDependencies[
26+
// version: require('./package.json').dependencies[
2727
// '@babel/runtime'
2828
// ].replace(/^[^0-9]*/, ''),
2929
// },

examples/react/dynamic/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Vite App</title>
7+
<script type="module" src="https://cdn.skypack.dev/twind/shim"></script>
78
</head>
89
<body>
910
<div id="root"></div>
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"name": "dynamic",
2+
"name": "tanstack-react-virtual-example-dynamic",
3+
"version": "0.0.0",
34
"private": true,
45
"scripts": {
56
"dev": "vite",
@@ -10,11 +11,11 @@
1011
"dependencies": {
1112
"react": "^17.0.2",
1213
"react-dom": "^17.0.2",
13-
"@tanstack/react-virtual": "3.0.0-alpha.0"
14+
"@tanstack/react-virtual": "1.0.0"
1415
},
1516
"devDependencies": {
16-
"@rollup/plugin-replace": "^3.0.1",
17-
"@vitejs/plugin-react": "^1.1.4",
18-
"vite": "^2.7.13"
17+
"@rollup/plugin-replace": "^4.0.0",
18+
"@vitejs/plugin-react": "^1.2.0",
19+
"vite": "^2.8.6"
1920
}
2021
}

examples/react/dynamic/sandbox.config.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

examples/react/dynamic/src/index.css

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,24 @@ html {
33
font-size: 14px;
44
}
55

6-
.List {
7-
border: 1px solid #e6e4dc;
8-
max-width: 100%;
6+
table {
7+
border: 1px solid lightgray;
98
}
109

11-
.ListItemEven,
12-
.ListItemOdd {
13-
display: flex;
14-
align-items: center;
15-
justify-content: center;
10+
tbody {
11+
border-bottom: 1px solid lightgray;
1612
}
1713

18-
.ListItemEven {
19-
background-color: #e6e4dc;
14+
th {
15+
border-bottom: 1px solid lightgray;
16+
border-right: 1px solid lightgray;
17+
padding: 2px 4px;
18+
}
19+
20+
tfoot {
21+
color: gray;
22+
}
23+
24+
tfoot th {
25+
font-weight: normal;
2026
}

examples/react/dynamic/src/main.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function RowVirtualizerDynamic({ rows }) {
6565
position: 'relative',
6666
}}
6767
>
68-
{rowVirtualizer.virtualItems.map(virtualRow => (
68+
{rowVirtualizer.virtualItems.map((virtualRow) => (
6969
<div
7070
key={virtualRow.index}
7171
ref={virtualRow.measureRef}
@@ -116,7 +116,7 @@ function ColumnVirtualizerDynamic({ columns }) {
116116
position: 'relative',
117117
}}
118118
>
119-
{columnVirtualizer.virtualItems.map(virtualColumn => (
119+
{columnVirtualizer.virtualItems.map((virtualColumn) => (
120120
<div
121121
key={virtualColumn.key}
122122
ref={virtualColumn.measureRef}
@@ -162,7 +162,7 @@ function GridVirtualizerDynamic({ rows, columns }) {
162162

163163
return (
164164
<>
165-
<button onClick={() => setShow(old => !old)}>Toggle</button>
165+
<button onClick={() => setShow((old) => !old)}>Toggle</button>
166166
<button onClick={() => rowVirtualizer.scrollToIndex(halfWay)}>
167167
Scroll to index {halfWay}
168168
</button>
@@ -186,12 +186,12 @@ function GridVirtualizerDynamic({ rows, columns }) {
186186
position: 'relative',
187187
}}
188188
>
189-
{rowVirtualizer.virtualItems.map(virtualRow => (
189+
{rowVirtualizer.virtualItems.map((virtualRow) => (
190190
<React.Fragment key={virtualRow.key}>
191-
{columnVirtualizer.virtualItems.map(virtualColumn => (
191+
{columnVirtualizer.virtualItems.map((virtualColumn) => (
192192
<div
193193
key={virtualColumn.key}
194-
ref={el => {
194+
ref={(el) => {
195195
virtualRow.measureRef(el)
196196
virtualColumn.measureRef(el)
197197
}}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"composite": true,
3+
"extends": "../../../tsconfig.base.json",
4+
"compilerOptions": {
5+
"outDir": "./build/types"
6+
},
7+
"files": ["src/main.tsx"],
8+
"include": [
9+
"src"
10+
// "__tests__/**/*.test.*"
11+
]
12+
}

examples/react/dynamic/vite.config.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,4 @@ export default defineConfig({
1515
}),
1616
react(),
1717
],
18-
resolve: process.env.USE_SOURCE
19-
? {
20-
alias: {
21-
'@tanstack/react-virtual': path.resolve(
22-
__dirname,
23-
'../../packages/react-virtual/src/index.tsx',
24-
),
25-
},
26-
}
27-
: {},
2818
})

0 commit comments

Comments
 (0)