-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: qwik-table v1 hook + basic example * feat: row selection example * chore: add todo * add qwik examples to workspace * fix build and repo stuff. tests passing * feat: qwik filter example * fix: qwik-table package devDep & peerDep * fix qwik adapters state * code comments * fix jsx complier source + manage qwik comp on flex render + replace table state store with signal * spread state.value * fix: handle case when function(not qwik comp) is passed to flex render * some qwik docs * add sorting example * prettier * add install instructions for qwik * fix qwik flex render docs --------- Co-authored-by: Kevin Vandy <[email protected]>
- Loading branch information
1 parent
bf09ef9
commit f99f500
Showing
60 changed files
with
2,328 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
title: Qwik Table | ||
--- | ||
|
||
The `@tanstack/qwik-table` adapter is a wrapper around the core table logic. Most of it's job is related to managing state the "qwik" way, providing types and the rendering implementation of cell/header/footer templates. | ||
|
||
## Exports | ||
|
||
`@tanstack/qwik-table` re-exports all of `@tanstack/table-core`'s and the following: | ||
|
||
### `useQwikTable` | ||
|
||
Takes an `options` object and returns a table from a Qwik Store with `NoSerialize`. | ||
|
||
```ts | ||
import { useQwikTable } from '@tanstack/qwik-table' | ||
|
||
const table = useQwikTable(options) | ||
// ...render your table | ||
|
||
``` | ||
|
||
### `flexRender` | ||
|
||
A utility function for rendering cell/header/footer templates with dynamic values. | ||
|
||
Example: | ||
|
||
```jsx | ||
import { flexRender } from '@tanstack/qwik-table' | ||
//... | ||
return ( | ||
<tbody> | ||
{table.getRowModel().rows.map(row => { | ||
return ( | ||
<tr key={row.id}> | ||
{row.getVisibleCells().map(cell => ( | ||
<td key={cell.id}> | ||
{flexRender(cell.column.columnDef.cell, cell.getContext())} | ||
</td> | ||
))} | ||
</tr> | ||
) | ||
})} | ||
</tbody> | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Qwik + Vite | ||
|
||
## Qwik in CSR mode | ||
|
||
This starter is using a pure CSR (Client Side Rendering) mode. This means, that the application is fully bootstrapped in the browser. Most of Qwik innovations however take advantage of SSR (Server Side Rendering) mode. | ||
|
||
```ts | ||
export default defineConfig({ | ||
plugins: [ | ||
qwikVite({ | ||
csr: true, | ||
}), | ||
], | ||
}) | ||
``` | ||
|
||
Use `npm create qwik@latest` to create a full production ready Qwik application, using SSR and [QwikCity](https://qwik.builder.io/docs/qwikcity/), our server-side metaframwork. | ||
|
||
## Usage | ||
|
||
```bash | ||
$ npm install # or pnpm install or yarn install | ||
``` | ||
|
||
Learn more on the [Qwik Website](https://qwik.builder.io) and join our community on our [Discord](https://qwik.builder.io/chat) | ||
|
||
## Available Scripts | ||
|
||
In the project directory, you can run: | ||
|
||
### `npm run dev` | ||
|
||
Runs the app in the development mode.<br> | ||
Open [http://localhost:5173](http://localhost:5173) to view it in the browser. | ||
|
||
### `npm run build` | ||
|
||
Builds the app for production to the `dist` folder.<br> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + Qwik + TS</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "tanstack-table-example-qwik-basic", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"preview": "serve dist" | ||
}, | ||
"devDependencies": { | ||
"@builder.io/qwik": "^1.5.1", | ||
"serve": "^14.2.1", | ||
"typescript": "5.4.2", | ||
"vite": "^5.2.2" | ||
}, | ||
"dependencies": { | ||
"@tanstack/qwik-table": "^8.14.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
html { | ||
font-family: sans-serif; | ||
font-size: 14px; | ||
} | ||
|
||
table { | ||
border: 1px solid lightgray; | ||
} | ||
|
||
tbody { | ||
border-bottom: 1px solid lightgray; | ||
} | ||
|
||
th { | ||
border-bottom: 1px solid lightgray; | ||
border-right: 1px solid lightgray; | ||
padding: 2px 4px; | ||
} | ||
|
||
tfoot { | ||
color: gray; | ||
} | ||
|
||
tfoot th { | ||
font-weight: normal; | ||
} |
Oops, something went wrong.