How to use @pluginjs/filters - 4 common examples

To help you get started, we’ve selected a few @pluginjs/filters examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pluginjs / pluginjs / modules / time-table / src / components / classifier.js View on Github external
initFilter() {
    const items = []

    this.classType.forEach(item => {
      items.push({
        text: item,
        id: item
      })
    })

    const $filter = document.createElement('div')
    const that = this

    this.filterApi = Filters.of($filter, {
      default: this.instance.currentClass,
      items,
      onChange: () => {
        if (!that.filterApi) {
          return
        }
        const className = that.filterApi.get()
        this.instance.switchClass(className)
      }
    })

    this.filterApi.set(this.instance.currentClass)

    append($filter, this.$element)
  }
github pluginjs / pluginjs / modules / masonry / src / components / toolbar.js View on Github external
that.instance.filter(tag !== 'all' ? [tag] : [])
      }
    }

    tags.forEach(tag => {
      items.push({
        text: tag,
        id: tag
      })
    })

    config.items = items

    this.$filters = find(`.${this.classes.FILTERS}`, this.instance.element)

    Filters.of(this.$filters, config)
  }
github pluginjs / pluginjs / modules / grids / src / components / toolbar.js View on Github external
onChange(tag) {
        that.api.filter(tag !== 'all' ? [tag] : [])
      }
    }

    tags.forEach(tag => {
      items.push({
        text: tag,
        id: tag
      })
    })

    config.items = items

    this.$filters = find(`.${this.classes.FILTERS}`, this.api.element)
    Filters.of(this.$filters, config)
  }
github pluginjs / pluginjs / modules / filters / samples / src / sections / responsive / index.js View on Github external
import { query } from '@pluginjs/dom'
import Filter from '@pluginjs/filters'

const element = query('#responsive .pj-filters')
Filter.of(element, {
  responsive: true
})

@pluginjs/filters

A flexible modern filters js plugin.

GPL-3.0
Latest version published 2 years ago

Package Health Score

46 / 100
Full package analysis

Popular @pluginjs/filters functions