Releases: convenia/vue-convenia-util
Releases · convenia/vue-convenia-util
0.6.0
0.5.2
-
Added
from
&to
format options on toDate;format.toDate('28/03/2017', { to: 'YYYY/MM/DD' }) === '2017/28/03' format.toDate('2017/03/28', { from: 'YYYY/MM/DD' }) === '28/03/2017'
-
Added Loadable mixin & mixin exported object.
<template> <c-spinner v-if="isLoading" /> <c-user v-else /> </template> <script> import { LOAD_USER } from '@store/types' import { mixin } from 'vue-convenia-util' const load = (vm) => vm.$store.dispatch(LOAD_USER) export default { mixins: [mixin.Loadable(load)]
0.4.1
0.4.0
- Added integration support;
- Added vee-validate to integration support;
import { Validator } from 'vee-validate' import Util from 'vue-convenia-util' Util.integrate('vee-validate', Validator)
- Changed exported API;
- now exports an object with install & integrate functions instead of exporting just install function:
import Util, { validate, format } from 'vue-convenia-util' // validate & format are still the same. Util === { // An example describing new exported API, install: (Vue) => { ... }, // with the two plugin's functions. integrate: (lib, integrator, options) => { ... } }
0.3.0
- Fix Standard test;
- Remove has at least a number on formatters validation;
Ex.('') => ''
instead of('') => null
. - Add
toPhone
formatter;format.toPhone('11917264378') === '(11) 91726-4378'
- Add
toCep
formatter;format.toCEP('15998661') === '15998-661'
- Add
toClean
formatter;format.toClean('Olá, como vai você?') === 'Ola, como vai voce?'
- Add
toSlug
formatter;format.toSlug('Vitor Luiz : Vue Convenia Util') === 'vitor-luiz-vue-convenia-util'
- Add
isCNPJ
validator;validate.isCNPJ('49.075.155/0001-86') === true validate.isCNPJ('19.289.198/2981-29') === false
- Add
isEmail
validator;validate.isEmail('convenia.com.br') === false validate.isEmail('test@test.com') === true
0.2.1
- Added unit tests;
- Fixed
isDate
, without format option, returningfalse
to 'DD/MM/YYYY' valid dates; - Fixed
toMoney
throwing errors formating number values; - Fixed
toYears
returningNaN
formating invalid dates; - Fixed
toDate
returning'invalid date'
formating invalid dates.
0.2.0
- Refactor formatters using a functional approach;
- Rename options and plugins:
- function:
toAge
totoYears
; - option:
validations
tovalidators
; - option:
formaters
toformatters
; - plugin:
$validation
/validation
to$validate
/validate
;
- function:
- Fixed #5 - invalid values on $validate.isCPF;
- Added JSDoc to all functions;
- Added unit tests / Just some of them;
- Added integration with Travis-CI;
- Added
toEmpty
to formatters that return a custom char or'-'
for empty values;<template> <p>{{ user.cpf | toCPF | toEmpty('-') }}</p> </template>
- Added
is
to validators that verify value constructor;return this.$validate.is(user.name, 'Null') ? '-' : user.name
0.1.0
- Added
toCPF
,toRG
,toMoney
,toAge
&toDate
to formaters; - Added
isDate
&isCPF
to validations; - Added installation function with
formaters
,formatFilters
&validations
options, each one enable plugin functions; - Added project structure.