Skip to content

Commit

Permalink
docs: update virtual rows example (#5237)
Browse files Browse the repository at this point in the history
* update virtualized rows example

* update lock file

* fix virtual tbody
  • Loading branch information
KevinVandy committed Dec 28, 2023
1 parent 51a6fd7 commit ff39428
Show file tree
Hide file tree
Showing 45 changed files with 595 additions and 341 deletions.
4 changes: 4 additions & 0 deletions docs/config.json
Expand Up @@ -112,6 +112,10 @@
{
"label": "Row Selection",
"to": "guide/row-selection"
},
{
"label": "Virtualization",
"to": "guide/virtualization"
}
]
},
Expand Down
3 changes: 2 additions & 1 deletion docs/guide/virtualization.md
Expand Up @@ -6,7 +6,8 @@ title: Virtualization

Want to skip to the implementation? Check out these examples:

- [virtualized-rows](../examples/react/virtualized-rows)
- [virtualized-rows (dynamic row height)](../examples/react/virtualized-rows)
- [virtualized-rows (fixed row height)](../../../../virtual/v3/docs/examples/react/table)
- [virtualized-infinite-scrolling](../examples/react/virtualized-infinite-scrolling)

## API
Expand Down
2 changes: 1 addition & 1 deletion examples/react/bootstrap/package.json
Expand Up @@ -16,7 +16,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@rollup/plugin-replace": "^5.0.1",
"@types/bootstrap": "^5.2.6",
"@types/react-bootstrap": "^0.32.32",
Expand Down
2 changes: 1 addition & 1 deletion examples/react/column-dnd/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/react-table": "8.11.2",
"react": "^18.2.0",
"react-dnd": "^16.0.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/react/column-ordering/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/react-table": "8.11.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/react/column-pinning/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/react-table": "8.11.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/react/column-resizing-performant/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/react-table": "8.11.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/react/editable-data/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/react-table": "8.11.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/react/expanding/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/react-table": "8.11.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/react/filters/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/match-sorter-utils": "8.7.6",
"@tanstack/react-table": "8.11.2",
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/react/full-width-resizable-table/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/react-table": "8.11.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/react/full-width-table/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/react-table": "8.11.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/react/fully-controlled/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/react-table": "8.11.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/react/grouping/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/react-table": "8.11.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/react/kitchen-sink/package.json
Expand Up @@ -21,7 +21,7 @@
"devDependencies": {
"@emotion/babel-plugin": "^11.10.5",
"@emotion/babel-plugin-jsx-pragmatic": "^0.2.0",
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@rollup/plugin-replace": "^5.0.1",
"@vitejs/plugin-react": "^2.2.0",
"vite": "^3.2.4"
Expand Down
2 changes: 1 addition & 1 deletion examples/react/material-ui-pagination/package.json
Expand Up @@ -18,7 +18,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@rollup/plugin-replace": "^5.0.1",
"@vitejs/plugin-react": "^2.2.0",
"vite": "^3.2.3"
Expand Down
2 changes: 1 addition & 1 deletion examples/react/pagination-controlled/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/react-table": "8.11.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/react/pagination/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/react-table": "8.11.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/react/row-dnd/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/react-table": "8.11.2",
"react": "^18.2.0",
"react-dnd": "^16.0.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/react/row-pinning/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/react-table": "8.11.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/react/row-selection/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/react-table": "8.11.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/react/sorting/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/react-table": "8.11.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/react/sorting/src/makeData.ts
Expand Up @@ -26,7 +26,7 @@ const newPerson = (): Person => {
age: faker.number.int(40),
visits: faker.number.int(1000),
progress: faker.number.int(100),
createdAt: faker.datatype.datetime({ max: new Date().getTime() }),
createdAt: faker.date.anytime(),
status: faker.helpers.shuffle<Person['status']>([
'relationship',
'complicated',
Expand Down
2 changes: 1 addition & 1 deletion examples/react/sub-components/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/react-table": "8.11.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/react/virtualized-infinite-scrolling/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/react-query": "4.16.1",
"@tanstack/react-table": "8.11.2",
"react": "^18.2.0",
Expand Down
6 changes: 0 additions & 6 deletions examples/react/virtualized-infinite-scrolling/src/index.css
Expand Up @@ -11,12 +11,6 @@ table {
width: 100%;
}

thead {
background: lightgray;
margin: 0;
position: sticky;
top: 0;
}

th {
border-bottom: 1px solid lightgray;
Expand Down
Expand Up @@ -35,7 +35,7 @@ const newPerson = (index: number): Person => {
age: faker.number.int(40),
visits: faker.number.int(1000),
progress: faker.number.int(100),
createdAt: faker.datatype.datetime({ max: new Date().getTime() }),
createdAt: faker.date.anytime(),
status: faker.helpers.shuffle<Person['status']>([
'relationship',
'complicated',
Expand Down
12 changes: 6 additions & 6 deletions examples/react/virtualized-rows/package.json
Expand Up @@ -9,15 +9,15 @@
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.3.1",
"@tanstack/react-table": "8.11.2",
"@tanstack/react-virtual": "^3.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-virtual": "^2.10.4"
"react-dom": "^18.2.0"
},
"devDependencies": {
"@rollup/plugin-replace": "^5.0.1",
"@vitejs/plugin-react": "^2.2.0",
"vite": "^3.2.3"
"@rollup/plugin-replace": "^5.0.5",
"@vitejs/plugin-react": "^4.2.1",
"vite": "^5.0.10"
}
}
17 changes: 10 additions & 7 deletions examples/react/virtualized-rows/src/index.css
Expand Up @@ -8,14 +8,14 @@ table {
border-spacing: 0;
font-family: arial, sans-serif;
table-layout: fixed;
width: 100%;
}

thead {
background: lightgray;
margin: 0;
position: sticky;
top: 0;
}

tr {
border-bottom: 1px solid lightgray;
}

th {
Expand All @@ -31,7 +31,10 @@ td {

.container {
border: 1px solid lightgray;
height: 500px;
max-width: 900px !important;
overflow: auto;
margin: 1rem auto;
}

.app {
margin: 1rem auto;
text-align: center;
}

0 comments on commit ff39428

Please sign in to comment.