import { ValidationProvider, ValidationObserver, extend, localize, setInteractionMode } from 'vee-validate';
import pt_BR from './veeValidateMessages.json';
import rules from './veeValidateMixinRules';

setInteractionMode('eager');

localize('pt_BR', pt_BR);

Object.keys(rules).forEach(rule => {
  extend(rule, rules[rule]);
});

const veeValidateMixin = {
  components: {
    ValidationProvider,
    ValidationObserver,
  },
};

export default veeValidateMixin;
