0.3.1 • Published 3 years ago

quasar-app-extension-filters v0.3.1

Weekly downloads
84
License
MIT
Repository
github
Last release
3 years ago

Quasar App Extension Filters

A Quasar App Extension to expose common Vue filters, like currency, percentage , capitalize and other common numeric and text filters

Install

quasar ext add filters

Quasar CLI will retrieve it from NPM and install the extension.

Prompts

Numeral thousands, and decimal delimeters, currency symbol and moment locale.

Uninstall

quasar ext remove filters

How to use

The extension will add common filters using a Quasar Boot file. Use them in your templates as common Vue filters, for example:

{{ theModel | camelCase }} {{ theModel | currency }}

String filters

Provided by Lodash

Descriptions taken from https://lodash.com/docs/4.17.15

filterparametersdescription
camelCasenoneConverts string to camelCase.
capitalizenoneConverts the first character of string to upper case and the remaining to lower case.
deburrnoneDeburrs string by converting Latin-1 Supplement and Latin Extended-A letters to basic Latin letters and removing combining diacritical marks.
kebabCasenoneConverts string to kebab-case.
lowerCasenoneConverts string, as space separated words, to lower case.
lowerFirstnoneConverts the first character of string to lower case.
padEndlength, fillStringPads string on the right side if it's shorter than length. Padding characters are truncated if they exceed length.
padStartlength, fillStringPads string on the left side if it's shorter than length. Padding characters are truncated if they exceed length.
repeatquantityPads string on the left side if it's shorter than length. Padding characters are truncated if they exceed length.
snakeCasenoneConverts string to snake_case
startCasenoneConverts string to Start Case
toLowernoneConverts string, as a whole, to lower case just like String#toLowerCase.
toUppernoneConverts string, as a whole, to upper case just like String#toUpperCase.
trimcharactersRemoves leading and trailing whitespace or specified characters from string.
trimEndcharactersRemoves trailing whitespace or specified characters from string.
trimStartcharactersRemoves leading whitespace or specified characters from string.
truncateoptions={}Truncates string if it's longer than the given maximum string length. The last characters of the truncated string are replaced with the omission string which defaults to "...". (info)https://lodash.com/docs/4.17.15#truncate
upperCasenoneConverts string, as space separated words, to upper case.
upperFirstnoneConverts the first character of string to upper case.

Numeric filters

Provided by NumeralJS

More info https://numeraljs.com/

filterparametersdescription
currencynoneShows currency format.
percentagenoneShows as percentage format, for example 0.45 shows as 45%.
numeralformatUse any NumeralJS format.

Date filters

Provided by MomentJS

More info https://momentjs.com/

filterparametersdescription
momentformatUse any MomentJS format.

Demo

https://cuatromedios.github.io/quasar-app-extension-nequ-components/#/filters

0.3.1

3 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago