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

@timbouc/vuetify-country-region-input

v0.1.5

Published

A Vuetify country and region input select component with vue-i18n support. Use components together or standalone.

Downloads

323

Readme

vuetify-country-region-input

This package provides a pair of Vuetify components for countries/region select inputs. Components may be used together or standalone. Vue-i18n is also supported.


Installation

npm i --save @timbouc/vuetify-country-region-input
# or yarn add @timbouc/vuetify-country-region-input

Usage

import Vue from 'vue'
import VCountryRegionSelect from '@timbouc/vuetify-country-region-input'
Vue.use(VCountryRegionSelect)

new Vue({}).$mount('#app')

// then inside your vue components
export default Vue.extend({
  data: () => ({
    country: 'AU',
    region: 'South Australia'
  })
})

<template>
    <v-country-select v-model="country" :country-name="countryName" />
    <v-region-select v-model="region" :country="country" :country-name="countryName" />
</template>

Use standalone

<script>
import { VCountrySelect } from '@timbouc/vuetify-country-region-input'

export default {
  name: 'App',
  components: { VCountrySelect },
  data: () => ({
    country: 'AU',
    countryName: true
  })
};
</script>

<template>
    <v-country-select v-model="country" />
</template>

Options

In addition to Vuetify VSelect props, here are the available attributes that can be used with the provided components.

VCountrySelect

| Parameter | Required? | Default | Type | Description | | ---------------- | --------- | ------- | ------- | ------------------------------------------------------------ | | v-model | yes | '' | string | The data binding for your component | | topCountry | no | '' | string | By providing this value you will tell component what country to put at the top of the dropdown list for easy selection. Make sure to use country short code. So for United states you would provide 'US'. However, if you set countryName to true make sure to also write out full country name when setting a topCountry. In this scenerio United States would be 'United States'. | | countryName | no | false | boolean | By setting this value to true, country names will be output in full instead of using the abbreviated short codes. Make sure to set this true for both country and region if you are using. | | whiteList | no | [] | array | Fill this array with capitalized short codes of the countries you want to appear in the dropdown list. ex: ['US', 'CA', 'MX'] | | blackList | no | [] | array | Fill this array with capitalized short codes of the countries you want to remove from dropdown list. ex: ['US'] | | displayShortCode | no | false | boolean | Use this to have dropdown text display as short codes | | usei18n | no | true | boolean | Set to false if using i18n and want to disable for this component |

VRegionSelect

| Parameter | Required? | Default | Type | Description | | ------------------ | --------- | --------------- | ------- | ------------------------------------------------------------ | | v-model | yes | '' | string | The data binding for your component | | country | no | '' | string | This tells the component what country to grab the list of displayed regions from. To have it work in tandem with country component provide it the variable that is tied to the v-model of the country-select component. | | defaultRegion | no | 'AU' | string | This allows you to set a default region when choosing not to use the country attribute. It will be set to regions of the United States if not provided. | | countryName | no | false | boolean | Set this to true if you are using the region component in conjunction with Country Select and its country-name prop is set to true. | | regionName | no | false | boolean | Set this to true if you want the v-model to output full region names instead of the default abbreviations. | | whiteList | no | [] | array | Fill this array with capitalized short codes of the regions you want to appear in the dropdown list. ex: ['AL', 'AK', 'WA'] | | blackList | no | [] | array | Fill this array with capitalized short codes of the regions you want to remove from dropdown list. ex: ['AZ'] | | displayShortCode | no | false | boolean | Use this to have dropdown text display as short codes | | usei18n | no | true | boolean | Set to false if using i18n and want to disable for this component |

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Credits

License

MIT