├── .babelrc
├── .editorconfig
├── .gitignore
├── .npmignore
├── .travis.yml
├── LICENSE.md
├── README.md
├── dist
├── vue-convenia-util.common.js
└── vue-convenia-util.es.js
├── jest.config.js
├── package.json
├── src
├── helpers
│ ├── date.js
│ ├── formatters.js
│ ├── functional.js
│ ├── get.js
│ ├── index.js
│ ├── string.js
│ └── validators.js
├── index.js
└── mixins
│ ├── Alignable.js
│ ├── Loadable.js
│ ├── MediaQuery.js
│ ├── ObservableFix.js
│ ├── Shadowed.js
│ └── index.js
├── test
├── formatters.spec.js
├── index.spec.js
└── validators.spec.js
└── yarn.lock
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "test": {
4 | "presets": ["@babel/preset-env"],
5 | "plugins": [
6 | "@babel/plugin-syntax-dynamic-import",
7 | "@babel/plugin-transform-modules-commonjs"
8 | ]
9 | }
10 | }
11 | }
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | # Configurações gerais
4 | [*]
5 | charset = utf-8
6 | end_of_line = lf
7 | insert_final_newline = true
8 | trim_trailing_whitespace = true
9 |
10 | # Configurações dos arquivos JavaScript & Vue
11 | [*.{js,json,vue}]
12 | indent_size = 2
13 | indent_style = space
14 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Dependências do Node.js
2 | node_modules
3 |
4 | dist
5 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | # Arquivos de teste
2 | test
3 |
4 | # Arquivos de configuração do projeto
5 | .editorconfig
6 | .npmignore
7 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - "6"
4 |
5 | before_install:
6 | - export TZ=America/Sao_Paulo
7 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Convenia
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Vue Convenia Util
2 |
3 | [![Build Status][badge-0]][link-0]
4 | [![JavaScript Style Guide][badge-1]][link-1]
5 |
6 | Plugin com validações, formatações e filtros para projetos Vue. Validação e
7 | formatação de CPF, CNPJ, datas, dinheiro (R$) etc.
8 |
9 | ## Instalação
10 |
11 | Instale a dependência publicada no NPM.
12 |
13 | ```shell
14 | yarn add vue-convenia-util
15 | ```
16 |
17 | ### Instalação global
18 |
19 | Adiciona todas as funcionalidades descritas no objeto de configuração ao
20 | protótipo do Vue e consequentemente aos componentes.
21 |
22 | ```js
23 | import Vue from 'vue'
24 | import Util from 'vue-convenia-util'
25 |
26 | Vue.use(Util, {
27 | formatters: true,
28 | formatFilters: true
29 | })
30 |
31 | new Vue({
32 | ...
33 | ```
34 |
35 | ```vue
36 |
37 | CPF: {{ user.document | toCPF }}
38 | {{ cash }}
39 |
40 |
41 |