diff --git a/.github/workflows/github-actions-pages.yml b/.github/workflows/github-actions-pages.yml index dfe8af0..49e5343 100644 --- a/.github/workflows/github-actions-pages.yml +++ b/.github/workflows/github-actions-pages.yml @@ -1,23 +1,23 @@ name: Build and Deploy to Github Pages on: - push: - branches: - - main + push: + branches: + - main jobs: - build-and-deploy: - runs-on: ubuntu-latest - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v2.3.1 - - name: Install and Build 🔧 - run: | - npm i pnpm --location=global - pnpm i - pnpm run build:docs - - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@4.1.7 - with: - branch: gh-pages - folder: dist-docs + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v2.3.1 + - name: Install and Build 🔧 + run: | + npm i pnpm --location=global + pnpm i + pnpm run build:docs + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@4.1.7 + with: + branch: gh-pages + folder: dist-docs diff --git a/.github/workflows/github-actions-publish.yml b/.github/workflows/github-actions-publish.yml index 7f4d315..96a0419 100644 --- a/.github/workflows/github-actions-publish.yml +++ b/.github/workflows/github-actions-publish.yml @@ -1,20 +1,20 @@ name: Build and Publish to npm on: - release: - types: [published] + release: + types: [published] jobs: - build-and-publish: - runs-on: ubuntu-latest - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v2.3.1 - - name: Install and Build 🔧 - run: | - npm i -g pnpm - pnpm i - pnpm run build - - run: pnpm publish --no-git-checks --access public - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + build-and-publish: + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v2.3.1 + - name: Install and Build 🔧 + run: | + npm i -g pnpm + pnpm i + pnpm run build + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/.prettierignore b/.prettierignore index 51796e4..03e1d01 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,3 @@ -*.yml stats.html dist dist-docs \ No newline at end of file diff --git a/docs/components/Properties.tsx b/docs/components/Properties.tsx index 5faf380..e072eaa 100644 --- a/docs/components/Properties.tsx +++ b/docs/components/Properties.tsx @@ -18,7 +18,7 @@ export default function Properties() { {'DataGrid<'} - <Text inherit inline color="orange" children="T extends object = any" /> + <Text inherit inline color="orange" children="TData extends object = any" /> {'> component props'} @@ -90,6 +90,11 @@ const properties = [ type: 'InitialTableState', description: 'The initial table state', }, + { + name: 'onRowClick', + type: '(event: MouseEvent, row: Row) => void', + description: 'Callback when clicking on a specific row', + }, ], }, { diff --git a/docs/components/examples/OnRowClickExample.tsx b/docs/components/examples/OnRowClickExample.tsx index 3ac0252..4f7a0d0 100644 --- a/docs/components/examples/OnRowClickExample.tsx +++ b/docs/components/examples/OnRowClickExample.tsx @@ -1,33 +1,7 @@ -import { MultiSelect } from '@mantine/core'; -import { DataGrid, DataGridFilterFn } from '../../../src'; +import { DataGrid, stringFilterFn } from '../../../src'; import CodeDemo from '../CodeDemo'; import { demoData } from '../../demoData'; -const catFilter: DataGridFilterFn = (row, columnId, filter) => { - const rowValue = String(row.getValue(columnId)); - return Array.isArray(filter) ? filter.includes(rowValue) : false; -}; -catFilter.autoRemove = (val) => !val; -catFilter.init = () => []; -catFilter.element = function ({ filter, onFilterChange }) { - return ( - - ); -}; - export default function OnRowClickExample() { return ( @@ -36,7 +10,7 @@ export default function OnRowClickExample() { columns={[ { accessorKey: 'cat', - filterFn: catFilter, + filterFn: stringFilterFn, }, ]} onRowClick={(event, row) => { @@ -60,7 +34,7 @@ function Demo() { columns={[ { accessorKey: 'cat', - filterFn: catFilter, + filterFn: stringFilterFn, }, ]} onRowClick={(event, row) => { diff --git a/package.json b/package.json index 72ed0f9..f3d8e5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mantine-data-grid", - "version": "0.0.9", + "version": "0.0.10", "homepage": "https://kuechlin.github.io/mantine-data-grid/", "repository": { "type": "git",