Home Reference Source Repository
import {HighlightKeyword} from 'tablefilter/src/modules/highlightKeywords.js'
public class | source

HighlightKeyword

Highlight matched keywords upon filtering

Constructor Summary

Public Constructor
public

Creates an instance of HighlightKeyword

Member Summary

Public Members
public

TableFilter's emitter instance

public

Css class for highlighted term

public

TableFilter instance

Method Summary

Public Methods
public

Remove feature

public

highlight(node: Node, term: String, cssClass: String)

Highlight occurences of searched term in passed node

public

init()

Initializes HighlightKeyword instance

public

unhighlight(term: String, cssClass: String)

Removes highlight to nodes matching passed string

public

Clear all occurrences of highlighted nodes

Public Constructors

public constructor(tf: TableFilter) source

Creates an instance of HighlightKeyword

Params:

NameTypeAttributeDescription
tf TableFilter

TableFilter instance

Public Members

public emitter: Emitter source

TableFilter's emitter instance

public highlightCssClass: String source

Css class for highlighted term

public tf: TableFilter source

TableFilter instance

Public Methods

public destroy() source

Remove feature

public highlight(node: Node, term: String, cssClass: String) source

Highlight occurences of searched term in passed node

Params:

NameTypeAttributeDescription
node Node
term String

Searched term

cssClass String

Css class name

TODO: refactor this method

public init() source

Initializes HighlightKeyword instance

public unhighlight(term: String, cssClass: String) source

Removes highlight to nodes matching passed string

Params:

NameTypeAttributeDescription
term String
cssClass String

Css class to remove

public unhighlightAll() source

Clear all occurrences of highlighted nodes