Skip to content

Commit

Permalink
chore: clean up vue examples (#4775)
Browse files Browse the repository at this point in the history
* Add Vue server-side pagination example

* Update package.json and tsconfig for new example

* Use table state functions for pagination

* Use separate ref for goToPageNumber input

* rm lock

* clean up vue examples

* run prettier

* add vue pagination example to docs site

---------

Co-authored-by: Radu Suciu <radusuciu@gmail.com>
  • Loading branch information
KevinVandy and radusuciu authored Mar 26, 2023
1 parent 15596f3 commit b14b7af
Show file tree
Hide file tree
Showing 56 changed files with 850 additions and 908 deletions.
4 changes: 4 additions & 0 deletions docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@
"to": "examples/vue/column-pinning",
"label": "Column Pinning"
},
{
"to": "examples/vue/pagination",
"label": "Pagination"
},
{
"to": "examples/vue/sorting",
"label": "Sorting"
Expand Down
1 change: 1 addition & 0 deletions examples/vue/basic/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
3 changes: 2 additions & 1 deletion examples/vue/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
"preview": "vite preview"
},
"dependencies": {
"vue": "^3.2.25",
"vue": "^3.2.33",
"@tanstack/vue-table": "8.8.2"
},
"devDependencies": {
"@types/node": "^16.11.27",
"@vitejs/plugin-vue": "^2.3.3",
"typescript": "^4.5.4",
"vite": "^2.9.9",
Expand Down
12 changes: 8 additions & 4 deletions examples/vue/basic/tsconfig.dev.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./build/types"
"outDir": "./build/types",
"types": [
"vite/client"
]
},
"files": ["src/main.ts"],
"files": [
"src/main.ts"
],
"include": [
"src"
// "__tests__/**/*.test.*"
]
}

// {
// "composite": true,
// "compilerOptions": {
Expand All @@ -28,4 +32,4 @@
// },
// "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
// "references": [{ "path": "./tsconfig.node.json" }]
// }
// }
11 changes: 5 additions & 6 deletions examples/vue/column-ordering/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "column-ordering",
"name": "tanstack-table-example-vue-column-ordering",
"version": "0.0.0",
"scripts": {
"dev": "vite",
Expand All @@ -14,10 +14,9 @@
},
"devDependencies": {
"@types/node": "^16.11.27",
"@vitejs/plugin-vue": "^2.3.1",
"@vue/tsconfig": "^0.1.3",
"typescript": "~4.6.3",
"vite": "^2.9.5",
"@vitejs/plugin-vue": "^2.3.3",
"typescript": "^4.5.4",
"vite": "^2.9.9",
"vue-tsc": "^0.34.7"
}
}
}
File renamed without changes.
4 changes: 0 additions & 4 deletions examples/vue/column-ordering/src/main.js

This file was deleted.

1 change: 0 additions & 1 deletion examples/vue/column-ordering/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { createApp } from 'vue'
// @ts-ignore
import App from './App.vue'

createApp(App).mount('#app')
34 changes: 0 additions & 34 deletions examples/vue/column-ordering/src/makeData.js

This file was deleted.

41 changes: 30 additions & 11 deletions examples/vue/column-ordering/tsconfig.dev.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
{
"extends": "@vue/tsconfig/tsconfig.web.json",
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
"outDir": "./build/types",
"types": [
"vite/client"
]
},

"references": [
{
"path": "./tsconfig.vite-config.json"
}
"files": [
"src/main.ts"
],
"include": [
"src"
// "__tests__/**/*.test.*"
]
}
// {
// "composite": true,
// "compilerOptions": {
// "target": "esnext",
// "useDefineForClassFields": true,
// "module": "esnext",
// "moduleResolution": "node",
// "strict": true,
// "jsx": "preserve",
// "sourceMap": true,
// "resolveJsonModule": true,
// "isolatedModules": true,
// "esModuleInterop": true,
// "lib": ["esnext", "dom"],
// "skipLibCheck": true
// },
// "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
// "references": [{ "path": "./tsconfig.node.json" }]
// }
8 changes: 8 additions & 0 deletions examples/vue/column-ordering/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"composite": true,
"module": "esnext",
"moduleResolution": "node"
},
"include": ["vite.config.ts"]
}
8 changes: 0 additions & 8 deletions examples/vue/column-ordering/tsconfig.vite-config.json

This file was deleted.

2 changes: 0 additions & 2 deletions examples/vue/column-ordering/vite.config.d.ts

This file was deleted.

12 changes: 0 additions & 12 deletions examples/vue/column-ordering/vite.config.js

This file was deleted.

9 changes: 1 addition & 8 deletions examples/vue/column-ordering/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import { fileURLToPath, URL } from 'url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue() as any],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
plugins: [vue()],
})
9 changes: 4 additions & 5 deletions examples/vue/column-pinning/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "column-pinning",
"name": "tanstack-table-example-vue-column-pinning",
"version": "0.0.0",
"scripts": {
"dev": "vite",
Expand All @@ -14,10 +14,9 @@
},
"devDependencies": {
"@types/node": "^16.11.27",
"@vitejs/plugin-vue": "^2.3.1",
"@vue/tsconfig": "^0.1.3",
"typescript": "~4.6.3",
"vite": "^2.9.5",
"@vitejs/plugin-vue": "^2.3.3",
"typescript": "^4.5.4",
"vite": "^2.9.9",
"vue-tsc": "^0.34.7"
}
}
8 changes: 8 additions & 0 deletions examples/vue/column-pinning/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// <reference types="vite/client" />

declare module '*.vue' {
import type { DefineComponent } from 'vue'
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
const component: DefineComponent<{}, {}, any>
export default component
}
4 changes: 0 additions & 4 deletions examples/vue/column-pinning/src/main.js

This file was deleted.

2 changes: 1 addition & 1 deletion examples/vue/column-pinning/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createApp } from 'vue'
// @ts-ignore
import App from './App.vue'

createApp(App).mount('#app')
34 changes: 0 additions & 34 deletions examples/vue/column-pinning/src/makeData.js

This file was deleted.

41 changes: 30 additions & 11 deletions examples/vue/column-pinning/tsconfig.dev.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
{
"extends": "@vue/tsconfig/tsconfig.web.json",
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
"outDir": "./build/types",
"types": [
"vite/client"
]
},

"references": [
{
"path": "./tsconfig.vite-config.json"
}
"files": [
"src/main.ts"
],
"include": [
"src"
// "__tests__/**/*.test.*"
]
}
// {
// "composite": true,
// "compilerOptions": {
// "target": "esnext",
// "useDefineForClassFields": true,
// "module": "esnext",
// "moduleResolution": "node",
// "strict": true,
// "jsx": "preserve",
// "sourceMap": true,
// "resolveJsonModule": true,
// "isolatedModules": true,
// "esModuleInterop": true,
// "lib": ["esnext", "dom"],
// "skipLibCheck": true
// },
// "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
// "references": [{ "path": "./tsconfig.node.json" }]
// }
8 changes: 8 additions & 0 deletions examples/vue/column-pinning/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"composite": true,
"module": "esnext",
"moduleResolution": "node"
},
"include": ["vite.config.ts"]
}
8 changes: 0 additions & 8 deletions examples/vue/column-pinning/tsconfig.vite-config.json

This file was deleted.

2 changes: 0 additions & 2 deletions examples/vue/column-pinning/vite.config.d.ts

This file was deleted.

12 changes: 0 additions & 12 deletions examples/vue/column-pinning/vite.config.js

This file was deleted.

9 changes: 1 addition & 8 deletions examples/vue/column-pinning/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import { fileURLToPath, URL } from 'url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue() as any],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
plugins: [vue()],
})
Loading

0 comments on commit b14b7af

Please sign in to comment.