npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vuetify-js-utils

v0.5.10

Published

A utils packages to Vuetify/Nuxt to Brazil and more.

Downloads

172

Readme

Vuetify and JS utils pack

This package have Vuetify/Nuxt an JS utils funcions and mixins, more especifily (but not only) for braziliam (pt-BR) projects. Esse projeto contem codigos utils incluindo mixers para Vuetify/Nuxt, mas especificamente (mas não exclusivamente) para projetos brasileros.

Install

yarn add vuetify-js-utils
# or
npm install --save vuetify-js-utils

Eg. Validate CPF or CNPJ (validar CPF ou CNPJ)

<template>
  <v-textfield label="CPF/CNPJ" :rules="[rules.required, rules.cpfOrCnpj]" />
</template>

<script>
  import { OnRules } from 'vuetify-js-utils'

  export default {
    mixins: [OnRules]
  }
</scipt>

All validates rules

  • required: 'Campo obrigatório',
  • array: 'Campo obrigatório',
  • object: 'Campo obrigatório',
  • date: 'Campo obrigatório' (YYYY-MM-DD) need inproves, currently just check length,
  • email: 'E-mail deve ser válido',
  • min6: 'Ao menos 6 caracteres.',
  • minLenght(min: number, message: String),
  • maxLenght(max: number, message: String),
  • id: 'Apenas letras minúsculas, numeros e hifens são permitidos'
  • cpf: v => checkCpf(v) || 'CPF inválido.',
  • npj: v => checkCnpj(v) || 'CNPJ inválido.',
  • cpfOrCnpj: v => checkCpf(v) || checkCnpj(v) || 'CPF ou CNPJ inválido.'

All JS utils Functions

  • arraySearch(String: prop, String: value, Array: array, Boolean: returnIndex)

    • Retorna o primeiro objeto ou seu index que ter o "value" igual contido na prop informada dentro de um Array de Objetos.
  • checkCpf(String: cpf)

    • Retorna o Boolean se o CPF informado é uma formato válido ou não de acordo com o digito verificador.
  • checkCnpj(String: cpf)

    • Retorna o Boolean se o CNPJ informado é uma formato válido ou não de acordo com o digito verificador.
  • checkCnpj(String: cpf)

    • Retorna o Boolean se o CNPJ informado é uma formato válido ou não de acordo com o digito verificador.
  • copyToClipboard(String: text)

    • Adiciona a String enviada à Área de Transferência do Sistema Operacional.
  • planeObject(Object)

    • Retorna o Objeto passado por um JSON.stringfy/parse removendo sua referencia e prototypes do objeto original.
  • getYoutubeId(String: URL)

    • Retorna o ID do video de uma URL do YouTube através de uma regex aceita maioria dos formatos de URL.
  • getCurrentURI()

    • Retorna a URL atual da página no Navegador incluindo a porta se for "localhost".
  • getCurrentURI()

    • Retorna a URL atual da página no Navegador incluindo a porta se for "localhost".
  • getUrlParam(String: param)

    • Retorna o valor de um parrametro Query String presente na URL.
  • slugify(String: text)

    • Retorna uma strin no formato kebabCase removendo todos os acentos (Ex.: "Olá mundo" => "ola-mundo"). Muito util para ser usada de na criação de IDs e SEO-Friendly URLs.

TODO

  • Create a exmple/doc page for developments test proposes.
  • Better date check rule.