Skip to content

Releases: convenia/vue-convenia-util

0.6.0

03 Oct 15:08
Compare
Choose a tag to compare
  • Added toDays formatter;
    format.toDays(15) === '15 dias'
    format.toDays(1) === '1 dia'
  • Added toInterval formatter;
    format.toInterval({ start: '21/03/2008', end: '23/05/2008' }, { to: 'MMMM' }) === 'Março a Maio'
  • Added ObservableFix mixin;
  • Fixed optional action of Loadable mixin.

0.5.2

21 Sep 03:54
Compare
Choose a tag to compare
  • 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

20 Sep 19:25
Compare
Choose a tag to compare
  • Added support to DateTime formats on isDate validator & toDate formatter. Fixes #9

0.4.0

21 Aug 18:03
Compare
Choose a tag to compare
  • 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

21 Aug 14:42
Compare
Choose a tag to compare
  • 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

18 Aug 19:52
Compare
Choose a tag to compare
  • Added unit tests;
  • Fixed isDate, without format option, returning false to 'DD/MM/YYYY' valid dates;
  • Fixed toMoney throwing errors formating number values;
  • Fixed toYears returning NaN formating invalid dates;
  • Fixed toDate returning 'invalid date' formating invalid dates.

0.2.0

17 Aug 22:07
Compare
Choose a tag to compare
  • Refactor formatters using a functional approach;
  • Rename options and plugins:
    • function: toAge to toYears;
    • option: validations to validators;
    • option: formaters to formatters;
    • plugin: $validation/validation to $validate/validate;
  • 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

16 Aug 21:53
Compare
Choose a tag to compare
  • 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.