Skip to content

Latest commit

 

History

History
 
 

protvista-filter

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

protvista-filter

Published on NPM

A custom element to filter data

Usage

<protvista-filter for="filtered-component-id"></protvista-filter>

API Reference

Properties

filters: Array

The filter configuration

[
  {
    name: "filter_name",
    type: {
      name: "group_name",
      text: "Group Label"
    },
    options: {
      labels: ["Filter option label"],
      colors: ["#333"] // Array so you can specify colour ranges
    },
    filterData: item => {} // the filter function
  }
];

Events

When an option is selected, a change event is emitted, with type activefilters. It contains an array of the selected filters, which contains callback function to apply to the data.