Giter VIP home page Giter VIP logo

vuetify-mask's Issues

v-mask in data-table

Hi, how to use v-mask in template tag data-table

<template v-slot:[item.usu_cpf]="{ item }"> <td> <span>{{ item.usu_cpf }}</span> </td> </template>

:error-messages directive doesn't work

Hi!
I use v-text-field-simplemask. I add a directive
:error-messages="check_val"
but when the function check_val returns some value (example, "Must be filled"), the text box does not display an error and does not turn red.

using :value instead of v-model?

Great library! I'm trying to prevent my v-text-field from updating the model/input until the @change event actually fires.

  • v-model.lazy is preferred for this, but it is not supported by v-text-field
  • the next best option is to use a combination of :value & :change events but when I do this the masking doesn't work

Is v-model required for masking to work? If it is and :value can't be used, do you have any ideas how to accomplish what I'm looking to do?

attribute not passing down through deepest child.

according to v-text-field API, any attribute not listing in API doc will be passed down through the child tag which, in this case, is the input tag. So, using <v-text-field inputmode="numeric"/> will results in

... some other components...
<input inputmode="numeric" type="text" ... >
... closing tags

however the behavior of v-text-field-simplemask just passing down inputmode to v-text-field tag which is not quite usable in my case.

Using slots

Is there any way that I can use the component slots?

So far I've tried this:

<template>
  <div>
    <v-text-field-simplemask
      v-model="value"
      :label="computedLabel"
      :properties="computedProperties"
      :options="computedOptions"
      :focus="focus"
      @focus="focus = false"
    >
      <template #append>
        <v-btn icon>
          <v-icon>mdi-account</v-icon>
        </v-btn>
      </template>
    </v-text-field-simplemask>
  </div>
</template>

But no success with any of the available slot options in the v-text-field documentation.

Support focus through tabindex

When control is set on focus through tabindex, the entire control is highlighted. I think the correct behavior is to have the focus set such that its ready to accept user keyboard input.

image

<v-text-field-simplemask
label="Date of birth"
v-model="properties.dob"
v-bind:properties="{
readonly: false,
disabled: false,
outlined: true,
clearable: true,
placeholder: 'DD-MM-YYYY',
}"
v-bind:options="{
inputMask: '##-##-####',
outputMask: '##-##-####',
empty: null,
}"
v-on:keyup="keyup"
tabindex="39"

Unexpected 0 in mask

Good day,

I don't know why, but I got unexpected 0 in my phone number field

Screenshot

I don't have any 0 in my mask:

+49(####)###-#### - it's mask for screenshot

But I got +49(0 in field

<template>
  <v-card flat width="60%">
    <v-card-title class="font-weight-bold">Billing information</v-card-title>
    <v-card-subtitle class="text-body-2">This information must be kept current to ensure your account continues to be active</v-card-subtitle>
    <v-form>
      <v-card-text>
        <v-row class="pa-0">
          <v-col class="py-0" cols="12" lg="6">
            <v-text-field type="text" placeholder="First name" v-model="settings['first_name']"></v-text-field>
          </v-col>
          <v-col class="py-0" cols="12" lg="6">
            <v-text-field type="text" placeholder="Last Name" v-model="settings['last_name']"></v-text-field>
          </v-col>
        </v-row>
        <v-row class="pa-0">
          <v-col class="py-0" cols="12" lg="12">
            <v-text-field placeholder="Company Name"></v-text-field>
          </v-col>
        </v-row>
        <v-row class="pa-0">
          <v-col class="py-0" cols="12" lg="6">
            <v-select placeholder="Country"
                      :items="settings.countries"
                      v-model="settings.address.country"
                      item-text="name"
                      item-value="code"></v-select>
          </v-col>
          <v-col class="py-0" cols="12" lg="6">
            <v-text-field placeholder="State/Region"></v-text-field>
          </v-col>
        </v-row>
        <v-row class="pa-0">
          <v-col class="py-0" cols="12" lg="6">
            <v-text-field placeholder="City"></v-text-field>
          </v-col>
          <v-col class="py-0" cols="12" lg="6">
            <v-text-field placeholder="Postal Code"></v-text-field>
          </v-col>
        </v-row>
        <v-row class="pa-0">
          <v-col class="py-0" cols="12" lg="6">
            <v-text-field placeholder="Street Address"></v-text-field>
          </v-col>
          <v-col class="py-0" cols="12" lg="6">
            <v-text-field placeholder="Suite/Unit"></v-text-field>
          </v-col>
        </v-row>
        <v-row class="pa-0">
          <v-col class="py-0" cols="12" lg="6">
            <masked-input-field-component
                v-model="phoneNumber"
                label="Phone Number"
                placeholder="Phone number"
                v-bind:properties="{
                  readonly: false,
                  disabled: false,
                  outlined: false,
                  clearable: true,
                }"
                v-bind:options="{
                  humanMask: phoneMask,
                  machineMask: '###########',
                  empty: null,
                  applyAfter: false,
                  alphanumeric: true,
                  lowerCase: false,
                }"
            />
          </v-col>
          <v-col class="py-0" cols="12" lg="6">
            <v-text-field placeholder="VAT ID"></v-text-field>
          </v-col>
        </v-row>
      </v-card-text>
      <v-card-actions class="px-4">
        <v-btn type="submit" color="primary">Save Settings</v-btn>
      </v-card-actions>
    </v-form>
  </v-card>
</template>

<script>
import countries from "@/static/countries.json"
import MaskedInputFieldComponent from "../MaskedInputFieldComponent";

export default {
  name: "SettingsTabContent",
  components: {MaskedInputFieldComponent},
  props: {
    billingData: Object
  },
  data () {
    return {
      countries: countries
    }
  },
  mounted() {
  },
  methods: {
  },
  computed: {
    settings () {
      return this.billingData
    },
    phoneMask () {
      // eslint-disable-next-line no-prototype-builtins
      if (this.settings.address.country && this.countries['phoneMask'].hasOwnProperty(this.settings.address.country) ) {
        return this.countries['phoneMask'][this.settings.address.country]
      } else {
        return this.countries['phoneMask']['DE']
      }
    },
    phoneNumber: {
      get () {
        return this.settings.phone_number
      },
      set (value) {
        this.settings.phone_number = value
      }
    }
  }
}
</script>

<style scoped>

</style>


I use dynamic input mask based on country code that I choose in select field

What am I doing wrong?

v-text-field-integer on mobile

v-text-field-integer on mobile does not prevent entering comma and periods on mobile while on desktop only numbers are allowed

Números negativos e decimais

Juarez,
Tua lib é bem bacana, para mim falta poucos detalhes para ser excelente, falta usar diretamente as Rules ( pelo que vi já tem um PR que resolve isto) e aceitar números negativos, pois em aplicações financeiras e outras é bem usada.

Espero que logo resolva estes pequenos detalhes.

Forte abraço ai.

Possible to make precision mask optional on v-text-field-money

Great package!

One nice-to-have feature would be if you could dynamically allow the precision when a user types a dot. I think that would allow a better UX. Lots of times the decimals aren't needed and can be annoying to type 00 (or however many you set) before getting to a whole number. Is this possible?

Problema com Vuetify 3

Boa tarde @juareznasato.
Estou tentando utilizar seu componente com o Vuetify 3, mas sempre que insiro um valor e o componente perde o foco o valor volta para "R$ 0,00".
Estou utilizando o seu exemplo deixado no ReadMe.

Obrigado

How to set required property?

Hey, what's the best way to set rules in cnpj field?

<v-text-field-cnpj
    v-model="form.cnpj"
    label="CNPJ"
    class="ml-md-2"
    v-bind:properties='{
        rules: "[v => !!v || 'CNPJ é obrigatório']" // not working
        rules: "[rules.cnpj.required]" // not working
    }'
    v-bind:options="{
        outputMask: '##############',
    }"
></v-text-field-cnpj>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.