From 36c0b430bd11c220fa544cae1893094c785f69cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yannick=20K=C3=BCchlin?= Date: Wed, 24 Aug 2022 17:26:40 +0200 Subject: [PATCH 1/2] fix: type errors --- src/filters/numberFilter.tsx | 6 +++--- src/filters/stringFilter.tsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/filters/numberFilter.tsx b/src/filters/numberFilter.tsx index e4428f2..945863c 100644 --- a/src/filters/numberFilter.tsx +++ b/src/filters/numberFilter.tsx @@ -4,7 +4,7 @@ import { DataGridFilterFn, DataGridFilterProps } from '../types'; type FilterState = { op: NumberFilterOperator; - value: number; + value?: number; }; export enum NumberFilterOperator { @@ -54,7 +54,7 @@ export const createNumberFilter = ({ op: fixedOperator || NumberFilterOperator.GreaterThan, value: 0, }); - filterFn.element = function NumberFilter({ filter, onFilterChange }: DataGridFilterProps) { + filterFn.element = function NumberFilter({ filter, onFilterChange }: DataGridFilterProps) { return ( <> {title && {title}} @@ -66,7 +66,7 @@ export const createNumberFilter = ({ label: (labels && labels[value]) || label, }))} value={filter.op || NumberFilterOperator.Equals} - onChange={(op) => onFilterChange({ ...filter, op })} + onChange={(op) => onFilterChange({ ...filter, op: op as NumberFilterOperator })} /> )} diff --git a/src/filters/stringFilter.tsx b/src/filters/stringFilter.tsx index d667116..44a261e 100644 --- a/src/filters/stringFilter.tsx +++ b/src/filters/stringFilter.tsx @@ -55,7 +55,7 @@ export const createStringFilter = ({ op: fixedOperator || StringFilterOperator.Includes, value: '', }); - filterFn.element = function ({ filter, onFilterChange }: DataGridFilterProps) { + filterFn.element = function ({ filter, onFilterChange }: DataGridFilterProps) { return ( <> {title && {title}} @@ -67,7 +67,7 @@ export const createStringFilter = ({ label: (labels && labels[value]) || label, }))} value={filter.op || StringFilterOperator.Includes} - onChange={(op) => onFilterChange({ ...filter, op })} + onChange={(op) => onFilterChange({ ...filter, op: op as StringFilterOperator })} /> )} From 12afa45f2072ae71a5745fc070c89112cab2c03f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yannick=20K=C3=BCchlin?= Date: Wed, 24 Aug 2022 17:27:07 +0200 Subject: [PATCH 2/2] v0.0.16 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 788f260..e75823a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mantine-data-grid", - "version": "0.0.15", + "version": "0.0.16", "homepage": "https://kuechlin.github.io/mantine-data-grid/", "repository": { "type": "git",