5.2.0 • Published 9 months ago

@nightingale-elements/nightingale-filter v5.2.0

Weekly downloads
-
License
-
Repository
github
Last release
9 months ago

nightingale-filter

Published on NPM

A custom element to filter data

Usage

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

API Reference

Properties

filters: Array

The filter configuration

[
  {
    name: "filter_name",
    type: {
      name: "group_name",
      text: "group_label"
    },
    options: {
      label: "filter_option_label",
      color: "#333"
    },
    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.