This package has been deprecated

Author message:

Package no longer supported. Contact support@npmjs.com for more info.

dominate-filter-search

2.0.1 • Public • Published

Dominate-Filter-Search

Fuzzy search filter for the Dominate filtering framework

Dominate-Filter-Search filters DOM elements using the fuzzy search library Fuse.js. The search query can be set programmatically or via a DOM input element. This module is designed to filter content provided by the Dominate-Io-Dom module within the Dominate filtering framework.

Descriptor Generation

Dominate-Filter-Search filters elements by comparing each item's descriptor to the given search query. "Descriptors" are strings of keywords collected from the attributes or content of the given element and it's children.

A descriptor is generated by first looking for all children which have the descriptor class. If these children have the descriptor attribute, then that attribute's value is added to the descriptor. Otherwise, the text content of these children is added to the descriptor.

If the root element has the descriptor class, it is also processed like it's children, contributing to the descriptor. If no children have the descriptor class, then the root element becomes the sole contributer to the descriptor.

API

Filter Options

  • descClass - The descriptor class used to select elements which contribute to the descriptor.
  • descAttr - The descriptor attribute used to provide a value which contributes to the descriptor.
  • $input - The input element used to specify the search query.
  • fuse - Fuse.js options.
  • $ - The jQuery instance connected to this DOM.

Info Object

  • api
    • search(query) - A function used to programatically specify a new search query.

Readme

Keywords

none

Package Sidebar

Install

npm i dominate-filter-search

Weekly Downloads

1

Version

2.0.1

License

GPL-3.0

Last publish

Collaborators

  • npm