0.2.0 • Published 5 years ago

@kazah96/react-filtrable v0.2.0

Weekly downloads
8
License
ISC
Repository
github
Last release
5 years ago

React Filtrable

Getting Started

React Filtrable allows you to build filters. Filter is made from FilterGenerators. Each filter works as finite state machine.

Basic usage

import { FilterBlock, BoolFilter } from "@kazah96/react-filtrable";
...
// Component to render
const BoolFilterComponent = ({title, onClick, currentState}) => (
  <div onClick={onClick}>
    {currentState.order === "asc" && "Ascending}
    {currentState.order === "desc" && "Descending"}
    {!currentState.active && "inactive"}
  </div>
)

const columnDefinitions = {
  id: {
    title: "ID",
    filter: BoolFilter
  }
}

render() {
  return (
	<FilterBlock columnDefinitions={columnDefinitions} onFilterChange={(filters) => console.log(filters)}/>
  )
}
0.2.0

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago