All Projects → joseluisq → sortboard

joseluisq / sortboard

Licence: MIT license
A small ES6 library for easy sorting and filtering of elements.

Programming Languages

typescript
32286 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to sortboard

spring-boot-jpa-rest-demo-filter-paging-sorting
Spring Boot Data JPA with Filter, Pagination and Sorting
Stars: ✭ 70 (+141.38%)
Mutual labels:  sort, filtering
Filterizr
✨ Filterizr is a JavaScript library that sorts, shuffles and filters responsive galleries using CSS3 transitions ✨
Stars: ✭ 546 (+1782.76%)
Mutual labels:  sort, filtering
Queryql
Easily add filtering, sorting, and pagination to your Node.js REST API through your old friend: the query string!
Stars: ✭ 76 (+162.07%)
Mutual labels:  sort, filtering
poet
Configuration-based post type, taxonomy, block category, and block registration for Sage 10.
Stars: ✭ 124 (+327.59%)
Mutual labels:  blocks
Natours
An awesome tour booking web app written in NodeJS, Express, MongoDB 🗽
Stars: ✭ 94 (+224.14%)
Mutual labels:  css3
algorithms
The All ▲lgorithms documentation website.
Stars: ✭ 114 (+293.1%)
Mutual labels:  sort
algos
A collection of algorithms in rust
Stars: ✭ 16 (-44.83%)
Mutual labels:  sort
laravel-filterable
Laravel 5/6/7 package to handle filtering by query-string
Stars: ✭ 117 (+303.45%)
Mutual labels:  filtering
Angular-Table-Sort-Component
Sorting Algorithm for sorting table values in angular
Stars: ✭ 18 (-37.93%)
Mutual labels:  sort
svelte-datagrid
Svelte data grid spreadsheet best best features and performance from excel
Stars: ✭ 48 (+65.52%)
Mutual labels:  filtering
dora
Find exposed API keys based on RegEx and get exploitation methods for some of keys that are found
Stars: ✭ 229 (+689.66%)
Mutual labels:  regex
Fundamentals-of-Web-Development-Solutions
Fundamentals of Web Development solutions (HTML, CSS, PHP, JAVASCRIPT, JQUERY)
Stars: ✭ 33 (+13.79%)
Mutual labels:  css3
gson
Algorithms on data formats - JSON, CBOR, Collation.
Stars: ✭ 17 (-41.38%)
Mutual labels:  sort
parallel-corpora-tools
Tools for filtering and cleaning parallel and monolingual corpora for machine translation and other natural language processing tasks.
Stars: ✭ 35 (+20.69%)
Mutual labels:  filtering
fu
Unix's Find, Unleashed.
Stars: ✭ 32 (+10.34%)
Mutual labels:  regex
php-wol
PHP WakeOnLan Interface
Stars: ✭ 30 (+3.45%)
Mutual labels:  css3
CVparser
CVparser is software for parsing or extracting data out of CV/resumes.
Stars: ✭ 28 (-3.45%)
Mutual labels:  regex
entrepot
A list of free GitHub.com hosted WordPress plugins, themes & blocks
Stars: ✭ 29 (+0%)
Mutual labels:  blocks
eliza-rs
A rust implementation of ELIZA - a natural language processing program developed by Joseph Weizenbaum in 1966.
Stars: ✭ 48 (+65.52%)
Mutual labels:  regex
Gridify
Easy and optimized way to apply Filtering, Sorting, and Pagination using text-based data.
Stars: ✭ 372 (+1182.76%)
Mutual labels:  filtering

Sortboard

npm npm Build Status JavaScript Style Guide

An small library for easy sorting and filtering of elements.

Sortboard is small library for sorting and filtering HTML elements which uses CSS3 matrix() and scale() transform functions. It supports RegEx filters and it's responsive by default.

🎉 View demo on Codepen

Install

Yarn

yarn add sortboard --dev

NPM

npm install sortboard --save-dev

The UMD build is also available on unpkg.

<script src="https://unpkg.com/sortboard/src/sortboard.umd.min.js"></script>

You can use the library via window.sortboard

Usage

Define some list. For example an ul with li child elements, then set your filters in each li element with the data-filter attribute. It can add several filters by element separated by whitespace.

Typescript:

import { sortboard, Sortboard, Listener } from 'sortboard'

const sb = sortboard({
  container: '#mylist',
  selector: 'li'
})

const onEvent: Listener = () => console.log('ok!')
sb.on('filter', onEvent)

sb.filter('programing front-end')

// Or filter using a RegEx
sb.filter(/(webdesign|illustration)/)

Markup:

<ul id="mylist">
  <li data-filter="programing"></li>
  <li data-filter="programing back-end"></li>
  <li data-filter="programing front-end UX"></li>
  <li data-filter="graphic-design illustration"></li>
  <li data-filter="webdesign front-end"></li>
  <li data-filter="graphic-design printing"></li>
</ul>

API

Options

  • container : The container of elements.
  • selector : The query selector for each element.
  • gutter : The margin for each element defined in pixels. Default is 10 pixels.
  • resetFilterValue : The reset filter value used by reset() method. Default is all.
  • hiddenClass : Class name for hidden elements. Default is .sortboard-hidden class name.
  • matchedClass : Class name for matched elements. Default is .sortboard-matched class name.

Methods

  • filter( string | RegExp ) : It's string or RegExp regular expresion pattern to filter. Which should match to data-filter attribute for each element to searching.
  • reset() : Reset the elements which uses resetFilterValue option for resetting.
  • sort() : Sort the element positions in the container. Sort method is called after the filter() method and in each trigger of window.resize event.

Events

filter

Trigger when filter is completed.

Passed params:

  • matchedElements: An array with all matched elements.
  • restElements: An array with the rest (not matched) elements.
  • filterValue: A string with the current filter value used.
sb.on('filter', (matchedElements, restElements, filterValue) => {})

sort

Trigger when sort is completed.

sb.on('sort', () => {})

Development

yarn start

Contributions

Feel free to send some pull request or issue.

License

MIT license

© 2014-present José Luis Quintana

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].