Skip to content

Commit

Permalink
Merge pull request #43 from Kuechlin/v0.0.10
Browse files Browse the repository at this point in the history
v0.0.10
  • Loading branch information
Kuechlin authored Jul 28, 2022
2 parents 55d7d31 + 3cd58d9 commit 98635e8
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 65 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/github-actions-pages.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
- name: Install and Build 🔧
run: |
npm i pnpm --location=global
pnpm i
pnpm run build:docs
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: dist-docs
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/[email protected]
- name: Install and Build 🔧
run: |
npm i pnpm --location=global
pnpm i
pnpm run build:docs
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: dist-docs
30 changes: 15 additions & 15 deletions .github/workflows/github-actions-publish.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
- 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/[email protected]
- 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}}
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
*.yml
stats.html
dist
dist-docs
7 changes: 6 additions & 1 deletion docs/components/Properties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function Properties() {
<Stack p="md">
<Title order={2} style={{ display: 'flex' }}>
{'DataGrid<'}
<Text inherit inline color="orange" children="T extends object = any" />
<Text inherit inline color="orange" children="TData extends object = any" />
{'> component props'}
</Title>
<Table>
Expand Down Expand Up @@ -90,6 +90,11 @@ const properties = [
type: 'InitialTableState',
description: 'The initial table state',
},
{
name: 'onRowClick',
type: '(event: MouseEvent<HTMLTableRowElement, MouseEvent>, row: Row<TData>) => void',
description: 'Callback when clicking on a specific row',
},
],
},
{
Expand Down
32 changes: 3 additions & 29 deletions docs/components/examples/OnRowClickExample.tsx
Original file line number Diff line number Diff line change
@@ -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<any> = (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 (
<MultiSelect
data={[
{ value: 'Peterbald', label: 'Peterbald' },
{ value: 'Chartreux', label: 'Chartreux' },
{ value: 'Highlander', label: 'Highlander' },
{ value: 'Savannah', label: 'Savannah' },
{ value: 'Birman', label: 'Birman' },
{ value: 'Burmese', label: 'Burmese' },
{ value: 'Siberian', label: 'Siberian' },
]}
value={filter || []}
onChange={onFilterChange}
placeholder="Filter value"
/>
);
};

export default function OnRowClickExample() {
return (
<CodeDemo code={grid_usage}>
Expand All @@ -36,7 +10,7 @@ export default function OnRowClickExample() {
columns={[
{
accessorKey: 'cat',
filterFn: catFilter,
filterFn: stringFilterFn,
},
]}
onRowClick={(event, row) => {
Expand All @@ -60,7 +34,7 @@ function Demo() {
columns={[
{
accessorKey: 'cat',
filterFn: catFilter,
filterFn: stringFilterFn,
},
]}
onRowClick={(event, row) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 98635e8

Please sign in to comment.