Skip to content

Commit

Permalink
Merge pull request #83 from Kuechlin/fix-type-erros
Browse files Browse the repository at this point in the history
fix: type-errors
  • Loading branch information
Kuechlin authored Aug 24, 2022
2 parents e5790cd + 12afa45 commit 7ba1194
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
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.15",
"version": "0.0.16",
"homepage": "https://kuechlin.github.io/mantine-data-grid/",
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions src/filters/numberFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DataGridFilterFn, DataGridFilterProps } from '../types';

type FilterState = {
op: NumberFilterOperator;
value: number;
value?: number;
};

export enum NumberFilterOperator {
Expand Down Expand Up @@ -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<FilterState>) {
return (
<>
{title && <Text>{title}</Text>}
Expand All @@ -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 })}
/>
)}

Expand Down
4 changes: 2 additions & 2 deletions src/filters/stringFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const createStringFilter = ({
op: fixedOperator || StringFilterOperator.Includes,
value: '',
});
filterFn.element = function ({ filter, onFilterChange }: DataGridFilterProps) {
filterFn.element = function ({ filter, onFilterChange }: DataGridFilterProps<FilterState>) {
return (
<>
{title && <Text>{title}</Text>}
Expand All @@ -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 })}
/>
)}

Expand Down

0 comments on commit 7ba1194

Please sign in to comment.