All Projects → panteng → Vue Filters Kit

panteng / Vue Filters Kit

A collection of useful custom filters for Vue.js(v2.x.x) apps.

Projects that are alternatives of or similar to Vue Filters Kit

AdvancedHTMLParser
Fast Indexed python HTML parser which builds a DOM node tree, providing common getElementsBy* functions for scraping, testing, modification, and formatting. Also XPath.
Stars: ✭ 90 (-28%)
Mutual labels:  formatter, filter
Fungen
Replace boilerplate code with functional patterns using 'go generate'
Stars: ✭ 122 (-2.4%)
Mutual labels:  filter
Faltu
Search sort, filter, limit an array of objects in Mongo-style.
Stars: ✭ 112 (-10.4%)
Mutual labels:  filter
Javascriptprettier
A Visual Studio extension
Stars: ✭ 118 (-5.6%)
Mutual labels:  formatter
Processing Postfx
A shader based postFX library for processing.
Stars: ✭ 114 (-8.8%)
Mutual labels:  filter
Javascript Number Formatter
Lightweight & Fast JavaScript Number Formatter
Stars: ✭ 119 (-4.8%)
Mutual labels:  formatter
Pretty Yaml
PyYAML-based module to produce pretty and readable YAML-serialized data
Stars: ✭ 110 (-12%)
Mutual labels:  formatter
Spark Infotheoretic Feature Selection
This package contains a generic implementation of greedy Information Theoretic Feature Selection (FS) methods. The implementation is based on the common theoretic framework presented by Gavin Brown. Implementations of mRMR, InfoGain, JMI and other commonly used FS filters are provided.
Stars: ✭ 123 (-1.6%)
Mutual labels:  filter
Ng2 Smart Table
Angular Smart Data Table component
Stars: ✭ 1,590 (+1172%)
Mutual labels:  filter
Searchobjectgraphql
GraphQL plugin for SearchObject gem
Stars: ✭ 118 (-5.6%)
Mutual labels:  filter
Hosts Blocklists
Automatically updated, moderated and optimized lists for blocking ads, trackers, malware and other garbage
Stars: ✭ 1,749 (+1299.2%)
Mutual labels:  filter
Atom Beautify
📣 Help Wanted - Looking for Maintainer: https://github.com/Glavin001/atom-beautify/issues/2572 | 💄 Universal beautification package for Atom editor (⚠️ Currently migrating to https://github.com/Unibeautify/ and have very limited bandwidth for Atom-Beautify Issues. Thank you for your patience and understanding ❤️ )
Stars: ✭ 1,501 (+1100.8%)
Mutual labels:  formatter
Vue2 Bootstrap Table
A sortable and searchable table, as a Vue2 component, using bootstrap styling.
Stars: ✭ 120 (-4%)
Mutual labels:  filter
Searchable
Search/filter functionality for Laravel's Eloquent models
Stars: ✭ 113 (-9.6%)
Mutual labels:  filter
Auto Correct
Automatically add whitespace between CJK (Chinese, Japanese, Korean) and half-width characters (alphabetical letters, numerical digits and symbols).
Stars: ✭ 122 (-2.4%)
Mutual labels:  formatter
Android Gpuimage Plus
Android Image & Camera Filters Based on OpenGL.
Stars: ✭ 1,554 (+1143.2%)
Mutual labels:  filter
Jsonapi.rb
Lightweight, simple and maintained JSON:API support for your next Ruby HTTP API.
Stars: ✭ 116 (-7.2%)
Mutual labels:  filter
Wavelets.jl
A Julia package for fast discrete wavelet transforms and utilities
Stars: ✭ 118 (-5.6%)
Mutual labels:  filter
Editorconfig Netbeans
A NetBeans IDE plugin supporting the EditorConfig standard. ⛺
Stars: ✭ 123 (-1.6%)
Mutual labels:  formatter
Sieve
A simple, clean and elegant way to filter Eloquent models.
Stars: ✭ 123 (-1.6%)
Mutual labels:  filter

Vue-Filters-Kit

A collection of useful custom filters for Vue.js(v2.x.x) apps.

Demo

Click Here

This demo uses Bootstrap.css for styling. But you should know that no stylesheets are needed for using these filters in your webapps.

Filters

For now, vue-filters-kit contains 4 custom filters.

  1. Boolean Formatter - converts boolean values into human-readable texts, eg: true-->YES, 0-->Disabled.
  2. Byte Formatter - converts bytes to kilobytes or megabytes or gigabytes or terabytes, eg: 1000000-->976.56K.
  3. Percentage Formatter - converts numbers into percentage, eg: 0.1567-->15.67%.
  4. Timestamp Formatter - converts timestamps into human-readable time, eg: 1456989887000-->Thursday, March 3rd, 2016

Getting Started

  1. Install via npm:

     npm install vue-filters-kit --save
    
  2. Register these filters in your Vue.js app:

     const App = new Vue({
         el: '#app',
         // register filters
         filters: {
             booleanFormat: require('vue-filters-kit/filters/booleanFormatter'),
             percentageFormat: require('vue-filters-kit/filters/percentageFormatter'),
             byteFormat: require('vue-filters-kit/filters/byteFormatter'),
             timestampFormat: require('vue-filters-kit/filters/timestampFormatter')
         }
     });
    

Usage

Boolean Formatter

{{ rawValue | booleanFormat([trueText], [falseText]) }}

[trueText] is the text that will show if rawValue equals to true.

[falseText] is the text that will show if rawValue equals to false.

For example:

<span>{{ isActive | booleanFormat('Yes', 'No') }}</span>

If isActive equals to true, the rendered html will be:

<span>Yes</span>

Else if isActive equals to false, the result will will be:

<span>No</span>

By default, [trueText] is 'Yes' and [falseText] is 'No'.

Byte Formatter

{{ rawValue | byteFormat }}

rawValue is a number whose unit is byte.

For example:

<span>{{ size | byteFormat }}</span>

If size equals to 1000000, the rendered html will be:

<span>976.56 K</span>

Percentage Formatter

{{ rawValue | percentageFormat([digit]) }}

[digit] is the number of digits to keep after decimal.

For example:

<span>{{ ratio | percentageFormat(4) }}</span>
<span>{{ ratio | percentageFormat(2) }}</span>

If ratio equals to 0.15666666, the rendered html will be:

<span>15.6667%</span>
<span>15.67%</span>

By default, [digit] is 2.

Timestamp Formatter

Timestamp Formatter depends on Moment.js. Make sure you have installed Moment.js via NPM.

{{ rawValue | timestampFormat([format]) }}

rawValue is a timestamp in milliseconds.

[format] is the format of the output time string.

For example:

<span>{{ startTime | timestampFormat('YYYY/MM/DD') }}</span>

If startTime equals to 1456989887000, the rendered html will be:

<span>2016/03/03</span>

By default, [format] is 'YYYY-MM-DD HH:mm:ss'. You can see more about [format] in Moment.js Documentation.

License

MIT

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].